1B. In the geometric progression $a_{1}, a_{2}, \ldots, a_{n}$, it holds that $a_{1}+a_{3}=20, a_{2}+a_{4}=40$ and $S_{n}=a_{1}+\ldots+a_{n}=1020$. Determine $n$.
Solution. Let $q$ be the common ratio of the progression. From $a_{1}+a_{3}=20, a_{2}+a_{4}=40$ we get $a_{1}\left(1+q^{2}\right)=20$ and $a_{1} q\left(1+q^{2}\right)=40$. By dividing the second equation by the first, we get $q=2, \ldots \ldots$. (5p) and from $a_{1}\left(1+q^{2}\right)=20$ we get $a_{1}=4$. Now, from $S_{n}=a_{1} \frac{q^{n}-1}{q-1}=4 \frac{2^{n}-1}{2-1}=1020$ we have $2^{n}=256$, i.e., $n=8$.