32

We have the formula $$5^k - 2^k$$

I have noticed that every answer you get from this formula is divisible by 3. At least, I think so. Why is this? Does it have to do with $5-2=3$?

iDivide
  • 351
  • 7
    Do you know modular arithmetic (congruences)? – Math Gems Apr 25 '13 at 23:00
  • @MathGems Not really – iDivide Apr 25 '13 at 23:01
  • you can factor out $5 -2 = 3$ as long as $k \geq 1$ – user27182 Apr 25 '13 at 23:02
  • @user27182 You should probably clarify that the remaining factor isn't $5^{k-1}-2^{k-1}$, but $5^{k-1}2^0 + 5^{k-2}2^1 + \ldots 5^1 2^{k-2} + 5^0 2^{k-1}$. It's a frequent mistake people will make. – Henry Swanson Apr 25 '13 at 23:16
  • @HenrySwanson. Yes, you're right. It was a bit of a pointless comment, really – user27182 Apr 26 '13 at 01:20
  • 28
    it is so sad that questions which are really easy and understandable are getting so many upvotes, but questions that really requires understanding are staying in a shadow. This is one of the examples.... – Salvador Dali Apr 26 '13 at 01:31
  • 5k-2k it can be written as k(5-2)=3k.. that is it.. if a number is multiple of 3 the reverse is true that is that number is divisble of 3.. – mahe thiru Apr 26 '13 at 04:29
  • Cool! This one is going in my quiver. – bright-star Apr 26 '13 at 10:07
  • 10
    @SalvadorDali that happens all over on SE; some simpler questions get lots of upvotes from people who understand the subject matter well enough to say "hey that's neat"; but who ignore questions that they don't understand well enough to vote on. Once a question gets voted onto the hot question dropdown it's going to be seen by a huge number of people most of whom don't know math beyond basic calculus and whose voting will swamp that of the mathematicians who frequent this site. – Dan Is Fiddling By Firelight Apr 26 '13 at 12:51
  • @SalvadorDali What is wrong with an easy and understandable question getting upvotes? – Beska Apr 26 '13 at 13:46
  • 8
    the thing is that a question which can be answered by any properly educated 8-class schoolchild and gives the possibility of getting huge number of points makes it reluctant for people to answer harder questions that requires some knowledge and can not be answered in 3 minutes. As @DanNeely correctly pointed, this is everywhere on SE and in my opinion this might hurt the site in the future – Salvador Dali Apr 26 '13 at 14:04
  • 3
    Look for instance at this answer http://math.stackexchange.com/a/373514/50804 . Ask yourself how hard is it to type 2^3000 in any program and copy an answer? For me this will take 30 seconds in python. How much help for you is the answer? No explanation how to achieve it, but lots of upvotes.Or look at this one http://math.stackexchange.com/q/349806/50804 - it is hard and no one would try to do it, because why should I if I can get 50 upvotes for nothing. I afraid that in such a way a site which is supposed to be for mathematics will become a homework-solver for schoolchildren. – Salvador Dali Apr 26 '13 at 14:15
  • $(-1)$: The second down voter. – Inceptio Apr 26 '13 at 14:52
  • 9
    @SalvadorDali I think you're worrying too much; the same happens everywhere and the huge numbers of upvotes for questions asking "something every programmer should know" certainly hasn't kept stackoverflow itself from becoming one of the top programming help sites. If you're really concerned though, I suggest taking the issue from here to Meta.SE since its a network wide phenomena. – Dan Is Fiddling By Firelight Apr 26 '13 at 15:23
  • 1
    Related :http://math.stackexchange.com/questions/372514/how-can-i-use-induction-solve-this/372527#372527 – lab bhattacharjee Apr 26 '13 at 16:20
  • 3
    I would also guess that a percieved elitism that scares people off from posing questions will kill the site far more quickly than simple questions will. – Beska Apr 26 '13 at 19:28
  • 1
    @SalvadorDali As far as the math.stackexchange.com/a/373514/50804 question goes, he asked about C#, which doesn't handle big integers like that. It takes you 30 seconds in Python...great. Answer, and get the upvotes. Just because you know something and think it's trivial, doesn't mean everyone does...after all, if everyone was on exactly equal footing, there wouldn't be any answerable questions. – Beska Apr 26 '13 at 19:35
  • 3
    @SalvadorDali it even has a term, it's called bikeshedding It's cause we're all human. – Rich Homolka Apr 26 '13 at 21:50
  • 3
    -1: OP tried nothing on their own. –  Apr 27 '13 at 17:09
  • @Beska: Indeed, the OP was asking for a C# solution, and all but one of the answers didn't have anything to do with it... the most upvoted one is a copy-paste from Wolfram Alpha! Trivial questions should be asked, indeed, but duplicates should be closed, too (see the link posted by lab bhattacharjee)... – A.P. May 13 '13 at 09:10
  • use principle of mathematical induction – Kns May 18 '13 at 09:55

7 Answers7

93

Yes, it does!

It's because in general you have the factorization:

$$ x^k-y^k = (x-y)(x^{k-1}+x^{k-2}y+\dots+y^{k-1}) $$

Substituting in $x=5$ and $y=2$ should show you why that works.

John Gowers
  • 24,959
33

You say congruences are not familiar. Suppose you don't know the formulas in the other answers, but you do know the polynomial Division Algorithm. Dividing $\rm\:x^k\!-\!2^k$ by $\rm\:x\!-\!2\:$ yields

$\rm\qquad x^k-2^k =\ q(x)\, (x-2) + r\quad $ for an integer $\rm\:r\:$ and integer coefficient quotient $\rm\:q(x).$

Evaluating at $\rm\ x = 2\ $ shows $\rm\ r = 0.\ $ Evaluating at $\rm\: x = 5\:$ shows $\rm\,3\,$ divides $\rm\,5^k - 2^k$

Remark $\ $ This is a special case of the Factor Theorem, as are the other answers.

Math Gems
  • 19,574
26

Recall that $$a^k - b^k = (a-b)(a^{k-1} +a^{k-2} b + \cdots + a b^{k-2} + b^{k-1}) \tag{$\star$}$$ One way to see this is, to notice that $$(a^{k-1} +a^{k-2} b + \cdots + a b^{k-2} + b^{k-1})$$ is the sum of first $k$ terms of a geometric progression with first term $a^{k-1}$ and common ratio $\dfrac{b}a$. We hence get that $$a^{k-1} +a^{k-2} b + \cdots + a b^{k-2} + b^{k-1} = a^{k-1} \left(\dfrac{1-(b/a)^k}{1-b/a}\right) = \dfrac{a^k-b^k}{a-b}$$ Rearranging above gives you $(\star)$.

  • 4
    I would say this is a better answer since it gives reason for the factorization – Enzo Apr 26 '13 at 00:58
  • If you view this as a polynomial in $a$ e.g., then the factorization is trivial because the left hand side is clearly zero when $a=b$; that is $b$ is a root, and a polynomial can be factored in terms of it's roots $(a-b_1)(a-b_2)...$ e.t.c... – Graham Hesketh Apr 26 '13 at 13:50
  • Furthermore, if $k$ were even then $a+b$ is also a root and thus all answers would be divisible by $5+2=7$, and because $7$ and $3$ are co-prime, all answers would also be divisible by $7\times 3=21$. – Graham Hesketh Apr 26 '13 at 14:03
23

Even a little knowledge of modular arithmetic makes this obvious:

$$5 \equiv 2 \pmod 3$$

and thus

$$5^k \equiv 2^k \pmod 3,$$

which is equivalent to

$$5^k - 2^k \equiv 0 \pmod 3.$$

  • 2
    The OP is not familiar with modular arithmetic (per comments under the question). That would have been my first choice too had the OP answered otherwise. – Math Gems Apr 26 '13 at 04:27
  • I saw the comments, but really, the amount of modular arithmetic needed for this can be picked up just by looking at the Wikipedia article I linked to (even if it is rather horribly written). – Ilmari Karonen Apr 26 '13 at 12:04
19

Let's use induction to prove that:

\begin{equation} 5^k - 2^k \end{equation}

is divisible by 3

Let's check the proposition for k = 0 is divisible by 3 \begin{equation} 5^0 - 2^0 = 1 - 1 = 0 \end{equation} which is divisible by 3 Let's assume that for k = n the proposition

\begin{equation} 5^n - 2^n \end{equation} is divisible by 3 and let's prove that \begin{equation} 5^{(n+1)} - 2^{(n+1)} \end{equation} is also true, so \begin{equation} 5^{(n+1)} - 2^{(n+1)} = 5{(5^n)} - 2{(2^n)} \end{equation} \begin{equation} = (3 + 2)(5^n) - 2(2^n) \end{equation} \begin{equation} = 3(5^n) + 2(5^n) - 2(2^n) \end{equation} \begin{equation} = 3(5^n) + 2(5^n - 2^n) \end{equation} So in the above expression \begin{equation} 3(5^n) \end{equation} is divisible by 3 \begin{equation} 2(5^n - 2^n) \end{equation} is divisible by 3 as per our assumption, so the finale expression \begin{equation} 3(5^n) + 2(5^n - 2^n) \end{equation} is also divisible by 3 So we can conclude that \begin{equation} 5^{(n+1)} - 2^{(n+1)} \end{equation} is divisible by 3 Meaning \begin{equation} 5^n - 2^n \end{equation} is divisible by 3 for \begin{equation} n \in \mathbb{N} \end{equation}

13

Write $5^k= (2+3)^k= {k\choose 0}2^k+ {k \choose 1}2^{k-1}3 +\cdots +{k\choose 1}3^{k-1}2+ {k\choose k}3^k$

Therefore $$5^k-2^k= {k \choose 1}2^{k-1}3 +\cdots +{k\choose 1}3^{k-1}2+ {k\choose k}3^k= 3\left ({k \choose 1}2^{k-1} +\cdots +{k\choose 1}3^{k-2}2+ {k\choose k}3^{k-1}\right)$$

clark
  • 15,327
0

We know that $x^k −y^k$ is always divisible by $x-y$ due to formula $x^k −y^k =(x−y)(x^{k−1} +x^{k−2} y+⋯+y^{ k−1} ) $

Ross Millikan
  • 374,822
sunil
  • 1
  • 1
    Welcome to MSE! It really helps readability to format questions using MahtJax (see FAQ). Regards – Amzoti Apr 27 '13 at 12:22