Answer: there is only one function, f(n)=2n+1007
Solution: Let f be a function satisfying the original equation, let C=1007, and then define the function g:Z→Z, for all integers m,g(m)=f(3m)−f(m)+2C. Then we have g(0)=2C, and the original equation can be rewritten as
f(f(m)+n)=g(m)+f(n)
holding for all m,n∈Z. Using induction we obtain
f(tf(m)+n)=tg(m)+f(n)(1)
holding for all m,n,t∈Z. For any r∈Z, substituting (r,0,f(0)) and (0,0,f(r)) for (m,n,t) we obtain:
f(0)g(r)=f(f(r)f(0))−f(0)=f(r)g(0)
If f(0)=0, then from g(0)=2C>0 we can obtain that for all m,f(m)=0, which is a contradiction. Therefore f(0)=0, and from the above equation we get g(r)=αf(r), where α=f(0)g(0) is a nonzero constant.
Thus from the definition of g we obtain f(3m)=(1+α)f(m)−2C, that is
f(3m)−β=(1+α)(f(m)−β)(2)
holding for all m∈Z, where β=α2C. Using induction we obtain
f(3km)−β=(1+α)k(f(m)−β)(3)
holding for all integers k≥0 and m.
Since 3 does not divide 2014, from the original equation we can obtain that there exists d=f(a) that is not divisible by 3. From (1)
we obtain f(n+td)=f(n)+α⋅td, that is
f(n+td)=f(n)+α⋅td(4)
holding for all n,t∈Z.
Fix a positive integer k such that d∣(3k−1); by Euler's theorem, we can take k=ϕ(∣d∣) so that this holds. Then from (4) we obtain that for all m∈Z
f(3km)=f(m)+α(3k−1)m
Combining with (3) we can deduce that ((1+α)k−1)(f(m)−β)=α(3k−1)m. Since α=0, when m=0 the right side is not zero, so the first term on the left side is also not zero, hence
f(m)=(1+α)k−1α(3k−1)⋅m+β
So f is a linear function; let f(m)=Am+β for all m∈Z, where A∈Q is a constant, and substituting into the original equation we get (A2−2A)m+(Aβ−2C)=0 holding for all m, which is equivalent to
A2=2A and Aβ=2C.
The first equality is equivalent to A∈{0,2}, and from C=0 we obtain
A=2 and β=C.
This tells us that f is exactly the function in the answer, and this function does satisfy the original equation.