I'm learning about generating functions and in the opening explanations my book (and various sources) claim:

$$a_n = 1 \forall n \in \mathbb{N}_0, \ \ \ f(x) = \frac{1}{1-x}$$.
I read this as:
The sum of the $nth$ term of a series where every term is $1$ is equal to $$\frac{1}{1-n}$$.
But this doesn't make sense. Look at the 5th term: $$1+1+1+1+1 = 5$$ but this is not consistent with the formula: $$\frac{1}{1-5} = \frac{1}{-4}$$
What am I misunderstanding?
The definition of an (ordinary) generating function is that if $f(x)$ generates the sequence $a_n$, then: $$a_n = f^{(n)}(0)/n!\ .$$
Here we have $$f(x) = \frac{1}{1-x} = \sum_{n=0}^\infty 1\cdot x^n = \sum_{n=0}^\infty a_n x^n$$ where $a_n=1$ for all $n$.