Number theoryDifficulty 6.1National OlympiadProve itUnited States
Problem: Let Z be the set of integers. Determine, with proof, all primes p for which there exists a function f:Z→Z such that for any integer x,
f(x+p)=f(x) and p divides f(x+f(x))−x.
Solution
Solution: We work in Fp, treating f as a map from Fp to itself. Clearly, p=2 doesn't work. For p>2 such that 5 is a quadratic residue mod p, as well as p=5 itself, there exists some α such that (2α+1)2≡5 (mod p). Taking f(x)=αx then works because
f(x+f(x))−x=(α2+α−1)x=41((2α+1)2−5)x≡0(modp).
To prove no other primes satisfy the conditions in the problem statement, note that f is surjective, as for any x, f(x+f(x))=x. As Fp is finite, f is bijective. Plugging in x=f(y) yields
f(f(y)+f(f(y)))=f(y)⟹f(y)+f(f(y))=y.
Since f is bijective, there exists z∈Fp such that f(z)=0, then z=f(z+f(z))=f(z)=0. Therefore, f(0)=0. This is the only fixed point, as any fixed point d would satisfy d=f(d)+f(f(d))=2d, which is impossible if d=0. Hence the remaining residues form nontrivial cycles y, f(y), f(f(y)), etc. If the cycle containing y is of length n, then
As 5 is not a quadratic residue, this implies Fn+1≡Fn−1≡1(modp). Hence, if d is the smallest positive integer such that Fd≡0(modp) and Fd+1≡1(modp), then the Fibonacci sequence is periodic modulo p with period d, so d∣n. The sum of all cycle lengths (excluding the fixed point 0) is p−1, so d∣p−1. The following well-known lemma will give us a contradiction.
Lemma 1. If 5 is not a quadratic residue modulo a prime p, then p∤Fp−1.
Proof 1. Recall Binet's formula,
Fp−1=51(21+5)p−1−(21−5)p−1.
Multiplying both sides by 2p−1 and expanding via the binomial theorem, we have
2p−1Fp−1=2k=0∑2p−35k(2k+1p−1).
However, (2k+1p−1)≡(−1)2k+1≡−1(modp) for all k, so
p∣Fp−1if and only ifpk=0∑2p−35k=5−152p−1−1
Therefore p∣Fp−1 if and only if 52p−1≡1(modp), which doesn't hold if 5 is not a quadratic residue modulo p, as desired. □
Proof 2. Work in Fp2=Fp[5]. Since 5 is not a quadratic residue, we get that (5)p=−5. Using the fact that (a+b)p=ap+bp (because all other terms have coefficient divisible by p), we get that
(21+5)p=21−5⟹(21+5)p−1=(21−5)2=23−5.
Similarly, (21−5)p−1=23+5. Hence, by Binet's formula,