The sum of first three terms of a G.P. is 16 and the sum of the next three terms is 128. Determine the first term, the common ratio and the sum to n terms of the G.P.
Let the G.P. be $a, a r, a r^{2}, a r^{3}, \ldots$
According to the given condition,
$a+a r+a r^{2}=16$ and $a r^{3}+a r^{4}+a r^{5}=128$
$\Rightarrow a\left(1+r+r^{2}\right)=16 \ldots(1)$
$a r^{3}\left(1+r+r^{2}\right)=128 \ldots(2)$
Dividing equation (2) by (1), we obtain
$\frac{a r^{3}\left(1+r+r^{2}\right)}{a\left(1+r+r^{2}\right)}=\frac{128}{16}$
$\Rightarrow r^{3}=8$
$\therefore r=2$
Substituting $r=2$ in (1), we obtain
$a(1+2+4)=16$
$\Rightarrow a(7)=16$
$\Rightarrow a=\frac{16}{7}$
$S_{n}=\frac{a\left(r^{n}-1\right)}{r-1}$
$\Rightarrow S_{n}=\frac{16}{7} \frac{\left(2^{n}-1\right)}{2-1}=\frac{16}{7}\left(2^{n}-1\right)$