Write
P(x)=arxr+ar−1xr−1+⋯+a1x,
and consider its formal derivative
Q(x)=rarxr−1+(r−1)ar−1xr−2+⋯+a1.
Since P is not identically zero, neither is Q, so we may choose some positive integer m such that Q(m)=0. We claim that we may take n to be any prime that does not divide Q(m).
Let n be such a prime, and put
d=gcd(P(n)−P(0),P(n+1)−P(1),P(n+2)−P(2),…).
Certainly we have n∣d. On the other hand, if q is any prime distinct from n, then we cannot have q∣d. For suppose that q∣d. Since q and n are relatively prime, there are integers k,l>0 such that kn−lq=1. Then, notice that
P(m)≡P(m+n)≡P(m+2n)≡⋯≡P(m+kn)≡P(m+1)(modq)
for every nonnegative integer m. By induction, then, q divides all of P(0),P(1),P(2),…, contradicting the given.
Also, we cannot have n2∣d. Indeed,
P(m+n)−P(m)=i=1∑rai[(m+n)i−mi]=i=1∑rai[mi+imi−1n+(terms divisible by n2)−mi]=i=1∑rai[imi−1n+(terms divisible by n2)]≡n⋅Q(m)(modn2).
Therefore, P(m+n)−P(m) cannot be divisible by n2 since Q(m) is not divisible by n.
So d is divisible by n, but not by any other prime or by n2; hence d=n, as required.