For any given integer m , define a sequence of integers as follows. x 0 , m = m ; x i + 1 , m = x i , m 2 + 2 x i , m , i = 0 , 1 , 2 , . . .
Let N be the sum of all integer 3 ≤ n ≤ 1 0 1 0 such that x n , m is divisible by n for every integer m , 1 ≤ m ≤ n − 2 .
What are the last 3 digits of 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.
Let us define another series y n , m = x n , m + 1 , so we get y 0 , m = m + 1 and y i + 1 , m = x i + 1 , m + 1 = x i , m 2 + 2 x i , m + 1 = ( x i , m + 1 ) 2 = y i , m 2 . From this we can directly get y n , m = y 0 , m 2 n and thus x n , m + 1 = ( m + 1 ) 2 n ⇒ x n , m = ( m + 1 ) 2 n − 1
Now, it is given that n ∣ x n , m ⇒ n ∣ ( m + 1 ) 2 n − 1 ∀ 1 ≤ m ≤ n − 2 , or it can be stated as n ∣ i 2 n − 1 ∀ 2 ≤ i ≤ n − 1 Now, let's assume n is not a prime. Then let d ≤ n − 1 be a divisor of n . From n ∣ d 2 n − 1 we get that d 2 n − 1 = n k = d k ′ for some integer k ′ > 1 , but then k ′ ∣ 1 , a contradiction. So n is a prime.
As n is a prime, there exists a primitive root modulo n . Let it be x .We get from n ∣ i 2 n − 1 ∀ 2 ≤ i ≤ n − 1 that n ∣ x 2 n − 1 , and from Fermat's last theorem, n ∣ x n − 1 − 1 . As x is a primitive root, we get that n − 1 ∣ 2 n . So, n − 1 = 2 t for some t , or n is a prime of the form 2 t + 1 .
Now if t had a odd divisor, let it be a . Then 2 a + 1 ∣ ( 2 a ) t / a + 1 = 2 t + 1 ⇒ 2 a + 1 ∣ n , which is a contradiction as n is a prime. So, t has no odd divisor, which implies t = 2 x for some x , and thus n is a prime of the form 2 2 x + 1 , which means n is a Fermat prime.
Now the only known Fermat prime (and only the ones less than or equal 1 0 1 0 ) are 3 , 5 , 1 7 , 2 5 7 , 6 5 5 3 7 . So n can be only 3 , 5 , 1 7 , 2 5 7 , 6 5 5 3 7 , and thus N = 3 + 5 + 1 7 + 2 5 7 + 6 5 5 3 7 = 6 5 8 1 9 , and thus the last 3 digits of N is 8 1 9 , and thus our answer is 8 1 9 .
Throughout this solution, let's use the notation a ≡ n b to denote the congruence a ≡ b (mod n ).
First, let's figure out exactly what the recurrence relation tells us. Completing the square gives us
x i + 1 , m = x i , m 2 + 2 x i , m = ( x i , m + 1 ) 2 − 1 for i = 0 , 1 , 2 , …
So for any m , a term in the sequence is computed by taking the previous term, adding 1, squaring, then subtracting 1. We find that the first few terms of the sequence will look like
{ m , ( m + 1 ) 2 − 1 , ( m + 1 ) 4 − 1 , ( m + 1 ) 8 − 1 , … } .
We've discovered that x n , m = ( m + 1 ) 2 n − 1 for all n and m . Using the change of variables k = m + 1 for ease of notation, we are thus tasked with finding all integers 3 ≤ n ≤ 1 0 1 0 such that n ∣ ( k 2 n − 1 ) for all 2 ≤ k ≤ n − 1 . Equivalently, we require
k 2 n ≡ n 1 for all 2 ≤ k ≤ n − 1 .
We can narrow down the cases quickly. If n is composite, say n = p q with p prime and q > 1 , then we necessarily require k 2 n ≡ p 1 . However, this fails for k = p , which is certainly between 2 and n − 1 . Thus n must be prime.
Let n = p be a prime number such that p − 1 ∤ 2 p , so 2 p = q ( p − 1 ) + r for some q ∈ Z and remainder 1 ≤ r ≤ p − 2 . We thus require that k q ( p − 1 ) k r ≡ p 1 for all 2 ≤ k ≤ p − 1 . By Fermat's Little Theorem , since k q is not divisible by p (since 2 ≤ k ≤ p − 1 ), we know that k q ( p − 1 ) ≡ p 1 . Thus our required condition becomes
k r ≡ p 1 for all 2 ≤ k ≤ p − 1 , where 1 ≤ r ≤ p − 2 is fixed.
However, this condition implies that r ≥ λ ( p ) , where λ is the Carmichael function . Carmichael's theorem gives us that since p is prime, λ ( p ) = p − 1 , contradicting the assumption that 1 ≤ r ≤ p − 2 . Thus, n must be a prime p such that p − 1 ∣ 2 p . By setting r = 0 in the recent argument, we see immediately that any such prime satisfies the desired condition!
Thus we seek all primes 3 ≤ p ≤ 1 0 1 0 such that p − 1 ∣ 2 p . To look for them, we note that such primes must satisfy p − 1 = 2 q for some q . Equivalently, they must satisfy
p = 2 q + 1 for some q .
I claim that, since p ≥ 3 is prime (so q ≥ 1 ), such q must be a power of 2. Suppose that q has some odd factor r > 1 , so q = r s , with s ≥ 1 . Then
p = 2 q + 1 = ( 2 s ) r + 1 ≡ 2 s + 1 ( − 1 ) r + 1 = 0 ,
implying 2 s + 1 ∣ p , a contradiction since s < q implies 2 s + 1 < p .
Thus we conclude that we seek all primes 3 ≤ p ≤ 1 0 1 0 such that p = 2 2 n + 1 for some n . Fortunately, we can recognize these numbers: they are known as the Fermat numbers , F n = 2 2 n + 1 . Fermat had once falsely conjectured that all Fermat numbers are prime ( F 5 is composite, for example), but it is known that F 0 , F 1 , F 2 , F 3 , and F 4 are prime! As mentioned, F 5 is composite (so we don't want it), and F 6 > 1 0 1 0 , so we finally arrive at our desired set of numbers: F 0 = 3 , F 1 = 5 , F 2 = 1 7 , F 3 = 2 5 7 , F 4 = 6 5 5 3 7 .
Adding these numbers up gives N = 6 5 8 1 9 , from which we obtain the final three digits 819 .
Note that x 0 , m + 1 = m + 1 and x i + 1 , m + 1 = ( x i , m + 1 ) 2 . By induction, it can be shown that x n , m + 1 = ( m + 1 ) 2 n , and so, x n , m = ( m + 1 ) 2 n − 1 .
If n is not prime, then pick an m = p − 1 where p ∣ n is prime. Then, x n , m = p 2 n − 1 ≡ − 1 ( m o d p ) . So, p ∤ x n , m , and thus, n ∤ x n , m , a contradiction. Therefore, n must be prime.
If x n , m ≡ 0 ( m o d n ) , i.e. ( m + 1 ) 2 n ≡ 1 ( m o d n ) for all 1 ≤ m ≤ n + 2 with n prime, then we need n − 1 ∣ 2 n . Hence, n − 1 = 2 r , i.e. n = 2 r + 1 for some integer r .
It is well-known that if n = 2 r + 1 is prime, then r must be a power of 2 , i.e. r = 2 k and n = 2 2 k + 1 for some non-negative integer k .
If k ≥ 6 then n = 2 2 k + 1 > 1 0 1 0 . Thus, we only need to check k ≤ 5 . For k = 0 , 1 , 2 , 3 , 4 , 5 we have n = 3 , 5 , 1 7 , 2 5 7 , 6 5 5 3 7 , 4 2 9 4 9 6 7 2 9 7 , of which, the first five are prime, while 4 2 9 4 9 6 7 2 9 7 is divisible by 6 4 1 .
Therefore, N = 3 + 5 + 1 7 + 2 5 7 + 6 5 5 3 7 = 6 5 8 1 9 ≡ 8 1 9 ( m o d 1 0 0 0 ) .
[We will ignore the subscript m .]
First, denote x i + 1 by y i for all i . Then x i + 1 = x i 2 + x i is equivalent to y i + 1 = y i 2 . So y i = m 2 i , and x n = m 2 n − 1 . If n is not prime, then take take m ∣ n , m = 1 , we can see that m ∣ x n , hence m ∣ x n . Thus, we must have n prime, which we will denote as p for convenience.
Now note that 1 ≤ x 0 ≤ p − 2 condition is equivalent to 2 ≤ y ≤ p − 1 and p ∣ x p is equivalent to y p ≡ 1 ( m o d p ) .
We will now prove two lemmas.
Lemma 1. Suppose p is a prime number. Then m 2 p ≡ 1 for all m = 1 , 2 , . . . , p − 1 if and only if p − 1 is a power of 2 .
In one direction, if p − 1 = 2 k , then clearly k ≤ p . By the Fermat's theorem, for any m ≡ 0 ( m o d p ) , m 2 k ≡ 1 ( m o d p ) , so m 2 p ≡ 1 2 p − k ≡ 1 ( m o d p ) .
In the other direction, we will give two proofs.
Proof #1. Suppose p − 1 = 2 k ⋅ n , where n > 1 is odd. Because the multiplicative group of non-zero residues modulo prime p is cyclic, there exists a residue m ≡ 1 ( m o d p ) , such that m n ≡ 1 ( m o d p ) . Because 2 p and n are coprime, there exists integer u and v , such that u 2 p + v n = 1 . Then m ≡ m u 2 p + v n ≡ 1 u ⋅ 1 v ≡ 1 ( m o d p ) , a contradiction.
Proof #2. Suppose p − 1 = 2 k ⋅ n , where n > 1 is odd. Consider the polynomial with coefficients in the field of residues modulo p : P ( x ) = x 2 k − 1 . It can have no more than 2 k roots, and 2 k < p − 1 . So there exists m ≡ 0 such that m 2 k ≡ 1 ( m o d p ) . For such m , by the Fermat's theorem, m 2 k ⋅ n ≡ 1 ( m o d p ) . If m 2 p ≡ 1 ( m o d p ) , then, because g . c . d . ( 2 k ⋅ n , 2 p ) divides 2 k , there exist integers u and v , such that u ( 2 k n ) + v 2 p = 2 k . Therefore, m 2 k ≡ 1 u ⋅ 1 v ≡ 1 ( m o d p ) , a contradiction.
Lemma 2. If p = 2 k + 1 is prime, then either p = 2 or p = 2 2 j + 1 for some integer j ≥ 0 .
Proof. If p > 2 , then k ≥ 1 . If some odd number q divides k , that is k = q r , then 2 k + 1 = ( 2 r + 1 ) ( 2 r ( q − 1 ) − 2 r ( q − 2 ) + . . . + 1 , ) so p is not prime.
With the above two lemmas, it is enough to find the prime numbers of the form p = 2 2 j + 1 , for p < 1 0 1 0 . This means 0 ≤ j ≤ 5 . For 0 ≤ j ≤ 4 these numbers are indeed prime: 3 , 5 , 1 7 , 2 5 7 , 6 5 5 3 7 . For j = 5 , however, 2 2 5 + 1 is divisible by 6 4 1 . So the sum is 3 + 5 + 1 7 + 2 5 7 + 6 5 5 3 7 = 6 5 8 1 9 and the answer is 8 1 9 .
As you can see, not all numbers of the form 2 2 j + 1 (called Fermat numbers) are prime. In fact, they are known to be prime for 0 ≤ j ≤ 4 and composite for 5 ≤ j ≤ 1 1 . Not much is known beyond that, and while some heuristic arguments suggest that there are infinitely many Fermat primes, other arguments suggest that 2 2 4 + 1 may be the last one.
Problem Loading...
Note Loading...
Set Loading...
the only such n are the Fermat primes. To prove this, first add 1 to both sides of the recursion to get x i + 1 , m + 1 = x i , m 2 + 2 x i , m + 1 = ( x i , m + 1 ) 2 Use this equation n times to get the general formula x n , m + 1 = ( x 0 , m + 1 ) 2 n = ( m + 1 ) 2 n Let l = m + 1 , then the condition reduces to for all 2 ≤ l ≤ n − 1 , l 2 n ≡ 1 m o d n .
Let p be a prime divisor of n , and let l = n / p .If l > 1 , then since it is a divisor of n , ( l , n ) > 1 , so ( l 2 n , n ) > 1 . However, this contradicts the condition that l 2 n ≡ 1 m o d n . Hence, l = 1 , and n is a prime.
By a classical theorem in number theory, n has a primitive root g , i.e. the order of g mod n is n − 1 . Since 2 n > n − 1 , and g 2 n ≡ 1 m o d n , we must have n − 1 ∣ 2 n . Therefore, n = 2 r + 1 for some integer r . If r has an odd factor, the expression factors, so n is not a prime. Therefore, r is also a power of 2, so n is a prime of the form 2 2 k + 1
This is a prime if k = 0 , 1 , 2 , 3 , 4 . When k = 5 , it is divisible by 641, and if k is higher, n is greater than 1 0 1 0 . Therefore, N = 3 + 5 + 1 7 + 2 5 7 + 6 5 5 3 7 = 6 5 8 1 9