Suppose that
a2b2n2+a1b1n+a0b0∣(a22017n+b2)n2+(a12017n+b1)n+(a02017n+b0)(1)
We first claim that a0=b0=1. Let n be a large multiple of a0b0. Since a0b0 divides the left-hand side of (1), it also divides the right-hand side and hence a0b0∣a02017n+b0. This implies a0∣b0 and b0∣a02017n. This shows a0, b0 have the same prime divisors. Thus, we can take a sufficiently large n such that a0b0∣a02017n. This gives a0b0∣b0. The only possibility is a0=1, which implies b0=1.
Let M be a sufficiently large integer and let n0 be the product of all primes less than M. Choose any prime divisor p of
a2b2n02+a1b1n0+1.(2)
Clearly, (p,n0)=1. Thus, p≥M. In particular, we have (p,a1a2)=1 as M is large.
Consider any n such that n≡n0(modp). Then p divides the left-hand side of (1). This gives
p∣(a22017n+b2)n02+(a12017n+b1)n0+2.(3)
We choose n such that p−1∣n. Such an n exists by the Chinese remainder theorem. By Fermat's little theorem, we obtain p∣(1+b2)n02+(1+b1)n0+2. Taking the difference with (3), as (p,n0)=1, we get
p∣(a22017n−1)n0+(a12017n−1)(4)
for any n≡n0(modp). By taking n≡1(modp−1) and n≡2(modp−1) respectively, we have
p∣(a22017×2−1)(a12017−1)−(a12017×2−1)(a22017−1)=(a12017−1)(a22017−1)(a22017−a12017).
Since p≥M is sufficiently large, the right-hand side must be 0. If one of a1, a2 is 1, then (4) implies both are equal to 1. If a1=a2, then (4) implies a1=a2=1 or n0≡−1(modp).
We first consider the case a1=a2=1. In that case, (1) becomes b2n2+b1n+1∣(1+b2)n2+(1+b1)n+2 so that b2n2+b1n+1∣n2+n+1. Note that b2n2+b1n+1≥n2+n+1. Thus, equality must hold and hence b1=b2=1. One easily checks that a0=a1=a2=b0=b1=b2=1 is a solution.
Next, it remains to consider the case n0≡−1(modp). As p divides (2), this yields p∣a2b2−a1b1+1. Since p is large, we must have a2b2−a1b1+1=0. Then (2) becomes (a1b1−1)n02+a1b1n0+1=(n0+1)((a1b1−1)n0+1). Therefore, instead of choosing any prime p dividing (2) at the beginning, we choose such a prime p dividing (a1b1−1)n0+1. Using the same argument, we obtain either the same solution or n0≡−1(modp). In the latter case, we find that p∣−(a1b1−1)+1. Again, this forces a1b1=2 as p is large. Thus, (a1,b1)=(1,2) or (2,1). Also, a2b2=a1b1−1=1 so that a2=b2=1.
Now, by considering n=3 in (1), we have 16∣2(3)2+(a12017n+b1)(3)+2. As a1, b1 have different parities, the right-hand side is odd. This is impossible.
Therefore, the only solution is a0=a1=a2=b0=b1=b2=1. □