2. Let $a_{1}, a_{2}, \ldots, a_{n}$ be positive consecutive terms of a geometric progression. If the sums

$$
S=a_{1}+a_{2}+\ldots+a_{n} \quad \text { and } \quad T=\frac{1}{a_{1}}+\frac{1}{a_{2}}+\ldots+\frac{1}{a_{n}}
$$

are known, express the product $a_{1} a_{2} \ldots a_{n}$ in terms of $S, T$ and $n$.
Solution. Let $q \neq 1$ be the common ratio of the progression, then from $S=a_{1}+a_{2}+\ldots+a_{n}$ we get

$$
a_{1} \frac{q^{n}-1}{q-1}=S
$$

From $T=\frac{1}{a_{1}}+\frac{1}{a_{2}}+\ldots+\frac{1}{a_{n}}$ we get

$$
\frac{1}{a_{1}} \frac{q^{n}-1}{q-1} \frac{1}{q^{n-1}}=T
$$

From (1) we get $\frac{q^{n}-1}{q-1}=\frac{s}{a_{1}}$, substituting in (2) we get $q^{n-1}=\frac{S}{a_{1}^{2} T}$. Now

$$
a_{1} a_{2} \ldots a_{n}=a_{1}^{n} q^{1+2+3+\ldots+n}=a_{1}^{n} q^{\frac{n(n+1)}{2}}=a_{1}^{n}\left(q^{n-1}\right)^{\frac{n}{2}}=a_{1}^{n}\left(\frac{S}{a_{1}^{2} T}\right)^{\frac{n}{2}}=\left(\frac{S}{T}\right)^{\frac{n}{2}}=\sqrt{\frac{S^{n}}{T^{n}}}
$$

If $q=1$, then $n a_{1}=S, \frac{n}{a_{1}}=T$, so $a_{1}=\sqrt{\frac{S}{T}}$. Therefore, $a_{1} a_{2} \ldots a_{n}=a_{1}^{n}=\sqrt{\frac{S^{n}}{T^{n}}}$.