A1=S1=p-2+q,
An=Sn-Sn-1=pn^2-2n+q-p(n-1)^2+2(n-1)-q=p(2n-1)-2=2pn-p-2
d=An-An-1=2p
An=A1+(n-1)*d=p-2+q+2(n-1)p=2pn-p-2+q = 2pn-p-2
q=0
A1=S1=p-2+q,
An=Sn-Sn-1=pn^2-2n+q-p(n-1)^2+2(n-1)-q=p(2n-1)-2=2pn-p-2
d=An-An-1=2p
An=A1+(n-1)*d=p-2+q+2(n-1)p=2pn-p-2+q = 2pn-p-2
q=0