Solution (source code)

= Solution

The first term is $ar$, so the <finite geometric series> is $S=a(r+r^2+\cdots+r^{100})$. Subtracting $rS$ cancels the interior terms and gives $(1-r)S=ar(1-r^{100})$. Therefore
$$
\boxed{S=\frac{ar(1-r^{100})}{1-r}\quad(r\ne1);\qquad S=100a\quad(r=1).}
$$
The rational expression holds for every real $a$ and every real $r\ne1$, including $r=0$; the same algebra works for <complex numbers>. No restriction $|r|<1$ is needed for a <finite geometric series>. The exceptional case follows by adding one hundred equal terms, or by taking the <limit> as $r\to1$.