What is the smallest positive integer n , such that 2 n ! − 1 is divisible by all odd primes p < 1 0 0 0 ?
Details and assumptions
You may use this List of 1000 Primes .
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.
A small but important detail seems to be missing. Fermat's theorem only works one way: if p − 1 divides n , then p divides 2 n − 1 . But the converse is not always true. For example, 2 3 5 − 1 is divisible by 3 1 even though 3 5 is not divisible by 3 0 . So when you say that n ! must have a factor p − 1 , it is actually not correct. How can you fix this?
Log in to reply
I added it to the comment section of my solution. Essentially, if there existed a k that was less than 4 9 1 such that 2 k − 1 was divisible by 4 9 1 , then k would have to be a divisor of 4 9 1 , but the only divisors of 4 9 1 are 1 and 4 9 1 . It's clearly not 1 , so 4 9 1 is minimized. In technical terms,
O 9 8 3 ( 2 ) = 4 9 1 .
Log in to reply
Yes, this is exactly right.
Log in to reply
@Alexander Borisov – Very nice observation. I was having a doubt about that, Thanks!
We can prove that 491 is the smallest positive integer such that 9 8 3 divides 2 4 9 1 − 1 . If there exists a positive integer k with k < 4 9 1 then k = o r d ( 9 8 3 ) ( 2 ) , therefore k must divides 4 9 1 , but since 4 9 1 is a prime number, k must be 1 . Obviously, we have 4 9 1 is our answer.
Carmichael function?
Very clear. I did the same way but could not express it in proper words!
I do think you need to append a small thing- we need to show that, for example, there are not two factors of 251. I don't think it's that tough though. Nice proof!
Log in to reply
Actually, I did address that issue, though not directly.
First note that only the maximum number of factors of a prime p that appears in the set of numbers 1 less than a prime divisor is needed in our exponent. For example, if we want to find minimum k such that 2 k − 1 divides both 5 and 7 , we first look at the prime factorizations of 4 and 6 . We have 4 = 2 2 and 6 = 2 ∗ 3 . Although we can see 3 factors of 2 , our k only needs to have 2 factors of 2 since that will satisfy each divisibility condition separately. Thus, k = 2 2 ∗ 3 = 1 2 , and we check that 2 1 2 − 1 = 4 0 9 5 is indeed divisible by 5 and 7 .
So how do we know that we've taken care of the maximum possible number of factors of each possible prime? Well, I didn't directly address that part, rather, I structured my solution in such a way that I didn't have to. The crucial line is:
Note, all numbers of this set except for 9 9 6 , 9 9 0 , and 9 8 3 can be factorized into 2 ∗ q where q < 4 9 1 . By definition of factorial, we can find factors of 2 and q in 4 9 1 ! .
I will explain this a little more thoroughly. We are looking at all of the odd primes. 1 less than an odd prime is even, so we can factor out a 2 and look at the rest, which I call q . Let's expand 4 9 1 ! . Since q < 4 9 1 , we can write
4 9 1 ! = 2 ∗ 3 ∗ 4 ∗ . . . ∗ ( q − 1 ) ∗ q ∗ ( q + 1 ) ∗ . . . ∗ 4 9 0 ∗ 4 9 1
Thus 4 9 1 ! has a factor of both 2 and q . We've just shown that 4 9 1 ! has a factor of each number in the set, and we didn't even factorize fully!
Wooh! I had to give up on this problem. Excellent solution! I would like it, though, if that block of text was a bit split up.
From Fermat's Little Theorem, a p − 1 ≡ 1 ( m o d p ) where p is a prime and p ∣ a .
Therefore, 2 p − 1 − 1 ≡ 0 ( m o d p ) or equivalently, p ∣ 2 p − 1 − 1 .
Now all we need to find is the largest possible prime factor of p − 1 , with p any prime under 1 0 0 0 .
Since 9 8 3 − 1 = 9 8 2 = 2 × 4 9 1 , and that 9 9 7 − 1 = 9 9 6 = 2 2 × 3 × 8 3 , then 4 9 1 must be the largest prime factor.
(This is because 2 ∣ p − 1 for p = 2 , so the highest prime you can get is 2 p − 1 .)
Therefore, the smallest n can be is 4 9 1 .
In addition, you also have to check the prime factorization of 9 9 0 , as I forgot. But it turns out there were no prime factors larger than 491.
Also, you would have t prove that there does not exist a prime q such that q 2 > p and q appears more than once in the prime factorization of the product of all p − 1 such that p < 1 0 0 0 .
oh my gat! cool solutipn
For all positive integers k and n , we define ord k ( n ) to be the smallest positive integer m such that k m ≡ 1 ( m o d n ) .
Claim If, for some positive integers k , n , v , k v ≡ 1 ( m o d n ) , then v must be a multiple of ord k ( n ) .
Proof
We write
v
=
a
×
ord
k
(
n
)
+
b
for some non negative integers
a
,
b
such that
0
≤
b
≤
ord
k
(
n
)
−
1
by the division algorithm. Then, note that
k
v
≡
k
a
×
ord
k
(
n
)
+
b
≡
(
k
ord
k
(
n
)
)
a
×
k
b
(
m
o
d
n
)
≡
1
×
k
b
≡
k
b
(
m
o
d
n
)
Since
k
v
≡
1
(
m
o
d
n
)
, we have
k
b
≡
1
(
m
o
d
n
)
. However,
b
>
0
contradicts the minimality of
ord
k
(
n
)
, so we must have
b
=
0
. This implies
ord
k
(
n
)
∣
v
.
QED
Note that by Euler's theorem, for all co-prime
k
and
n
,
k
ϕ
(
n
)
≡
1
(
m
o
d
n
)
. From our first claim, it readily follows that
ϕ
(
n
)
must be a multiple of
ord
k
(
n
)
.
For all positive integers
m
, let
f
(
m
)
denote the largest prime divisor of
ord
2
(
m
)
.
Consider any odd prime
p
within the range
[
1
,
1
0
0
0
]
. Since
2
n
!
≡
1
(
m
o
d
p
)
,
n
!
must be a multiple of
ord
2
(
p
)
. For
n
!
to be a multiple of
ord
2
(
p
)
, it must be a multiple of its greatest prime factor, i.e it must be a multiple of
f
(
p
)
.
From our previous observations, our answer will be simply the largest value of
f
(
p
)
, where
p
ranges among all odd primes in the range
[
1
,
1
0
0
0
]
.
Let's calculate
ord
2
(
9
8
3
)
. Note that
ϕ
(
9
8
3
)
=
9
8
2
=
2
×
4
9
1
, so we only have to check for
1
,
2
,
4
9
1
, and
9
8
2
. Checking it, we find out
ord
2
(
9
8
3
)
=
4
9
1
. Again, since
4
9
1
is prime, we have
f
(
9
8
3
)
=
4
9
1
.
The primes larger than 9 8 3 but less than 1 0 0 0 are 9 9 1 and 9 9 7 . Note that 9 9 1 ≡ 1 ( m o d 3 ) , so 3 ∣ 9 9 1 − 1 , i.e. 3 ∣ ϕ ( 9 9 1 ) . It is now easy to see that f ( 9 9 1 ) ≤ 3 9 9 1 − 1 , which is obviously less than 4 9 1 . Similarly, we find out that f ( 9 9 7 ) < f ( 9 8 3 ) . For all smaller odd primes p , note that p − 1 is even, so f ( p ) ∣ p − 1 , and hence f ( p ) ≤ 2 p − 1 < 2 9 8 3 − 1 = 4 9 1 We thus conclude the maximum value of f ( p ) is 4 9 1 , which is attained for p = 9 8 3 . Our desired answer, hence, is 4 9 1 .
I just noticed that my solution is slightly incomplete. However, I think it can be made correct.
Firstly, change the definition of f ( p ) as the largest number of the form q n which divides ord 2 ( p ) , where q is a prime. The contradiction I showed for smaller primes doesn't work for primes of the form 2 n + 1 . Note that 2 n + 1 ≡ 0 ( m o d 3 ) if n ≡ 1 ( m o d 2 ) . So for 2 n + 1 to be prime, n must be even. There exists no such even n such that 4 9 1 < 2 n + 1 < 1 0 0 0 .
When I saw this problem, I immediately thought of Fermat's Little Theorem. This theorem states that a p − 1 ≡ 1 ( m o d p ) , for a ∈ Z + and prime p .
Thus, if n ! is divisible by p − 1 , then 2 n ! ≡ 1 ( m o d p ) since 2 n ! is simply ( 2 p − 1 ) k for some positive integer k , thus it is still congruent to 1 ( m o d p ) .
Immediately following, if n ! is divisible by every p − 1 for p < 1 0 0 0 , then 2 n ! − 1 ≡ 0 ( m o d p ) , i.e. it is divisible by all p < 1 0 0 0 .
So, we just have to find the largest prime in the prime factorization of any p − 1 for p < 1 0 0 0 . Checking the largest few, we quickly come to p − 1 = 9 8 2 = 2 × 4 9 1 . So, 4 9 1 is the largest factor, thus 2 4 9 1 ! − 1 is the smallest integer which is divisible by all odd primes p < 1 0 0 0 . ■
To prove that 2 4 9 1 ! is truly minimized, we will show that there does not exist a k < 4 9 1 such that 2 k ≡ 1 ( m o d 4 9 1 ) . Say there such a k exists. Then, 2 k ≡ 2 n k ≡ 1 ( m o d 4 9 1 ) for n ∈ Z + .
However, the above statement implies that 4 9 1 = n k since k < 4 9 1 , which means that 4 9 1 is composite (since n , k > 1 ). However, 4 9 1 is prime, a contradiction, thus n ! must have a factor of 4 9 1 , thus it is minimized.
So, we just have to find the largest prime in the prime factorization of any p − 1 for p < 1 0 0 0 .
I disagree with this. A necessary condition for n ! to be a multiple of m is that n must be ≥ the largest prime divisor of m , but I'm afraid that's not a sufficient condition. The sufficient condition is that n must be ≥ the largest divisor of m which is of the form q k for some prime q . An explicit counterexample of your claim:
Note that the largest prime divisor of 1 8 is 3 , but 1 8 ∣ 3 ! .
from Fermat's little theorem ,2^{p-1} is congruence 1 mod p from 983 is prime so 983 divide 2^{n!}-1 so 982 is divide n! so 491 is divide n! n>=491
Problem Loading...
Note Loading...
Set Loading...
Fermat's Little theorem tells us 2 p − 1 ≡ 1 m o d p for all odd primes since no odd prime divides 2 . Raising each side to the k t h power, we have 2 k ( p − 1 ) ≡ 1 k ≡ 1 m o d p or 2 k ( p − 1 ) − 1 is divisible by p for all odd primes. Hence, for 2 n ! − 1 to be divisible by an odd prime p , n ! must have a factor of p − 1 .
Consider the set of all numbers which are 1 less than an odd prime p < 1 0 0 0 . Each of these numbers must divide n ! , so we proceed by factorizing them. Consulting the given list, the factorizations of the last numbers in this set are:
9 9 7 − 1 = 9 9 6 = 2 2 ∗ 3 ∗ 8 3
9 9 1 − 1 = 9 9 0 = 2 ∗ 3 2 ∗ 5 ∗ 1 1
9 8 3 − 1 = 9 8 2 = 2 ∗ 4 9 1
Since 4 9 1 is prime, for no m < 4 9 1 will m ! have a factor of 4 9 1 , so we need n ≥ 4 9 1 . Note, all numbers of this set except for 9 9 6 , 9 9 0 , and 9 8 3 can be factorized into 2 ∗ q where q < 4 9 1 . By definition of factorial, we can find factors of 2 and q in 4 9 1 ! . We can also find factors of 2 2 , 3 2 , 5 , 1 1 , and 8 3 since they are each less than 4 9 1 . Thus, 2 4 9 1 ! − 1 is divisible by all odd primes p < 1 0 0 0 .
We have shown that n = 4 9 1 satisfies the conditions and is indeed the minimum, so our answer is 4 9 1