Let $x \neq 1$ be a real number. Define the following sum recursively: $$ 1+x+x^2+\cdots+x^n $$
My attempt:
Using summation notation we can write the sum as $\sum_{i=0}^{n} x^i$. Now define $$ \sum_{i=0}^{0}x^i:=x^0=1 \quad \text{and} \quad \sum_{i=0}^{n}x^i:=\sum_{i=0}^{n-1}x^i+x^n $$ It seems to me correct because if we use the definition for $n=3$, then $$ \sum_{i=0}^{3}x^i=\sum_{i=0}^{2}x^i+x^3=(\sum_{i=0}^{1}x^i+x^2)+x^3=((\sum_{i=0}^{0}x^i+x)+x^2)+x^3=1+x+x^2+x^3 $$ In other words, we reach the base case. However, I'm unsure if this is correct. I might have misunderstood what a recursive definition is.
As I mentioned as a comment, we can define the recurrence:
\begin{equation*} f(n) = \left\{ \begin{array}{ll} x^n + f(n-1) & \quad n > 0 \\ 1 & \quad n = 0 \end{array} \right. \end{equation*}
for all $n \in \mathbb{N}_0$.