Maths
Maths
Maths
(1) Given an odd prime p with g a primitive root (mod p), which powers of g are:
(a) quadratic residues?
(b) primitive roots?
(Just need to refer to results from notes.)
The quadratic residues are the even powers of g, while the primitive
roots are the powers g k with gcd(k, p − 1) = 1.
(2) For p = 3, 5, 7 and 11:
(a) find a primitive root;
(b) work out which of 1, 2, . . . , p − 1 are
• quadratic residues;
• primitive roots;
• neither.
p = 3: 1 =QR, 2 =PR.
p = 5: 1 =QR, 2 =PR, 3 =PR, 4 =QR.
p = 7: 1 =QR, 2 =QR, 3 =PR, 4 =QR, 5 =PR, 6 =neither.
p = 11: 1 =QR, 2 =PR, 3 =QR, 4 =QR, 5 =QR, 6 =PR, 7 =PR, 8 =PR,
9 =QR, 10
=neither.
(3) Evaluate −2
p
for odd primes p. When is p − 2 a quadratic residue?
p−2 −2 −1 2 2
= = = (−1)(p−1)/2 (−1)(p −1)/8
p p p p
= (−1)(p−1)(p+5)/8 ,
which is 1 if p ≡ 1 or 3 (mod 8) and −1 if p ≡ 5 or 7 (mod 8).
(4) Show that if p = 8n − 1 and q = 4n − 1 are both primes, then (−2)q ≡ −1 (mod p).
Deduce that −2 is a primitive root (mod p).
Now (−2)q = (−2)(p−1)/2 = −2 p
(Euler’s criterion), which is = −1 by
Q3. Now p − 1 = 2q so that (−2)2q ≡ 1 (mod p) (Fermat). If −2 is not
a primitive root then (−2)r ≡ 1 (mod p) for some factor r < p−1 of p−
1
2
Now recall (special case of Q 4(b), Problem Sheet 3)) that if ak ≡ 1 (mod p) and
aℓ ≡ 1 (mod p) then agcd(k,ℓ) ≡ 1 (mod p).
(5) Prime factors of Mp are large. Let p be an odd prime, and q be a prime factor of
Mp = 2p − 1.
(a) Show that
2gcd(p,q−1) ≡ 1 (mod q).
Deduce that p | (q − 1), and hence that q = 2rp + 1 for some r ∈ N.
(b) Find the prime factors of M11 .
(c) If Mp is in fact prime, what is r?
k ℓ
(a) From Fk ≡ 0 (mod q) we get 22 ≡ −1 (mod q). If 22 ≡ 1 (mod q)
k
for some ℓ < k then, by repeated squaring, we would obtain 22 ≡ 1 (mod q),
ℓ
a contradiction. So 22 6≡ 1 (mod q) for ℓ = 1, 2, . . . , k. 3 marks
(b) From Fermat we have 2q−1 ≡ 1 (mod q), while from squaring the result
k+1
in part (a) we have 22 ≡ 1 (mod q). Hence, by the ‘‘Now recall...’’
result from the workshop,
k+1 )
2gcd(q−1,2 ≡ 1 (mod q),
as req’d. 2 marks
(c) Now gcd(q − 1, 2k+1) is clearly some power 2ℓ with ℓ ≤ k + 1. But
if ℓ ≤ k, then we’d have
ℓ
22 ≡ 1 (mod q),
contradicting (a). So ℓ = k + 1 and gcd(q −1, 2k+1 ) = 2k+1, so that 2k+1 |
(q − 1), giving q = 2k+1 r + 1 for some r ∈ N. 3 marks
6 6
(d) 641 = 2 · 10 + 1. (Other prime factor is 6700417 = 2 · 104694 + 1.) 2 marks
(8) If n is the product of k distinct odd primes, show that the congruence x2 ≡ 1
(mod n) has 2k different solutions.
(10) Let p be an odd prime, and suppose that the set {1, 2, . . . , p − 1} is partitioned into
two nonempty sets S1 and S2 such that the product (mod p) of any two elements
in the same set is in S1 , while the product (mod p) of an element in S1 and an
4
For suppose n = mℓ with ℓ > 1 and odd. Then since (x + 1) | (xℓ + 1),
we’d have 2n + 1 = (2m )ℓ + 1 divisible by 2m + 1 < n.
(13) Show that, for n > 1, 3 is a primitive root of any prime of the form 2n + 1.
(c) With the help of (n + 1)2 − n2 and (n + 1)2 − (n − 1)2 , prove that all integers
except those in (b) can be written as the difference of two squares.
(16) Show that if an odd number n is the sum of two squares then n ≡ 1 (mod 4).
(17) Show that a positive integer n can be written as n = x2 + 4y 2 iff n is the sum of
two squares and also n is not twice an odd number.
(18) Which integers can be written as the difference of two nonzero squares?
The formula (n+1)2 −n2 from Q15(c) gives nonzero squares except when
n = 0 or −1. This shows that all odd numbers except 1 and −1 are the
difference of two nonzero squares. And indeed 1 = 12 −02 and −1 = 02 −
12 clearly can’t be written as the difference of two nonzero squares,
as no two nonzero squares differ by 1.
The formula (n+1)2 −(n−1)2 from Q15(c) gives nonzero squares except
when n = 1 or −1. This shows that all numbers ≡ 0 (mod 4) except 4
and −4 are the difference of two nonzero squares. And indeed 4 = 22 −
6
(19) Show that every integer can be written as the difference of two squares of rationals.
(20) Show that every integer can be written as x2 − y 2 + z 2 for some integers x, y, z.
Using Q15, we see that we can take z = 0 except in the case where n
is ≡ 2 (mod 4). In this case take z = 1. Then n − 1 is 6≡ 2 (mod 4),
so is a difference of two squares.
p2 −1
p−1
2
(a) We have −2 p
= −1 p p
= (−1) 2 ·(−1) 8 , which is = 1 precisely
when p ≡ 1 or 3 (mod 8).
2 2 −1 2
p = x + 2y we see that p ∤ y and (xy ) ≡ −2 (mod p), so
(b) From
that −2 p
= 1. Then use (a).
(c) Conversely, assume p ≡ 1 or 3 (mod 8), and, knowing that then −2 p
=
1, take r ∈ N with r 2 ≡ −2 (mod p). Define f (u, v) = u + rv and K =
√
⌊ p⌋. Note that
√
K < p < K + 1, (1)
7
√
as p 6∈ Z. Consider all pairs (u, v) with 0 ≤ u ≤ K and 0 ≤ v ≤ K.
There are (K+1)2 > p such pairs, and so the multiset of all f (u, v) for
such u, v has, by the Pigeonhole Principle, two such pairs (u1 , v1 ) 6= (u2 , v2 )
for which f (u1 , v1 ) ≡ f (u2 , v2 ) (mod p). Hence
u1 + rv1 ≡ u2 + rv2 (mod p)
u1 − u2 ≡ −r(v1 − v2 ) (mod p)
a ≡ −rb (mod p),
· 3p = 1 · p3 , which
(a) First take p ≡ 1 (mod 4). Then −3 p
= −1p
is 1 only when p ≡ 1 (mod 3). So p≡ 1 (mod
12).
· p3 = (−1) · (− 3p ) = p3
−3
Next take p ≡ −1 (mod 4). Then p = −1 p
again. So p ≡ 1 (mod 3) and hence p ≡ 7 (mod 12). Thus p ≡ 1 (mod 6)
covers both cases.
2 2 −1 2
p = x + 3y we see that p ∤ y and (xy ) ≡ −3 (mod p), so
(b) From
that −3 p
= 1. Then use (a).
(c) Conversely, assume p ≡ 1 (mod 6), and, knowing that then −3 p
=
1, take r ∈ N with r 2 ≡ −3 (mod p). Define f (u, v) = u + rv and K =
√
⌊ p⌋. Note that
√
K < p < K + 1, (2)
8
√
as p 6∈ Z. Consider all pairs (u, v) with 0 ≤ u ≤ K and 0 ≤ v ≤ K.
There are (K+1)2 > p such pairs, and so the multiset of all f (u, v) for
such u, v has, by the Pigeonhole Principle, two such pairs (u1 , v1 ) 6= (u2 , v2 )
for which f (u1 , v1 ) ≡ f (u2 , v2 ) (mod p). Hence
u1 + rv1 ≡ u2 + rv2 (mod p)
u1 − u2 ≡ −r(v1 − v2 ) (mod p)
a ≡ −rb (mod p),
say, where a = u1 − v1 and b = v1 − v2 are not both 0. Hence a2 ≡ −3b2
(mod p) as r 2 ≡ −3 (mod p), so that p | (a2 + 3b2 ). But |a| ≤ K, |b| ≤ K,
giving
0 < a2 + 3b2 ≤ 4K 2 < 4p.
So a2 + 3b2 = p or = 2p or = 3p.
(d) If x2 + 3y 2 = 2p, then x, y can’t both be even, as then 4 | (x2 +
3y 2), or of opposite parity, as then x2 +3y 2 is odd, or both odd, as then
x2 ≡ 1 (mod 8), 3y 2 ≡ 3 (mod 8), x2 + 3y 2 ≡ 4 (mod 8).
(e) If x2 + 3y 2 = 3p then 3 | x, x = 3x′ say, and so y 2 + 3x′2 = p.
Miscellaneous Problems
(23) Prove Wolstenholme’s theorem: if p is a prime greater than 3 then the numerator
of the fraction
1 1 1
1+ + +···+
2 3 p−1
2
is divisible by p .
It is now enough to prove that this latter sum is ≡ 0 (mod p). Let g
be a primitive root. We have
(p−1)/2 (p−1)/2
X X
1/(j(p − j)) ≡ − 1/j 2 (mod p)
j=1 j=1
on summing the GP, using the fact that p > 3, and Fermat.
(24) Suppose that a, b, c > 1 with ab ≡ 1 (mod c), bc ≡ 1 (mod a) and ca ≡ 1 (mod b).
Prove that {a, b, c} = {2, 3, 5}.
(25) Let n be a positive integer. How many digits has n? What is its most significant
digit? Its least significant digit?
Assuming n has an odd number of digits, what is its middle digit?
[The functions ⌊ ⌋ and log10 may be useful for this question.]