Let r=u/v where gcd(u,v)=1. Then we get
anun+an−1un−1v+⋯+a1uvn−1+a0vnbnun+bn−1un−1v+⋯+b1uvn−1+b0vn=0,=0.
Subtraction gives
(an−bn)un+(an−2−bn−2)un−2v2+⋯+(a1−b1)uvn−1+(a0−b0)vn=0,
since an−1=bn−1. This shows that v divides (an−bn)un and hence it divides an−bn. Since an−bn is a prime, either v=1 or v=an−bn. Suppose the latter holds. The relation takes the form
un+(an−2−bn−2)un−2v+⋯+(a1−b1)uvn−2+(a0−b0)vn−1=0.
(Here we have divided throughout by v.) If n>1, this forces v∣u, which is impossible since gcd(v,u)=1 (v>1 since it is equal to the prime an−bn). If n=1, then we get two equations:
a1u+a0vb1u+b0v=0,=0.
This forces a1b0−a0b1=0 contradicting anb0−a0bn=0. (Note: The condition anb0−a0bn=0 is extraneous. The condition an−1=bn−1 forces that for n=1, we have a0=b0. Thus we obtain, after subtraction
(a1−b1)u=0.
This implies that u=0 and hence r=0 is an integer.)