Find the sum of all primes p < 1 0 0 such that q = 2 p + 1 is a prime, and 2 is a generator modulo p , but not modulo q .
Details and assumptions
A residue a is called a generator modulo prime p if every non-zero residue modulo p equals some power of a modulo p .
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.
First list all the Sophie German prime. Since 2 is a generator modulo prime p , 2 is a quadratic non-residue of p , thus p is equal to 3 or 5 mod 8. Since 2 is not a generator modulo prime q , the order of 2 modulo q is some proper divisor of q − 1 = 2 p , which is equal to 1, 2, or p . One can readily discard 1 and 2 when q > 3 which happens to be true for all Sophie German primes. Hence 2 p is equal to 1 mod q, which means 2 is a quadratic residue mod q. Hence 2 p + 1 = q is equal to 1 or 7 mod 8. Combine with previous result, we can conclude that p is equal to 3 mod 8 and q is equal to 7 mod 8. We are left with 3 possible solutions of p , which are 3, 11 and 83, and it is not hard to prove that they indeed satisfy all the problem conditions.
We recall the definition of Legendre symbol: ( n a ) ≡ a ( n − 1 ) / 2 ( m o d n ) which equals 1 if a is a quadratic residue mod n , equals − 1 if a is not a quadratic residue mod n , and equals 0 if a ≡ 0 ( m o d n ) . (A number a is a quadratic residue mod n if there exists an integer x such that x 2 ≡ a ( m o d n ) .) We also recall the second supplement to the law of quadratic reciprocity: for an odd prime p , ( p 2 ) = ( − 1 ) ( p 2 − 1 ) / 8 ; that is to say, 2 is a quadratic residue of p if and only if p ≡ ± 1 ( m o d 8 ) . Next, we claim that if 2 is a generator mod p , then 2 is not a quadratic residue mod p . To see why, note that if ( p 2 ) = 2 ( p − 1 ) / 2 ≡ 1 ( m o d p ) , then the multiplicative order of 2 mod p is strictly less than p − 1 , so the powers of 2 cannot generate all the nonzero residues of p . It then follows that if 2 is a generator mod p , then p ≡ ± 3 ( m o d 8 ) .
Now that we have established this result, we can narrow down our candidates for p . There are 24 odd primes less than 100 (we exclude 2 because it is trivial to see it does not satisfy the given conditions): { 3 , 5 , 7 , 1 1 , 1 3 , 1 7 , 1 9 , 2 3 , 2 9 , 3 1 , 3 7 , 4 1 , 4 3 , 4 7 , 5 3 , 5 9 , 6 1 , 6 7 , 7 1 , 7 3 , 7 9 , 8 3 , 8 9 , 9 7 } . Of these, only nine satisfy the condition that q = 2 p + 1 also be prime: { 3 , 5 , 1 1 , 2 3 , 2 9 , 4 1 , 5 3 , 8 3 , 8 9 } . Of these, only six satisfy p ≡ ± 3 ( m o d 8 ) : { 3 , 5 , 1 1 , 2 9 , 5 3 , 8 3 } . And of these, only three satisfy q = 2 p + 1 ≡ ± 3 ( m o d 8 ) : p ∈ { 3 , 1 1 , 8 3 } . It is easy to check that 2 is indeed a generator mod p for the first two candidates. The third is more computational. We rely on the fact that the multiplicative order of a mod p must divide ϕ ( p ) = p − 1 , so that if the smallest positive d ∣ 8 2 satisfying 2 d ≡ 1 ( m o d 8 3 ) is d = 8 2 , then 2 is a generator mod 8 3 ; that is to say, we need only check those exponents that divide 8 2 . We compute via repeated squaring 2 2 2 4 2 8 2 1 6 2 3 2 2 4 1 2 8 2 ≡ 4 ( m o d 8 3 ) , ≡ 4 2 ≡ 1 6 ( m o d 8 3 ) , ≡ 1 6 2 ≡ 7 ( m o d 8 3 ) , ≡ 7 2 ≡ 4 9 ( m o d 8 3 ) , ≡ 4 9 2 ≡ 7 7 ( m o d 8 3 ) , = 2 3 2 2 8 2 1 ≡ 7 7 ( 7 ) ( 2 ) ≡ 8 2 ( m o d 8 3 ) , ≡ 8 2 2 ≡ 1 ( m o d 8 3 ) . Therefore, all three candidates satisfy the criteria, and the desired sum is 3 + 1 1 + 8 3 = 9 7 .
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199
Removing those over 99 or for which 2p+1 is not in the list leaves:
2, 3, 5, 11, 23, 29, 41, 53, 83, 89
Removing 2 and others for which the order of 2 mod p is not p-1 (that is 2^(p-1) is not the first power of 2 equal to 1) leaves:
3, 5, 11, 29, 53, 83
Removing those for which the order of 2 mod q is q-1 leaves:
3, 11, 83
The sum of these is 97.
Because 2 is a generator modulo p , p is odd. Note that q − 1 = 2 p , and 2 2 = 4 < q . The order of 2 modulo q is a divisor of q − 1 , and 2 is a generator if and only if the order is q − 1 . So the only way 2 would be not a generator modulo q is if 2 p ≡ 1 ( m o d q ) . As such, ( 2 2 p + 1 ) 2 ≡ 2 ( m o d q ) .
This implies that 2 is a quadratic residue modulo q , which happens if and only if q is congruent to 1 or 7 modulo 8 . Also, 2 cannot be a quadratic residue modulo p , so p is congruent to 3 or 5 mod 8 . With q = 2 p + 1 , this means that p ≡ 3 ( m o d 8 ) . Also, because p and 2 p + 1 are both primes, either p = 3 or p ≡ 2 ( m o d 3 ) . By the Chinese Remainder Theorem, either p = 3 or p ≡ 1 1 m o d 2 4 .
If
p
=
3
, then
q
=
7
is prime. Checking the primality condition for
p
and
2
p
+
1
with
p
≡
1
1
(
m
o
d
2
4
)
and
p
<
1
0
0
. we get primes
p
=
1
1
and
p
=
8
3
.
For
p
=
3
and
q
=
7
the conditions are easy to check.
For
p
=
1
1
and
q
=
2
3
we know from the discussion above that
2
is not a generator modulo
2
3
. Modulo
1
1
, one can check directly that
2
is a generator, or use the same argument, since
2
is not a quadratic residue and
p
−
1
=
2
⋅
5
with
5
prime.
Similarly, for
p
=
8
3
and
q
=
1
6
7
, we know that
2
is a quadratic residue modulo
q
and not a quadratic residue modulo
p
. Because
p
−
1
=
2
⋅
4
1
and
4
1
is prime, this implies that
p
=
8
3
also works.
Therefore, the answer is 3 + 1 1 + 8 3 = 9 7 .
I just brute forced this in Mathematica. I don't normally do that at all, but I couldn't see a handle on any other way...
Let S denote the set of all primes less than 2 0 0 . Then, we will start by listing all primes p ∈ S such that p > 9 9 or such that 2 p + 1 ∈ / S . These are $${2,3,5,11,23,29,41,53,83,89}.$$ Now, we can remove 2 and remaining p such that o r d p ( 2 ) = p − 1 . This leaves $${3,5,11,29,53,83}.$$ Moreover, we can remove all p such that o r d 2 p + 1 ( 2 ) = 2 p . The remaining primes are then { 3 , 1 1 , 8 3 } so the desired sum is 3 + 1 1 + 8 3 = 9 7
"Then, we will start by listing all primes
p
∈
S
such that
p
>
9
9
or such that
2
p
+
1
∈
/
S
. These are $${2,3,5,11,23,29,41,53,83,89}.$$ " This is incorrect as states. Other details are missing. Possibly, some specialized software (widely available) was used. The solution is suspiciously similar to that of hans_ardisa@yahoo.co
But this one looks like a wrong copy.
Problem Loading...
Note Loading...
Set Loading...
We start out by looking for possible values that q could be to not have 2 being a generator, then backtrack and check whether it is a generator for the corresponding p .
2 is not a generator modulo q if and only if there exists some smallest number k < q − 1 where 2 k ≡ 1 ( m o d q ) . Notice that k must be a factor of q − 1 - this follows from noting that the remainders modulo q are then cyclic with order k and that 2 q − 1 ≡ 1 ( m o d q ) , Fermat's Little Theorem. Therefore the cycle repetition of 1 coincides exactly with q − 1 , which can only occur if k is a multiple of q − 1 .
But then, q − 1 = 2 p , so k can only be 2 or p . If k = 2 , then that means 2 2 = 4 ≡ 1 ( m o d q ) , which only happens when q = 3 . Otherwise, k = p , which shall be assumed from hereon in to find more suitable values of q . These values occur if and only if 2 p ≡ 1 ( m o d q ) .
We now use the established fact that there exists a number x such that x 2 ≡ 2 ( m o d q ) if and only if q ≡ ± 1 ( m o d 8 ) .
If q = ± 1 ( m o d 8 ) , suppose 2 p ≡ 1 ( m o d q ) . Suppose g is a generator modulo q and 2 ≡ g a ( m o d q ) . Then g a p ≡ 1 ( m o d q ) , so a p is a multiple of q − 1 = 2 p . Therefore a is even, meaning 2 ≡ g a is a square modulo q , a contradiction. So 2 p = 1 ( m o d q ) and 2 has to be a generator for q . We discard any primes of this sort.
If q ≡ ± 1 ( m o d 8 ) and we can write 2 ≡ x 2 ( m o d q ) , then 2 p = x 2 p = x q − 1 ≡ 1 ( m o d q ) , and so q will be a prime of the desired type. It is not known if p will have 2 as a generator, but this narrows down the possibilities enough for this to be checked by case.
q ≡ ± 1 ( m o d 8 ) ⇒ p ≡ 3 ( m o d 4 ) , so it is desired to seek out primes p where p ≡ 3 ( m o d 4 ) and 2 p + 1 is a prime. A search of every prime under 100 yields the following 4 cases - ( 3 , 1 1 , 2 3 , 8 3 ) . q , by the method of choosing, will definitely not have 2 as a generator, so we only need to check whether 2 is a generator for these possible values of p . This can be done quickly by noticing that 1 1 = 2 × 5 + 1 , 2 3 = 2 × 1 1 + 1 and 8 3 = 2 × 4 1 + 1 ; with the exception of 2 3 , each of these is of the exact same form as the primes q = 2 p + 1 = ± 1 ( m o d 8 ) . These were discarded earlier for having 2 as a generator; so we can immediately say that these will work in this case. 2 3 , on the other hand, is of the form q = 2 p + 1 ≡ ± 1 ( m o d 8 ) , so 2 3 cannot have 2 as a generator and is discarded here.
3 is easily checked as having 2 as a generator, so the possible pairs p , q are ( 3 , 7 ) , ( 1 1 , 2 3 ) , ( 8 3 , 1 6 7 ) . The sum of all such possible primes p < 1 0 0 is then 3 + 1 1 + 8 3 = 9 7 .