Maths Olympiad Prep

Library / /1326 of 1394

, 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 ⁣:ZZf\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)25(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)25)x0(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 zFpz\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 d0d \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

f1(y)=y+f(y),f2(y)=f1(y)+y=2y+f(y),f(n1)(y)=f(y)=Fny+Fn1f(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 y0y \neq 0 and f(y)0f(y) \neq 0, the last two equations tell us

Fn2((1Fn1)f(y)y)((1Fn+1)yf(y))(Fn+11)(Fn11)(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+11A = F_{n + 1} - 1 and B=Fn11B = F_{n - 1} - 1 for brevity. The last equation becomes

(AB)2AB14((A+B)2(AB)2)(modp)(A+B)25(AB)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+1Fn11(modp)F_{n + 1} \equiv F_{n - 1} \equiv 1 \pmod {p}. Hence, if dd is the smallest positive integer such that Fd0(modp)F_d \equiv 0 \pmod {p} and Fd+11(modp)F_{d + 1} \equiv 1 \pmod {p}, then the Fibonacci sequence is periodic modulo pp with period dd, so dnd \mid n. The sum of all cycle lengths (excluding the fixed point 00) is p1p - 1, so dp1d \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 pFp1p \nmid F_{p - 1}.

Proof 1. Recall Binet's formula,

Fp1=15((1+52)p1(152)p1). 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 2p12^{p - 1} and expanding via the binomial theorem, we have

2p1Fp1=2k=0p325k(p12k+1). 2^{p - 1}F_{p - 1} = 2\sum_{k = 0}^{\frac{p - 3}{2}}5^{k}\binom{p - 1}{2k + 1}.

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

pFp1if and only ifpk=0p325k=5p12151 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 pFp1p \mid F_{p - 1} if and only if 5p121(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=152    (1+52)p1=(152)2=352. \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, (152)p1=3+52\left(\frac{1 - \sqrt{5}}{2}\right)^{p - 1} = \frac{3 + \sqrt{5}}{2}. Hence, by Binet's formula,

Fp1=15((1+52)p1(152)p1)=15(3523+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, Fp10F_{p - 1} \neq 0 (mod pp) if 55 is not a quadratic residue modulo pp, which contradicts dp1d \mid p - 1 above. This completes the solution.

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

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