MathLabs

Problem 3

Find all functions g:Z>0→Z>0g:\mathbb{Z}_{>0}\to\mathbb{Z}_{>0} such that (g(m)+n)(g(n)+m)\left(g(m)+n\right)\left(g(n)+m\right) is a perfect square for all m,n∈Z>0m,n\in\mathbb{Z}_{>0}.
Step 1 of 6: Verify the candidate family
In plain words

The two factors become identical when g(n)=n+cg(n)=n+c, so their product is automatically a square.

g(n)=n+c,c≥0g(n)=n+c,\quad c\ge0
Detailed analysis

For any fixed integer c≥0c\ge0, define g(n)=n+cg(n)=n+c. Then gg maps positive integers to positive integers, and P(m,n)=(g(m)+n)(g(n)+m)=(m+n+c)2P(m,n)=(g(m)+n)(g(n)+m)=(m+n+c)^2. Thus every function in this family satisfies the condition; it remains to prove that no other function does.