a(1+r+r2+r3)=30 .....(1)
a2(1+r2+r4+r6)=340
or a(1−r4)1−r=30,a2(1−r8)1−r2=340
Eliminate a by squaring 1st and dividing 2nd.
∴a2(1−r4)2(1−r)2.1−r2a2(1−r8)=900340=4517
1−r41+r4.1+r1−r=4517
or 17(1+r+r2+r3)(1+r)=45(1+r4)
or 17(r4+2r3+2r2+2r+1)=45+45r4
or 14r4+17r3−17r2−17r+14=0
Divide by r2
14(r2+1r2)−17(r+1r)−17=0
Put r+1r=t
14(t2−2)−17t−17=0or 14t2−17t−45=0
∴t=17±√289+252028
or r+1r=17±5328=52 or −97
or 2r2−5r+2=0 and 7r2+9r+7=0
∴r=2,12 from 1st and r is imaginary from 2nd
When r=2 then from (1),a=2; when r=12 then a=16.
Hence the required G.Ps are 2,4,8,16,32,.. and 16,8,4,2,1,