What is the GCD of all these numbers?

2 72 1 , 3 72 1 , 4 72 1 , , 7 2 72 1 2^{72} - 1, \quad 3^{72} - 1, \quad 4^{72} - 1,\quad \ldots , \quad 72^{72} - 1

Find the greatest common divisor of the numbers above.


The answer is 73.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Jitarani Nayak
Dec 5, 2017

For prime p p and natural number a a ,we have a p 1 1 a^{p - 1} - 1 as an integral multiple of p (by Fermat's little theorem). When p=73 then all the given numbers are of the form a 72 1 a^{72}-1 which is divisible by 73.
For 73 to be the gcd we need to show any other number, x x doesn't divide all of them.
Four cases arise for x x :
1. 0 < x < 73 0<x<73 .
Here x x will not divide x 72 1 x^{72}-1 .
2. x > 73 x>73 , and x is a prime:.
Factorise 2 72 1 2^{72}-1 and 3 72 1 3^{72}-1 by repeated application of identity a ² b ² = ( a + b ) ( a b ) a²-b²=(a+b)(a-b) and a ³ ± b ³ = ( a ± b ) ( a ² ± a b + b ² ) a³±b³=(a±b)(a²±ab+b²) . They don't have any other number in common except 73. Even if some other prime divides any number from the set it will not be part of GCD.
3. x > 73 x>73 , and x is a composite:.
Since we have shown it for all primes, i.e, which are less than 73 and which are grater than 73, it suffices to say that any x > 73 x>73 , and composite will not be part of GCD.
4. Any perfect power of 73, will also be not their GCD as 73 occurs only once in prime factorisation of 2 72 1 2^{72}-1 .
So it has been shown that any other number, x x doesn't divide all of them.
So there GCD is 73 \boxed{73}


Moderator note:

The general olympiad question would be

If p p is a prime, show that the GCD of the numbers { n p n n N } \{n^ p - n | n \in \mathbb{N} \} is p p .

Can you adapt this solution to prove this statement?


Mihaly's solution below generalize this problem to a prime p p . It avoids this solution's "Step 2 check small values" by appealing to Lagrange's Theorem.

Great! By comparing 2 72 1 2^{72} - 1 and 3 72 1 3^{72} - 1 "by hand", we can show that there are no other common prime factors.

However, the comment of "Not quite. How do you know that there isn't a larger common divisor?" still applies. In particular, you have a slight gap / error in step 3. Do you see how to close it?

Note: In a certain sense, I'm being pedantic about the exact phrasing used.

Calvin Lin Staff - 3 years, 6 months ago

Log in to reply

I'm guessing you're referring to powers of 73, which you can disqualify by seeing that 73 only appears once in 2 72 1 2^{72}-1

Stephen Brown - 3 years, 6 months ago

Log in to reply

Yes indeed :)

Calvin Lin Staff - 3 years, 6 months ago

Log in to reply

@Calvin Lin Is there a way to dispose of the higher powers of 73 and higher primes without the "by hand" factoring of the first two terms? I just guessed 73 even though I thought of the factoring but had no desire to go through that lengthy process; but even putting aside the difficulty and tediousness, if as the Challenge Master noted this is one case of a more general result then there should be another (though not necessarily easier or quicker) way?

zico quintina - 3 years, 6 months ago

Log in to reply

@Zico Quintina There is a very easy way to deal with p 2 p^2 in the Challenge Master note.

Hint: Find a term which is obviously a factor of p p but not p 2 p^2 .


To answer your question for the problem as stated, we can show that 7 3 2 ∤ 7 2 72 1 73^2 \not \mid 72^{72} -1 .

Hint: It currently seems hard to pull out factors of 7 3 2 73^2 . However, if the power was 73, and the base was close to 73, then we can use the binomial theorem.

As it turns out, this case that I'm thinking of works for general p p . However, the "obvious term in Challenge Master note" that I mentioned is still much more obvious than proving this hint.

Calvin Lin Staff - 3 years, 6 months ago

Log in to reply

@Calvin Lin You're right, dealing with p 2 p^2 in the Olympiad question is easy, just let n = p n=p , then p 2 p^2 clearly does not divide p p p = p ( p p 1 1 ) p^p - p = p(p^{p-1} - 1) . I didn't read the Olympiad question carefully and thought n n was limited to p 1 \leq p-1 .

I think I see how to use your hint to show that p 2 ( p 1 ) p 1 1 p^2 \nmid {(p-1)}^{p-1} -1 in this problem.

( p 1 ) p = k = 1 p ( p k ) p p k ( 1 ) k {(p-1)}^p = \sum_{k=1}^p {p \choose k} p^{p-k} (-1)^k

Every term in the expansion, except for last two, contain a power of p p higher than or equal to p 2 p^2 , and the next-to-last term is ( p p 1 ) p = p 2 {p\choose{p-1}} p = p^2 , so the only term not divisible by p 2 p^2 is the last one, 1 -1 .

Thus we have

( p 1 ) p 1 ( m o d p 2 ) p 2 1 ( m o d p 2 ) ( p 1 ) ( p + 1 ) ( m o d p 2 ) \begin{aligned} {(p-1)}^p & \equiv -1 \pmod {p^2} \\ & \equiv {p^2-1} \pmod {p^2} \\ & \equiv {(p-1)(p+1)} \pmod {p^2} \\ \end{aligned}

and since p 1 p-1 is relatively prime to p 2 p^2 , we can cancel that common term and arrive at

( p 1 ) p 1 p + 1 ( m o d p 2 ) (p-1)^{p-1} \equiv {p+1} \pmod {p^2}

and finally

( p 1 ) p 1 1 p ( m o d p 2 ) (p-1)^{p-1} - 1 \equiv {p} \pmod {p^2}

If I'm right about the above, then that only leaves the question about how to deal with primes > p >p ; any hints on how to do that?

Thanks for taking the time to respond.

zico quintina - 3 years, 6 months ago

Log in to reply

@Zico Quintina Yup n = p n = p and n = p 1 n = p-1 are the examples I'm thinking of.

I like the way you used ( p 1 ) p (p-1)^p to get the p 2 p^2 term, which is how I did it, in part because I was thinking of n p n n^p - n . @Ramanan Abeyakaran did it directly by using the binomial theorem, and considering the last 2 terms, since everything else has a p 2 p^2 .

( p 1 ) p 1 1 = p p 1 + + ( p 1 1 ) p 1 ( 1 ) p 2 + ( 1 ) p 1 1 p ( m o d p 2 ) (p-1)^{p-1} - 1 = p^{p-1} + \ldots + {p-1 \choose 1 } p ^1 (-1)^{p-2} + (-1)^{p-1} -1 \equiv p \pmod{p^2}


For the Challenge Master problem. In this case, using n p n n^p - n made the p 2 p^2 case easier, but makes the other cases harder.

Basically, the goal is to find a "witness" for each prime q p q \neq p . Because we're now dealing with n p n n^p - n , we no longer have n ∤ n p n n \not \mid n^p - n , which was the first step of this solution. Hence, we have to find another witness.

Generally, q ± a q \pm a for small a a are good candidates to look at, and using the "binomial theorem" trick as before. If none of those work, try k q ± a kq \pm a .

Calvin Lin Staff - 3 years, 6 months ago

¿the gap you mean is he did not prove that for example 7 3 2 73^2 does not divide the numbers? (of course that what he claims in step 2 will suffice to assert this about x=73 too) Additionally, I don't think is trivial to prove it by hand in step 2. you get numbers like 2 24 + 2 12 + 1 2^{24}+2^{12}+1 and 3 24 + 3 12 + 1 3^{24}+3^{12}+1 .

Pablo Montenegro - 3 years, 6 months ago

Log in to reply

Yes, that was tedious. I finally used calculator for the case of 3.

Jitarani Nayak - 3 years, 6 months ago

However, comparing "by hand" was wrong, because gcd ( 2 72 1 , 3 72 1 ) = 5 7 13 19 37 73 \mbox{gcd}(2^{72}-1,3^{72}-1)=5\cdot7\cdot13\cdot19\cdot37\cdot73 .

A Former Brilliant Member - 3 years, 6 months ago

@Jitarani Nayak - Your identity is incorrect. It should be a 3 ± b 3 = ( a ± b ) ( a 2 a b + b 2 ) \ \ a^3 \pm \ b^3 \ = \ (a \pm b)(a^2 \mp ab + b^2) .

Linda Slovik - 2 years, 5 months ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 06 22:19:23 2017

@author: Michael Fitzgerald
"""
# https://brilliant.org/weekly-problems/2017-12-04/advanced/

#  Find the greatest common divisor of the numbers 2^72  - 1, 3^ 72 -1 ..... 72^72 -1

low_num = 2
for i in range(low_num,73):
    numbers = [x**i-1 for x in range(low_num,i+1)]
    #print numbers
    def gcd(*numbers):
        """Return the greatest common divisor of the given integers"""
        from fractions import gcd
        return reduce(gcd, numbers)

    if len(numbers) > 3:
        print 'a = %d,%d...%d  p = %d, lcd = %d' %(low_num, low_num+1, i, i, gcd(*numbers))
    elif len(numbers) == 3:
        print 'a = %d,%d,%d  lcd = %d' %(low_num, low_num+1, i, gcd(*numbers))
    elif len(numbers) == 2:
        print 'a = %d,%d  p = %d, lcd = %d' %(low_num, low_num+1, i, gcd(*numbers))
    else:
        print 'a = %d  p = %d, lcd = %d' %(low_num, i, gcd(*numbers))

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
a = 2  p = 2, lcd = 3
a = 2,3  p = 3, lcd = 1
a = 2,3,4  lcd = 5
a = 2,3...5  p = 5, lcd = 1
a = 2,3...6  p = 6, lcd = 7
a = 2,3...7  p = 7, lcd = 1
a = 2,3...8  p = 8, lcd = 1
a = 2,3...9  p = 9, lcd = 1
a = 2,3...10  p = 10, lcd = 11
a = 2,3...11  p = 11, lcd = 1
a = 2,3...12  p = 12, lcd = 13
a = 2,3...13  p = 13, lcd = 1
a = 2,3...14  p = 14, lcd = 1
a = 2,3...15  p = 15, lcd = 1
a = 2,3...16  p = 16, lcd = 17
a = 2,3...17  p = 17, lcd = 1
a = 2,3...18  p = 18, lcd = 19
a = 2,3...19  p = 19, lcd = 1
a = 2,3...20  p = 20, lcd = 1
a = 2,3...21  p = 21, lcd = 1
a = 2,3...22  p = 22, lcd = 23
a = 2,3...23  p = 23, lcd = 1
a = 2,3...24  p = 24, lcd = 1
a = 2,3...25  p = 25, lcd = 1
a = 2,3...26  p = 26, lcd = 1
a = 2,3...27  p = 27, lcd = 1
a = 2,3...28  p = 28, lcd = 29
a = 2,3...29  p = 29, lcd = 1
a = 2,3...30  p = 30, lcd = 31
a = 2,3...31  p = 31, lcd = 1
a = 2,3...32  p = 32, lcd = 1
a = 2,3...33  p = 33, lcd = 1
a = 2,3...34  p = 34, lcd = 1
a = 2,3...35  p = 35, lcd = 1
a = 2,3...36  p = 36, lcd = 37
a = 2,3...37  p = 37, lcd = 1
a = 2,3...38  p = 38, lcd = 1
a = 2,3...39  p = 39, lcd = 1
a = 2,3...40  p = 40, lcd = 41
a = 2,3...41  p = 41, lcd = 1
a = 2,3...42  p = 42, lcd = 43
a = 2,3...43  p = 43, lcd = 1
a = 2,3...44  p = 44, lcd = 1
a = 2,3...45  p = 45, lcd = 1
a = 2,3...46  p = 46, lcd = 47
a = 2,3...47  p = 47, lcd = 1
a = 2,3...48  p = 48, lcd = 1
a = 2,3...49  p = 49, lcd = 1
a = 2,3...50  p = 50, lcd = 1
a = 2,3...51  p = 51, lcd = 1
a = 2,3...52  p = 52, lcd = 53
a = 2,3...53  p = 53, lcd = 1
a = 2,3...54  p = 54, lcd = 1
a = 2,3...55  p = 55, lcd = 1
a = 2,3...56  p = 56, lcd = 1
a = 2,3...57  p = 57, lcd = 1
a = 2,3...58  p = 58, lcd = 59
a = 2,3...59  p = 59, lcd = 1
a = 2,3...60  p = 60, lcd = 61
a = 2,3...61  p = 61, lcd = 1
a = 2,3...62  p = 62, lcd = 1
a = 2,3...63  p = 63, lcd = 1
a = 2,3...64  p = 64, lcd = 1
a = 2,3...65  p = 65, lcd = 1
a = 2,3...66  p = 66, lcd = 67
a = 2,3...67  p = 67, lcd = 1
a = 2,3...68  p = 68, lcd = 1
a = 2,3...69  p = 69, lcd = 1
a = 2,3...70  p = 70, lcd = 71
a = 2,3...71  p = 71, lcd = 1
a = 2,3...72  p = 72, lcd = 73

Michael Fitzgerald - 3 years, 6 months ago

Further to Challenge Master note, the statement is wrong, since for the prime p = 73 p=73 and the numbers 2 , 3 , 4 , 5 , 6 , 7 2,3,4,5,6,7 it does not hold true: gcd ( 2 73 2 , 3 73 3 , 4 73 4 , 5 73 5 , 6 73 6 , 7 73 7 ) = 2 3 5 7 13 19 37 73 \mbox{gcd}(2^{73}-2,3^{73}-3,4^{73}-4,5^{73}-5,6^{73}-6,7^{73}-7)=2\cdot3\cdot5\cdot7\cdot13\cdot19\cdot37\cdot73 .

A Former Brilliant Member - 3 years, 6 months ago

Jitarani Nayak is wrong: 2 72 1 = 3 3 5 7 13 17 19 37 73 109 241 433 38737 2^{72}-1=3^3\cdot5\cdot7\cdot13\cdot17\cdot19\cdot37\cdot73\cdot109\cdot241\cdot433\cdot38737 , and 3 72 1 = 2 5 5 7 13 19 37 41 73 757 6481 530713 282429005041 3^{72}-1=2^5\cdot5\cdot7\cdot13\cdot19\cdot37\cdot41\cdot73\cdot757\cdot6481\cdot530713\cdot282429005041 . So, the numbers 2 72 1 2^{72}-1 and 3 72 1 3^{72}-1 have the primes 5 , 7 , 13 , 19 , 37 , 73 5,7,13,19,37,73 in common!

A Former Brilliant Member - 3 years, 6 months ago

Log in to reply

The point is that 73 is the largest prime in common, and smaller primes will not divide the term p 72 1 p^{72}-1 in the problem, so they need not be considered.

Stephen Brown - 3 years, 6 months ago

Log in to reply

Please note what Jitarani Nayak says: They (which means 2 72 1 2^{72}-1 and 3 72 1 3^{72}-1 ) don't have any other number in common except 73 73 . Further, we are looking for the greatest common divisor not for the largest prime in common! If there are lesser prime divisors of 73 73 , they might be parts of gcd! The greatest common divisor of a set of integers is the largest integer that divides each integer in the set. So, it is necessary to prove that there are no other prime divisors of all the numbers k 72 1 , k = 2 , , 72 , k^{72}-1,\,k=2,\ldots,72, except for 73 73 . Who says that lesser primes will not divide the term k 72 1 k^{72}-1 ?! I have show that it is not true! The point to be proved is that the prime divisors lesser as well as greater than 73 73 don't divide all of them!

A Former Brilliant Member - 3 years, 6 months ago

You can see my generalization at the solutions, just click on "load more solutions".

Mihaly Hanics - 3 years, 6 months ago

Very good and thorough solution.

Daniel Xian - 2 years, 7 months ago
Mihaly Hanics
Dec 9, 2017

I have the generalization for all primes. I don't know how to use TeX, so mind my formal mistakes.

We'll prove that the only nonzero and nonone number for which 2 p 1 , 3 p 1 , . . . , ( p 1 ) p 1 2^{p-1},3^{p-1},..., (p-1)^{p-1} all give 1 residue is the number p p . (p is an odd prime).Thus, the greatest common divisor is p.

p divides all of them according to the Little Fermat Theorem. Looking at the smaller divisors, it's obvious they won't divide all of them. We note that this means that no primes between 2 and p-1 divide all of them, so any number that is divisible by them is not a solution either (won't divide all of them). So we only got to check higher numbers than p.

If we prove that no higher primes divide all of these numbers then we are done by the same argument. We'll use a little bit of polynomial theory/fields. (I swear, if anyone hasn't had a read on them I recommend it the highest for IMO or any other high level competition, it's key. It solves harder problems so easy, also really helpful in easier problems.)

Assume that r r is a (bigger than p) prime that divides all of our numbers. Note that 1 p 1 1^{p-1} also gives 1. Thus, the x p 1 1 0 ( m o d r ) x^{p-1}-1 \equiv 0 \pmod{r} polynomial has p-1 roots: 1 , 2 , . . . p 1 1,2,...p-1 . It is known, that if we have a prime p p , then any nonzero polynomials modulo p of degree n have at max n roots (This is called Lagrange's Theorem .). It means that we can't have any other roots.

But note that since p-1 is even, r-1 is also a root, because ( r 1 ) p 1 ( 1 ) p 1 = 1 ( m o d r ) (r-1)^{p-1} \equiv (-1)^{p-1}=1 \pmod{r} , but we can't any new roots, hence r 1 r-1 equals a number between 1 , 2 , . . p 1 1,2,..p-1 . But that's impossible, since r > p r>p , we have r 1 > p 1 r-1>p-1 , also r 1 > p 1 > p 2 > . . . > 2 > 1 r-1>p-1>p-2>...>2>1 so r-1 is bigger than all of them, can't equal any of them. Contradiction, no higher prime can divide all of 2 p 1 1 , . . . ( p 1 ) p 1 1 2^{p-1}-1,... (p-1)^{p-1}-1 , thus only p divides it.

Finally, we have to check whether any of p 2 , p 3 , . . . p^2, p^3,... divides all of them. But that's trivial, we can show that p 2 p^2 doesn't divide ( p 1 ) p 1 1 (p-1)^{p-1}-1 because ( p 1 ) p 1 1 p ( m o d p 2 ) (p-1)^{p-1}-1 \equiv -p \pmod{p^2} , you can see this expanding out via the binomial theorem. Hence, none of them divides it, only p p .

Hence their greatest common divisor is p p .

It is better to formulate the first sentence like this: We'll prove that the only nonzero number dividing all the numbers k p 1 1 , k = 2 , , p 1 , k^{p-1}-1,\,k=2,\ldots,p-1, is the odd prime number p . p. Thus, the greatest common divisor is p p . Yet, it isn't quite obvious that prime divisors lesser than p p won't divide all of them. This should be included in the proof. A suggestion: if there is a prime divisor, let's say q q , lesser than p p , dividing all of the numbers k p 1 1 , k = 2 , , p 1 , k^{p-1}-1,\,k=2,\ldots,p-1, it must be one of the numbers k = 2 , , p 1 k=2,\ldots,p-1 . However, in that case it's impossible for q q to divide q p 1 1 q^{p-1}-1 . Also, when proving that no greater primes divide all of the numbers k p 1 1 , k = 2 , , p 1 , k^{p-1}-1,\,k=2,\ldots,p-1, one should state that it is the Lagrange theorem saying that p 1 p-1 is the maximum number of permissible roots of the polynomial congruence x p 1 1 0 ( m o d p ) x^{p-1}-1\equiv0\pmod p .

A Former Brilliant Member - 3 years, 6 months ago

Log in to reply

  1. I think it was quite trivial that smaller primes can't divide it, exactly because $q$ doesn't dive q p 1 1 q^{p-1}-1 . Anyone that has given this problem a try and worked on it for at least 10 mins noticed it (probably).

  • Sure, I'll edit the Lagrange part. I didn't really put much effort in the formulation, just wanted to write down the solution quickly.

  • Mihaly Hanics - 3 years, 6 months ago

    Log in to reply

    All right, but, I think it is not bad to include my above suggestion, as you wish. The proof would look complete that way.

    A Former Brilliant Member - 3 years, 6 months ago

    Log in to reply

    @A Former Brilliant Member You're right, I should conclude it, but I'm a bit tired/busy/lazy. I still have KöMaL to do and send, tommorow is the final day.

    Mihaly Hanics - 3 years, 6 months ago

    Very nicely done :)

    Calvin Lin Staff - 3 years, 6 months ago

    Log in to reply

    Thank you. :)

    Mihaly Hanics - 3 years, 6 months ago

    I think you still need to prove p 2 p^2 doesn't give residues 1, but that's easy from the binomial theorem.

    Zbyněk Konečný - 3 years, 6 months ago
    Takuma Suzuki
    Nov 21, 2017

    Ans: 73. If the power is prime, the gcd is 1, Else the gcd is the power + 1. Do from the simplest: If the power = 3, 2^3 - 1, 3^3 - 1. 7, 8 -> gcd = 1 If the power = 4, 2^4 - 1, 3^4 - 1, 4^4 - 1. 15, 80, 255 -> gcd = 5 Etc. :)

    Not quite. What you have shown is that 73 divides all of these numbers. However, how do you know that there isn't a larger common divisor?

    Put another way, I can likewise show that "1 divides all of these numbers". Can I then conclude that "hence gcd = 1"?

    Calvin Lin Staff - 3 years, 6 months ago

    but 5^4-1=624 and 624 isnt a multiple of 5

    Wuu Yyiizzhhoouu - 3 years, 6 months ago
    Vikas Venkatraman
    Nov 27, 2017

    If p is a prime no. ,then (a^(p − 1) − 1) is an integral multiple of p (by Fermat's little theorem),(where a can be any integer). when p=73 then all the given no. are of the form (a^(72)-1) which is divisible by 73 (by theorem). hence gcd=73

    Not quite. What you have shown is that 73 divides all of these numbers. However, how do you know that there isn't a larger common divisor?

    Put another way, I can likewise show that "1 divides all of these numbers". Can I then conclude that "hence gcd = 1"?

    Calvin Lin Staff - 3 years, 6 months ago

    Log in to reply

    73>1; so greatest common divisor is 73 @Calvin Lin

    Mahdi Hasnat Siyam - 3 years, 6 months ago

    Log in to reply

    What?

    You haven't shown there's no primes other than 73 dividing all of the numbers, so you cannot claim 73 is the gcd.

    Ivo Zerkov - 3 years, 6 months ago

    0 pending reports

    ×

    Problem Loading...

    Note Loading...

    Set Loading...