We will prove that such numbers do not exist.
The quadratic equation x2−qx+1=0 has two rational roots t and t1 for which t+t1=q. It easily follows by induction that am=tm+tm1. Let's assume that there exist numbers b0,b1,…,bn satisfying the condition of the problem.
Lemma. Let f(x)=cnxn+cn−1xn−1+⋯+c1x+c0 be a polynomial with nonzero integer coefficients for which cn−k=ck for each k=0,1,…,n and ∑i=0nci=0. Then f(x)=(x−1)2g(x), where g(x) is a polynomial with integer coefficients.
Proof: From the condition we have that f(1)=0. As
f′(x)=ncnxn−1+(n−1)cn−1xn−2+⋯+c1,
it follows that
2f′(1)=(ncn+(n−1)cn−1+⋯+c1)+(nc0+(n−1)c1+⋯+cn−1)=n(cn+cn−1+⋯+c1+c0)=0
and therefore x=1 is a double root. The lemma is proved.
The polynomial f(x)=bnx2n+bn−1x2n−1+⋯+b1xn+1+2b0xn+b1xn−1+b2xn−2+⋯+bn−1x+bn satisfies the conditions of the lemma. It's not hard to see that
tn(bn(tn+tn1)+bn−1(tn−1+tn−11)+⋯+2b0)=f(t)=(t−1)2g(t).
Moreover, if t=sr, (r,s)=1, then from sr+rs=q>3 it easily follows that r≥s+2, i.e. r−s≥2. Then g(sr) is a number of the form s2n−2l.
Finally b0a0+b1a1+⋯+bnan is presented in the form rnsn(r−s)2l and because the number r−s≥2 and (r−s,r)=(r−s,s)=1, then the numerator will always square a prime number. □