s3=a1+a2+a3
12=a1+a2+4
a1+a2=8
a1+a1q=8
a1(1+q)=8
a1=8/(1+q)
a1q^2=4
a1=4/q^2
8/(1+q)=4/q^2
2/(1+q)=1/q^2
2q^2=1+q
2q^2-q-1=0
(2q+1)(q-1)=0
q=-1/2或q=1
当q=-1/2时
a3=a1q^2
4=a1*1/4
a1=16
an=a1q^(n-1)
=16*(-1/2)^(n-1)
=(-1/2)^-4*(-1/2)^(n-1)
=(-1/2)^(n-5)
当q=1时
a3=a1q^2
4=a1*1
a1=4
an=a1q^(n-1)
=4*1^(n-1)
=4
所以当q=-1/2时,an=(-1/2)^(n-1)
当q=1时,an=4