Solution: We will show that f(x)=(x−1)m provides an answer. For n≥2 we have f(n)=(n−1)m>0, thus the first condition is satisfied.
Lemma 1. Let d,t,x be positive integers. If x−1 is a multiple of dt, then xd−1 is a multiple of dt+1.
Proof. Since x≡1(modd), we have xd−1+⋯+x+1≡1+⋯+1≡0(modd). Thus xd−1=(x−1)(xd−1+⋯+x+1) is a multiple of dt+1 as desired. ■
Let n≥2. Since n(n−1)0−1=n−1 is a multiple of n−1, an induction using Lemma 1 shows that n(n−1)m−1 is a multiple of (n−1)m+1 for m≥0. Thus, we conclude that f(x)=(x−1)m is an answer for m≥0.
Next we will show that no other answers exist. For integers a,b with b=0, we write b∣a to mean that a is divisible by b.
Lemma 2. For a positive integer n and integers a and b, a≡b(modn) implies f(a)≡f(b)(modn).
Proof. Write f(x)=a0+a1x+⋯+adxd, where d is a nonnegative integer and a0,a1,…,ad are integers. Since n∣a−b,
f(a)−f(b)=i=1∑dai(ai−bi)=(a−b)i=1∑dai(ai−1+ai−2b+⋯+abi−2+bi−1)
is divisible by n. ■
We will show that, for an odd prime p and an integer n≥2, p∣f(n) implies p∣n−1. For a nonnegative integer k, Lemma 2 shows that f(n+kp)≡f(n)≡0(modp). Thus we have
0≡(n+kp)f(n+kp)−1≡nf(n+kp)−1(modp)
Since p and p−1 are coprime, we can take a nonnegative integer k such that p−1∣n+kp.
Then f(n+kp)≡f(p−1)(modp−1) holds and thus Fermat's little theorem shows that
0≡nf(n+kp)−1≡nf(p−1)−1,(modp)
therefore we have
nf(p−1)≡1.(modp)
Since f(p−1)∣(p−1)f(p−1)−1, f(p−1) and p−1 are coprime. Thus, there exists a positive integer r such that f(p−1)r≡1(modp−1). By Fermat's little theorem we have
n≡nf(p−1)r≡1r≡1,(modp)
that is, p∣n−1.
We have shown that, for an odd prime p and an integer n≥2, p∣f(n) implies p∣n−1. In particular, for an odd prime p, any prime factor of f(p+1) is also a prime factor of p+1−1=p, which means that f(p+1) is a power of p.
Write f(x+1)=xm(b0+b1x+⋯+blxl) where l and m are nonnegative integers and b0=0,b1,…,bl are integers. Let p be an odd prime greater than ∣b0∣. Then f(p+1) is a multiple of pm, while f(p+1)≡b0pm=0(modpm+1). The argument above shows that f(p+1)=pm.
Let g(x)=f(x)−(x−1)m. Then there exist infinitely many integers n such that g(n)=0. It follows that g(x)=0 as polynomials. We conclude that f(x)=(x−1)m.