It can be shown that, for all positive integers n ,
Find the largest positive integer M such that the following is true:
n 7 − n is divisible by M for all positive integers n .
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.
This is the simplest solution to follow. Thank you.
Log in to reply
I think the same. Very nice solution.
How did you factor out there at the 3rd step?
Log in to reply
Are you referring to the third step on the second line? If so, then note that in general
a 3 − b 3 = ( a − b ) ( a 2 + a b + b 2 ) and a 3 + b 3 = ( a + b ) ( a 2 − a b + b 2 ) .
The question, “But is this the maximum possible value M?” can also be answered without using modular arithmetic:
1) With n=2, 2⁷ – 2 = 126
2) With n=3, 3⁷ – 3 = 2184
3) gcd(126, 2184) = 42, where gcd(…) refers to the greatest common divisor of the specified integers.
4) We saw that (n⁷–n) is always divisible by 42 for all integers n (not just positive values of n). For the specific cases n=2 and n=3, gcd(126, 2184) = 42. Thus, there can be no greater common divisor across all integer values of n.
5) Thus gcd(n⁷–n, for all integers n) = M = 42.
NOTE: Fermat’s Little Theorem holds for all values of n, not just positive values. There is also nothing in Brian Carlesworth’s proof to limit n to positive numbers. Thus the original requirement, that n be positive, is not necessary as the solution works with any integer n.
is there a non modular way of showing it is divisible by 7
I'm attempting to show the following more general result: For N > 1 , the largest M such that n N − n is divisible by M for all positive n is M = ∏ ( p − 1 ) ∣ ( N − 1 ) p , where p is a prime. In the case of N = 7 we find M = 2 × 3 × 7 = 4 2 .
For a prime p , we have n N ≡ n ( m o d p ) iff n N − 1 ≡ 1 ( m o d p ) for all n that are not divisible by p . Fermat tells us that this is the case iff p − 1 ∣ N − 1 . Note that M is squarefree since p N − p fails to be divisible by p 2 .
Oh god, this is so beautiful!
the most fascinating method for this question
Note that 5 does not necessarily divide n 7 − n since 2 7 − 2 = 1 2 6 is not divisible by 5 .
By Fermat's Little Theorem , n 7 ≡ n m o d 7 and thus n 7 − n is divisible by 7 . Now, factor: n 7 − n = ( n − 1 ) n ( n + 1 ) ( n 2 − n + 1 ) ( n 2 + n + 1 ) Since n − 1 , n , and n + 1 are three consecutive integers, at least one must be even and one must be divisible by 3 . Thus both 2 and 3 divide n 7 − n as well. Now, let p > 7 be prime and let n = 2 n 7 − n = ( n − 1 ) n ( n + 1 ) ( n 2 − n + 1 ) ( n 2 + n + 1 ) = 1 × 2 × 3 × 3 × 7 ≡ 0 m o d p Since 2 , 3 , 7 < p Thus n 7 − n is not divisible by p for any prime greater than 7 .
At this point, we know that M = 2 a 3 b 7 c . We now show that a = b = c = 1 . We do this by showing that, with the proper choice of n , n 7 − n is not divisible by p 2 for prime p :
Let n = p . Then n 7 − n = ( n − 1 ) n ( n + 1 ) ( n 2 − n + 1 ) ( n 2 + n + 1 ) = ( p − 1 ) p ( p + 1 ) ( − p + 1 ) ( p + 1 ) ≡ 0 m o d p 2 Since none of p − 1 , p + 1 , − p + 1 are divisible by p , p appears only once as a factor
Therefore, M = 2 × 3 × 7 = 4 2 .
As an alternative to the last step, one could also use n = 4 2 . Then n 7 − n = 2 3 0 , 5 3 9 , 3 3 3 , 2 0 6 which is not divisible by 4 , 9 or 4 9 .
n=6, giving 279,930 also works as demonstration of the last step I believe. It is not divisible by 4, 9 or 49.
Oh wow, this is a very unexpected approach. I like you how you break it down to M = 2 a 3 b 7 c .
42 in my head in less then 9 seconds
Log in to reply
I don't know what your point is. It's one thing to see (or guess) the likely solution. It's another thing to prove it.
Let f(n) = n^7 - n.
We start with n=2.
What ist the max. factor of f(2)? It is 7.
gcd( f(2), f(3), f(4), f(5), f(6) ) = 42 =M
You have only worked on the five numbers f(2), f(3), f(4), f(5), f(6).
How do you know that f(7), f(8), .... are all divisible by 42 as well?
Log in to reply
That's what I did, but I don't know how to prove it for all natural numbers as you say, Pi Han Goh :(
(¿Is this university level?)
2 7 − 2 = 1 2 6 , so M must be a divisor of 1 2 6 = 2 × 3 2 × 7 .
Also 3 7 − 3 = 2 1 8 4 , so M must also be a divisor of 2 1 8 4 = 2 3 × 3 × 7 × 1 3 .
Combined we now know that M must be a divisor of 2 × 3 × 7 = 4 2 , we only need to prove that 42 works indeed. Using modular arithmetic, we see that for any p: 0 7 − 0 ≡ 0 , 1 7 − 1 ≡ 0 and ( − 1 ) 7 − ( − 1 ) ≡ 0 (mod p). And Fermats little theorem ensures that n 7 − n = 0 (mod 7). The facts n 7 − n ≡ 0 (mod 2), n 7 − n ≡ 0 (mod 3), and n 7 − n ≡ 0 (mod 7) combine into n 7 − n ≡ 0 (mod 42).
Yay! Super neat!
L e t f ( n ) = n 7 − n . f ( 2 ) = 1 2 6 = 9 ∗ 1 4 = 3 ∗ 4 2 . f ( 3 ) = 2 1 8 4 = 5 2 ∗ 4 2 ; ⟹ M ≤ 4 2 . f ( n ) = n ( n 6 − 1 ) = n ( n 2 − 1 ) ( n 4 + n 2 + 1 ) = { ( n − 1 ) n ( n + 1 ) } { n 4 + n 2 + 1 } . ( n − 1 ) n ( n + 1 ) i s p r o d u c t o f t h r e e c o n s e c u t i v e i n t e g e r s . ∴ 6 i s i t s d i v i s o r o f f ( n ) . ∴ l e t u s s e e i f 6 4 2 = 7 i s a d i v i s o r o f f ( n ) o r n o t . n 4 + n 2 + 1 = 1 4 n 2 − 3 5 − { ( n 2 − 2 2 ) ( n 2 − 3 2 ) } ⟹ f ( n ) = ( n − 1 ) n ( n + 1 ) { 7 ( 2 n 2 − 5 ) − ( n 2 − 2 2 ) ( n 2 − 3 2 ) } . ∴ f ( n ) = 7 ( n − 1 ) n ( n + 1 ) ( 2 n 2 − 5 ) − ( n − 3 ) ( n − 2 ) ( n − 1 ) ( n ) ( n + 1 ) ( n + 2 ) ( n + 3 ) . B u t ( n − 3 ) ( n − 2 ) ( n − 1 ) ( n ) ( n + 1 ) ( n + 2 ) ( n + 3 ) i s a p r o d u c t o f s e v e n c o n s e c u t i v e i n t e g e r s . S o 6 a n d 7 a r e a l s o i t s d i v i s o r s . ⟹ 7 ( n − 1 ) n ( n + 1 ) ( 2 n 2 − 5 ) a n d ( n − 3 ) ( n − 2 ) ( n − 1 ) ( n ) ( n + 1 ) ( n + 2 ) ( n + 3 ) h a s 6 ∗ 7 = 4 2 a s d i v i s o r o f f ( n ) . S o M = 4 2 s i n c e w e s a w a b o v e t h a t 4 2 i s o n l y c o m m o n f a c t o r o f f ( 2 ) a n d f ( 3 ) .
Without invoking Fermat's Little Theorem: A simple experiment with a spreadsheet showed that for n=2 then n 7 − n = 126 which is 3 x 42 whereas if n=3 then n 7 − n = 2184 which is 52 x 42. Given that 3 and 52 are mutually prime the number M we are seeking cannot be greater than 42. So, is it 42?
Factorising as much as I can gives n 7 − n = n ( n 6 − 1 ) = n ( n 3 − 1 ) ( n 3 + 1 ) = n ( n − 1 ) ( n 2 + n + 1 ) ( n 3 + 1 )
It is clear that either n or n-1 is divisible by 2.
Working mod 3, then either n ≡ 0 or n ≡ 1 (in which case n-1 ≡ 0) or n ≡ 2 (in which case n 3 + 1 ≡ 8 + 1 ≡ 2 + 1 ≡ 0)
Working mod 7 needs a little more effort:
n ≡ 0 implies n ≡ 0
n ≡ 1 implies n − 1 ≡ 0
n ≡ 2 implies n 2 + n + 1 ≡ 4 + 2 + 1 ≡ 0
n ≡ 3 implies n 3 + 1 ≡ 2 7 + 1 ≡ 6 + 1 ≡ 0
n ≡ 4 implies n 2 + n + 1 ≡ 1 6 + 4 + 1 ≡ 2 + 4 + 1 ≡ 0
n ≡ 5 implies n 3 + 1 ≡ 1 2 5 + 1 ≡ 6 + 1 ≡ 0
n ≡ 6 implies n 3 + 1 ≡ 2 1 6 + 1 ≡ 6 + 1 ≡ 0
So M is a multiple of 2, 3 and 7 and not greater than 42. Hence M = 4 2
Yup, this is the simplest approach that I can think of. Thank you for sharing this! ;)
Not sure if this has already been proposed. Here's an alternate solution, albeit tedious but more general, using binomials. Though not as elegant as Fermat's Little Theorem approach, it is a neat little property of binomials.
Any polynomial function f ( n ) of degree d over any field that contains Q can be expressed uniquely as the following linear combination, f ( n ) = k = 0 ∑ d F k ( k n ) where F k = t = 0 ∑ k ( − 1 ) k − t f ( t ) ( t k ) is the k-th difference of the sequence { f ( i ) } i = 0 , 2 , … , k .
Solution to problem
Let f ( n ) = n 7 − n and so d = 7 , we can express it as f ( n ) = 1 2 6 ( 2 n ) + 1 8 0 6 ( 3 n ) + 8 4 0 0 ( 4 n ) + 1 6 8 0 0 ( 5 n ) + 1 5 1 2 0 ( 6 n ) + 5 0 4 0 ( 7 n ) . The GCD of the coefficients in the equation is 4 2 .
Wow, I haven't seen this approach before. I have to spend more time to digest this.
Log in to reply
Binomials are cool. Anyway, just to help you get started, the k-th difference refers to a concept called finite difference in numerical analysis.
By Fermat's Little Theorem, we have n p = n ( m o d p ) for all n and primes p , in particular for p = 2 , 3 , 5 , 7 .
Thus, 7 divides n 7 − n .
Also 2 divides it, because n 7 = n ⋅ n 2 ⋅ n 2 ⋅ n 2 = n ⋅ n ⋅ n ⋅ n = … = n ( m o d 2 ) .
Similarly, 3 divides it, since n 7 = n ⋅ n 3 ⋅ n 3 = n ⋅ n ⋅ n = n ( m o d 3 ) .
For p = 5 , this doesn't work, and also not for primes p > 5 .
Hence, the largest $ M = 2 \cdot 3 \cdot 7 = 4 2 $ .
I tried every even number and then divide the one I got for the first one which 126 then when I tried 6 the answer wasn’t divisible by 6 so I tried 42 bcuz it is a factor of 126 and it actually works
You can't try every even number because there's infinitely many even numbers out there!
Just take the the case of 2 and 3 and find the common factors which are in both and multiply them
You're under the assumption that n 7 − n is divisible by 42 for n = 4 , 5 , 6 , … as well. How can you show that?
(1) n^7-n=(n^3-n)(n^4+n^2+1), so it divides by 3.
(2) By Fermat's theorem, it divides by 7.
(3) It is even, it divides by 2.
Therefore, it divides by 2x3x7,
Answer=42
This solution is incomplete. You have not demonstrated that it n 7 − n cannot be divisible by any integer larger than 42.
Since (M) is the largest value that evenly divides n 7 − n then n 7 − n , ( n + 1 ) 7 − ( n + 1 ) , ⋯ ( n + k ) 7 − ( n + k ) must share same gcd. The g.c.d ( n 7 − n , ( n + 1 ) 7 − ( n + 1 ) , ( n + 2 ) 7 − ( n + 2 ) , ⋯ ( n + k ) 7 − ( n + k ) ) = 2 × 3 × 7 = 4 2 And hence the answer.
Problem Loading...
Note Loading...
Set Loading...
First, as 7 is prime, by Fermat's Little Theorem n 7 ≡ n ( m o d 7 ) ⟹ n 7 − n ≡ 0 ( m o d 7 ) . So n 7 − n is divisible by 7 for all positive integers n .
Next, note that n 7 − n = n ( n 6 − 1 ) = n ( n 3 − 1 ) ( n 3 + 1 ) = n ( n − 1 ) ( n 2 + n + 1 ) ( n + 1 ) ( n 2 − n + 1 ) .
Now since the factors n − 1 , n and n + 1 are three consecutive integers we know that precisely one of them is divisible by 3 , and also that at least one of them is divisible by 2 , and so n 7 − n will be divisible by 3 × 2 = 6 .
Thus as n 7 − n is divisible by both 7 and 6 it will be divisible by 7 × 6 = 4 2 for all positive integers n . But is this the maximum possible value M ?
Now 2 7 − 2 = 1 2 6 = 4 2 × 3 = 1 4 × 9 , so we need to check out if M could equal 1 2 6 . But
3 7 − 3 = 3 × 3 6 − 3 = 3 × 9 3 − 3 ≡ 0 − 3 ( m o d 9 ) ≡ 6 ( m o d 9 ) ,
i.e., we have at least one case where n 7 − n is not divisible by 9 , and hence also not divisible by 1 2 6 . Thus we can conclude that M = 4 2 .