In an increasing G.P the sum of the first and last term is 66,the product of the second and the last but one is 128 and the sum of the terms is 126.How many terms are there in the progression?

a + a.r^n = 66 = a(1 + r^n)

ar.a.r^(n-1) = 128 = a^2.r^n

So 66 = a (1 + 128/a^2)

66a = a^2 + 128

a^2 - 66a + 128 = 0

a = 66 +- rt(66^2 - 4(128)) / 2

a = 66 +- 62 / 2

a = 2, 64

Since, 66 = a(1 + r^n)

66 = 2(1 + r^n) OR 66 = 64 (1 + r^n)

Since r1 (increasing GP) so we take

66 = 2(1 + r^n)

r^n = 32

And,

a(r^(n+1) - 1) / (r - 1) = 126

2(32r - 1) / (r-1) = 126

63r - 63 = 32r - 1

31r = 62

r = 2

and r^n = 32

2^n = 32

so

n = 5.