Elementary combinatorics: Arithmetic and geometric sequences
Geometric sequences
A geometric sequence with ratio \(\boldsymbol{r}\) is a sequence of numbers \(a_0,a_1,a_2, \ldots\) for which the quotient \(a_{k+1}/a_k\) of two consecutive terms of the sequence is equal to the constant \(r\). So each term in the sequence, except the first one, is the result of multiplication of its predecessor by \(r\): \(a_{k+1}=r\cdot a_k\).
Examples \[\begin{aligned}&1,2,4,8,16,\ldots\\[0.25cm] &2,6,18,54,162,\ldots\end{aligned}\]
If \(a_0,a_1,a_2\ldots\) is a geometric sequence with ratio \(r\), then the partial sum of the first \(n\) terms is given by \[\begin{aligned}\sum_{k=0}^{n-1}a_k&= a_0\cdot \sum_{k=0}^{n-1}r^k\\[0.25cm] &=a_0\cdot \frac{1-r^n}{1-r}\end{aligned}\]
Examples \[\begin{array}{rcrcrcrcrrc} 1&+&2&+&4&+&8&+&16&&\\ &&2&+&4&+&8&+&16&+&32\\ \hline \end{array}\] So: \(\displaystyle \sum_{k=0}^{4}2^k=\frac{1-32}{1-2}=2^5-1=31\)
If \(a_1=3, r=2, n=20\), then \(\phantom{\qquad\qquad\qquad}\) \[\begin{aligned}\sum_{k=0}^{19}(3\times 2^k) &=3\times\frac{1-2^{20}}{1-2}\\[0.25cm]&=3\times (2^{20}-1)\\[0.25cm] &=1048575\end{aligned}\]