You are on page 1of 2

Number Theory Problem

Zachary Chase
March 1, 2015

Problem: Find all primes p such that p! + p is a perfect square.

Solution: I claim that p = 2, 3 are the only two values that work. Those
two values work, as

2! + 2 = 4 = 22
3! + 3 = 9 = 32

Now suppose p ≥ 4 and p! + p = m2 for some m ∈ Z. Reading mod 4 yields,

m2 ≡ p! + p ≡ p (mod 4)

Therefore, because p ≥ 4, p is odd, and because it is a square mod 4,

p ≡ 1 (mod 4).

Additionally, because p ≡ 1 (mod 4), p ≡ 1, 5 (mod 8) so if p ≥ 8 (p = 5, 7


don’t work),

m2 ≡ p! + p ≡ p (mod 8)

But 5 is not a quadratic residue mod 8 so p ≡ 1 (mod 8)

Now note that for every odd prime q where q < p,

m2 ≡ p! + p ≡ p (mod q) =⇒
 
p
= 1 =⇒
q
    
p q q
= =⇒
q p p
 
(p−1)(q−1) q
(−1) 2 = =⇒
p
 
q
1= because p ≡ 1 (mod 4)
p

1
Additionally, for q = 2,
 
2 p2 −1
= (−1) 8 = 1
p

Where the last equality is true because 8 | (p − 1), as I already proved, and
p + 1 is even.

Therefore, all primes less than p are quadratic residues mod p, and because
the legendre symbol is multiplicative and all numbers less than p are a product
of those primes, we get that all numbers less than p are quadratic residues mod
p, contradicting that there are only p−1
2 quadratic residues.

So, p! + p is never a square again after 3.

You might also like