Define $1+x+x^2+\cdots+x^n$ recursively

I think this is the best you can do: $a_n=x\cdot a_{n-1} + 1$

With $a_0=1$


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$.


$$f_n(x) = 1 + x + \ldots + x^n.$$

It can be rewriten as

$$f_n(x) = 1 + x\cdot\left(1 + \ldots + x^{n-1}\right),$$

or

$$f_n(x) = 1 + x\cdot f_{n-1}(x)$$

for $n>0$ and

$$f_0(x) = 1.$$