First, any strictly increasing linear function is a solution. Indeed, for any integer k⩾1, the integer a+kb divides a2+b×(ka)=a(a+kb). Conversely, let's show that any solution is a linear function (which will be strictly increasing, since it takes values in N∗).
Consider an integer n⩾C, and let φ=f(1). Then
φ2+f(n)≡n2+f(n)≡0(modn+φ)
so f(n)+φ2 is a non-zero multiple of n+φ, which means that f(n)⩾n+φ−φ2.
On the other hand, since 1+f(n) divides 1+φn, let g(n)=(1+φn)/(1+f(n)). Then
φ(1+f(n))⩾φ(n+1+φ−φ2)=(1+f(n))g(n)−1+(1+φ−φ2)φ
This means that Φ⩾(1+f(n))(g(n)−φ), where we have set Φ=φ3−φ2−φ+1. Consequently, if n⩾Φ+φ2−φ, we know that 1+f(n)>Φ, and thus that g(n)⩽φ.
Now choose an integer a⩾1, and let's prove that f(a)=φa. To do this, we construct an integer n⩾max{Φ+φ2−φ,C} as follows:
▹ we take n≡2(mod4) if φ is odd, and n odd if φ is even: in all cases, nφ+1 is odd;
▹ for any prime p⩽max{a,φ} odd, we choose n≡1(modp) or n≡2 (modp) so that nφ≡−1(modp).
By the Chinese remainder theorem, such a choice is feasible, and for infinitely many integers n. Without loss of generality, we even assume that n⩾2max{φa,f(a)}.
Then g(n) is a divisor of 1+φn, and we know that g(n)⩽φ. By construction, the integer 1+φn has no prime factor p⩽φ, so g(n)=1, and thus f(n)=φn. But then a+φn=a+f(n) divides
(a2+nf(a))+(a+φn)(φn−a)=(φn)2+nf(a)=(φ2n+f(a))n
However, we have constructed n so that it has no common odd prime factor with a, and is not divisible by 4. Therefore, if we set d=PGCD(a+φn,n), then d=PGCD(a,n) divides 2. Then, if we set α=(a+φn)/d and n′=n/d, we observe that PGCD(α,n′)=1 and that α divides (φ2n+f(a))n′, so α divides φ2n+f(a). The integer α therefore also divides
(φ2n+f(a))−dφα=f(a)−φa
However, since n⩾2max{φa,f(a)}, we know that
α>φn/d⩾φn/2⩾max{φa,f(a)}⩾∣f(a)−φa∣.
Therefore, f(a)=φa, which concludes.