Let $q \in [0, 1)$ be an D4767: Unsigned real number.
Let $N \in 1, 2, 3 \ldots$ be a D5094: Positive integer.
Let $N \in 1, 2, 3 \ldots$ be a D5094: Positive integer.
Then
\begin{equation}
\sum_{n = 0}^N q^n
= \frac{1 - q^{N + 1}}{1 - q}
= \frac{q^{N + 1} - 1}{q - 1}
\end{equation}