MathLabs

Problem 5

Determine all functions f:Z→Zf:\mathbb{Z}\to\mathbb{Z} such that f(f(a)−b)+b f(2a)f(f(a)-b)+b\,f(2a) is a perfect square for all integers aa and bb.
Step 5 of 5: Necessity: the two remaining cases
f(a)f(2a)−1=x2 ⇒ f(n) is always a perfect square;S={n:f(n)=0} unbounded above ⇒ Family 1;S bounded above ⇒ f(n)=n2f(a)f(2a)-1=x^2\ \Rightarrow\ f(n)\ \text{is always a perfect square};\qquad S=\{n:f(n)=0\}\ \text{unbounded above}\ \Rightarrow\ \text{Family 1};\qquad S\ \text{bounded above}\ \Rightarrow\ f(n)=n^2
Detailed analysis

With f(0)=0, setting a=0 and b=−n shows that every value f(n) is a perfect square. Replacing b by f(a)−b yields the auxiliary assertion (): f(b)+(f(a)−b)f(2a) is a square. Let S be the zero set. If S is unbounded above, fix n and choose k in S with k>f(n). Applying () at a=n,b=k makes (f(n)−k)f(2n) a square; its first factor is negative while the second is a square, so f(2n)=0. Thus all even values vanish and odd values may be arbitrary squares. If S is bounded above, choose a sufficiently large prime p and put n=(p+1)/2. Applying () at a=n,b=2n shows that f(2n)(f(n)−2n+1) is a square. Since f(2n) is nonzero, writing f(n)=u² gives u²−v²=p, hence u=n and f(n)=n². These n are unbounded. The square-gap argument applied to () with arbitrarily large such k gives f(2n) equal to either 0 or four times f(n); boundedness of S then gives f(2k)=4k² for large k. Finally (**) at a=k,b=n says that (2k²−n)²+f(n)−n² is a square for arbitrarily large k, forcing f(n)=n² for every n.