# Generating function for $a_{n+1}=10a_n+1$

I was trying to find the value of : $$1+11+111+\cdots+111\cdots11$$ using generating functions instead of using GP. I know that it's going to be same at the end, but still, just for the sake of it, I was trying.

The recurrence I'm using is $a_{n+1}=10a_n+1;~ n\geq 0$ with $a_0=1$.

For the generating series to be— $$A(x)=a_0+a_1x+a_2x^2+\cdots$$, we have, after calculation, $A(x)=\frac{1}{10x^2-11x+1}=\frac{1}{9}\left(\frac{1}{\frac{1}{10}-x}-\frac{1}{1-x}\right)$. (I hope this is correct)

Now, I expanded it using Taylor Series but then, I think something has gone wrong or I did something wrong in the later steps.

• The brackets are the floor function or only brackets? Dec 12, 2017 at 17:22
• @ajotatxe Just simple brackets. Nvm, edited. Dec 12, 2017 at 17:24
• What you did is just fine. The Taylor series of your function at $0$ is indeed$$1+11x+111x^2+1\,111x^3+\cdots$$as you wished. Dec 12, 2017 at 17:27
• @JoséCarlosSantos Yes, and now how to extract the $a_i$'s from the function? Dec 12, 2017 at 17:28

$$\sum_{n\geq 0}a_{n}x^{n}\equiv A\left(x\right)=\frac{1}{10x^{2}-11x+1}=\frac{1}{9}\left(\frac{10}{1-10x}-\frac{1}{1-x}\right)=\\=\frac{1}{9}\sum_{n\geq 0}\Big[10\left(10x\right)^{n}-x^{n}\Big]=\sum_{n\geq0}\frac{10^{n+1}-1}{9}x^{n}$$
$$a_{n}=\frac{10^{n+1}-1}{9}$$