Maths Olympiad Prep

Library / HMMT February /1241 of 1302

HMMT February, 2025

Number theory Difficulty 6.1 National Olympiad Prove it United States

Problem:
Let Z\mathbb{Z} be the set of integers. Determine, with proof, all primes pp for which there exists a function f ⁣:Z→Zf\colon \mathbb{Z}\to \mathbb{Z} such that for any integer xx,

f(x+p)=f(x)f(x + p) = f(x) and pp divides f(x+f(x))−xf(x + f(x)) - x.

Solution

Solution:
We work in Fp\mathbb{F}_p, treating ff as a map from Fp\mathbb{F}_p to itself. Clearly, p=2p = 2 doesn't work. For p>2p > 2 such that 55 is a quadratic residue mod pp, as well as p=5p = 5 itself, there exists some α\alpha such that (2α+1)2≡5(2\alpha + 1)^2\equiv 5 (mod pp). Taking f(x)=αxf(x) = \alpha x then works because

f(x+f(x))−x=(α2+α−1)x=14((2α+1)2−5)x≡0(modp). f(x + f(x)) - x = (\alpha^2 + \alpha -1)x = \frac{1}{4}\left((2\alpha +1)^2 - 5\right)x\equiv 0\pmod {p}.

To prove no other primes satisfy the conditions in the problem statement, note that ff is surjective, as for any xx, f(x+f(x))=xf(x + f(x)) = x. As Fp\mathbb{F}_p is finite, ff is bijective. Plugging in x=f(y)x = f(y) yields

f(f(y)+f(f(y)))=f(y)  ⟹  f(y)+f(f(y))=y. f(f(y) + f(f(y))) = f(y)\implies f(y) + f(f(y)) = y.

Since ff is bijective, there exists z∈Fpz\in \mathbb{F}_p such that f(z)=0f(z) = 0, then z=f(z+f(z))=f(z)=0z = f(z + f(z)) = f(z) = 0. Therefore, f(0)=0f(0) = 0. This is the only fixed point, as any fixed point dd would satisfy d=f(d)+f(f(d))=2dd = f(d) + f(f(d)) = 2d, which is impossible if d≠0d \neq 0. Hence the remaining residues form nontrivial cycles yy, f(y)f(y), f(f(y))f(f(y)), etc. If the cycle containing yy is of length nn, then

f−1(y)=y+f(y),f−2(y)=f−1(y)+y=2y+f(y),⋮f−(n−1)(y)=f(y)=Fny+Fn−1f(y),y=Fn+1y+Fnf(y),(by induction) \begin{array}{rl} & f^{-1}(y) = y + f(y),\\ & f^{-2}(y) = f^{-1}(y) + y = 2y + f(y),\\ & \qquad \vdots\\ & f^{-(n - 1)}(y) = f(y) = F_ny + F_{n - 1}f(y),\\ & \qquad y = F_{n + 1}y + F_n f(y), \end{array} \quad (\text{by induction})

where FkF_k is the kk-th Fibonacci number. As y≠0y \neq 0 and f(y)≠0f(y) \neq 0, the last two equations tell us

Fn2≡((1−Fn−1)f(y)y)((1−Fn+1)yf(y))≡(Fn+1−1)(Fn−1−1)(modp). F_n^2 \equiv \left(\frac{(1 - F_{n - 1})f(y)}{y}\right) \left(\frac{(1 - F_{n + 1})y}{f(y)}\right) \equiv (F_{n + 1} - 1)(F_{n - 1} - 1) \pmod {p}.

Let A=Fn+1−1A = F_{n + 1} - 1 and B=Fn−1−1B = F_{n - 1} - 1 for brevity. The last equation becomes

(A−B)2≡AB≡14((A+B)2−(A−B)2)(modp)⟹(A+B)2≡5(A−B)2(modp). (A - B)^2 \equiv AB \equiv \frac{1}{4} ((A + B)^2 - (A - B)^2) \pmod {p} \Longrightarrow (A + B)^2 \equiv 5(A - B)^2 \pmod {p}.

As 55 is not a quadratic residue, this implies Fn+1≡Fn−1≡1(modp)F_{n + 1} \equiv F_{n - 1} \equiv 1 \pmod {p}. Hence, if dd is the smallest positive integer such that Fd≡0(modp)F_d \equiv 0 \pmod {p} and Fd+1≡1(modp)F_{d + 1} \equiv 1 \pmod {p}, then the Fibonacci sequence is periodic modulo pp with period dd, so d∣nd \mid n. The sum of all cycle lengths (excluding the fixed point 00) is p−1p - 1, so d∣p−1d \mid p - 1. The following well-known lemma will give us a contradiction.

Lemma 1. If 55 is not a quadratic residue modulo a prime pp, then p∤Fp−1p \nmid F_{p - 1}.

Proof 1. Recall Binet's formula,

Fp−1=15((1+52)p−1−(1−52)p−1). F_{p - 1} = \frac{1}{\sqrt{5}} \left(\left(\frac{1 + \sqrt{5}}{2}\right)^{p - 1} - \left(\frac{1 - \sqrt{5}}{2}\right)^{p - 1}\right).

Multiplying both sides by 2p−12^{p - 1} and expanding via the binomial theorem, we have

2p−1Fp−1=2∑k=0p−325k(p−12k+1). 2^{p - 1}F_{p - 1} = 2\sum_{k = 0}^{\frac{p - 3}{2}}5^{k}\binom{p - 1}{2k + 1}.

However, (p−12k+1)≡(−1)2k+1≡−1(modp)\binom{p- 1}{2k+1} \equiv(- 1)^{2k+1} \equiv- 1 \pmod{p} for all kk, so

p∣Fp−1if and only ifp∣∑k=0p−325k=5p−12−15−1 p \mid F_{p - 1} \quad \text{if and only if} \quad p \left| \sum_{k = 0}^{\frac{p - 3}{2}} 5^{k} = \frac{5^{\frac{p - 1}{2}} - 1}{5 - 1} \right.

Therefore p∣Fp−1p \mid F_{p - 1} if and only if 5p−12≡1(modp)5^{\frac{p - 1}{2}} \equiv 1 \pmod {p}, which doesn't hold if 55 is not a quadratic residue modulo pp, as desired. □\square

Proof 2. Work in Fp2=Fp[5]\mathbb{F}_{p^{2}} = \mathbb{F}_{p}[\sqrt{5}]. Since 55 is not a quadratic residue, we get that (5)p=−5(\sqrt{5})^{p} = - \sqrt{5}. Using the fact that (a+b)p=ap+bp(a + b)^{p} = a^{p} + b^{p} (because all other terms have coefficient divisible by pp), we get that

(1+52)p=1−52  ⟹  (1+52)p−1=(1−52)2=3−52. \left(\frac{1 + \sqrt{5}}{2}\right)^{p} = \frac{1 - \sqrt{5}}{2} \implies \left(\frac{1 + \sqrt{5}}{2}\right)^{p - 1} = \left(\frac{1 - \sqrt{5}}{2}\right)^{2} = \frac{3 - \sqrt{5}}{2}.

Similarly, (1−52)p−1=3+52\left(\frac{1 - \sqrt{5}}{2}\right)^{p - 1} = \frac{3 + \sqrt{5}}{2}. Hence, by Binet's formula,

Fp−1=15((1+52)p−1−(1−52)p−1)=15(3−52−3+52)=−1, F_{p - 1} = \frac{1}{\sqrt{5}}\left(\left(\frac{1 + \sqrt{5}}{2}\right)^{p - 1} - \left(\frac{1 - \sqrt{5}}{2}\right)^{p - 1}\right) = \frac{1}{\sqrt{5}}\left(\frac{3 - \sqrt{5}}{2} -\frac{3 + \sqrt{5}}{2}\right) = -1,

so it is not divisible by pp.

Hence, Fp−1≠0F_{p - 1} \neq 0 (mod pp) if 55 is not a quadratic residue modulo pp, which contradicts d∣p−1d \mid p - 1 above. This completes the solution.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.