Let us take a1=a. We have
a2=a+kd,(a+pd)2=a+ld,(a+qd)2=a+md.
Thus we have
a+ld=(a+pd)2=a2+2pad+p2d2=a+kd+2pad+p2d2.
Since we have non-constant AP, we see that d=0. Hence we obtain 2pa+p2d=l−k. Similarly, we get 2qa+q2d=m−k. Observe that p2q−pq2=0. Otherwise p=q and gcd(p,q)=p>1 which is a contradiction to the given hypothesis that gcd(p,q)=1. Hence we can solve the two equations for a,d:
a=2(p2q−pq2)p2(m−k)−q2(l−k),d=p2q−pq2q(l−k)−p(m−k).
It follows that a,d are rational numbers. We also have
p2a2=p2a+kp2d.
But p2d=l−k−2pa. Thus we get
p2a2=p2a+k(l−k−2pa)=(p−2k)pa+k(l−k).
This shows that pa satisfies the equation
x2−(p−2k)x−k(l−k)=0.
Since a is rational, we see that pa is rational. Write pa=w/z, where w is an integer and z is a natural number such that gcd(w,z)=1. Substituting in the equation, we obtain
w2−(p−2k)wz−k(l−k)z2=0.
This shows z divides w. Since gcd(w,z)=1, it follows that z=1 and pa=w an integer. (In fact any rational solution of a monic polynomial with integer coefficients is necessarily an integer.) Similarly, we can prove that qa is an integer. Since gcd(p,q)=1, there are integers u and v such that pu+qv=1. Therefore a=(pa)u+(qa)v. It follows that a is an integer. But p2d=l−k−2pa. Hence p2d is an integer. Similarly, q2d is also an integer. Since gcd(p2,q2)=1, it follows that d is an integer. Combining these two, we see that all the terms of the AP are integers.
Alternatively, we can prove that a and d are integers in another way. We have seen that a and d are rationals; and we have three relations:
a2=a+kd,p2d+2pa=n1,q2d+2qa=n2,
where n1=l−k and n2=m−k. Let a=u/v and d=x/y where u,x are integers and v,y are natural numbers, and gcd(u,v)=1, gcd(x,y)=1. Putting this in these relations, we obtain
u2y=uvy+kxv2,(1)
2puy+p2vx=vyn1,(2)
2quy+q2vx=vyn2.(3)
Now (1) shows that v∣u2y. Since gcd(u,v)=1, it follows that v∣y. Similarly (2) shows that y∣p2vx. Using gcd(y,x)=1, we get that y∣p2v. Similarly, (3) shows that y∣q2v. Therefore y divides gcd(p2v,q2v)=v. The two results v∣y and y∣v imply v=y, since both v,y are positive. Substitute this in (1) to get
u2=uv+kxv.
This shows that v∣u2. Since gcd(u,v)=1, it follows that v=1. This gives v=y=1. Finally a=u and d=x which are integers.