Q:

Find a generating function for the sequence of squares: g(x) = P∞ n=0 n 2x n . Then for fun, as above evaluate your expression g(1/100) or g(1/1000) to get a fraction that contains the squares in its decimal expansion.

Accepted Solution

A:
The sequence of squares, [tex]\{n^2\}_{n\ge0}[/tex], has generating function[tex]g(x)=\displaystyle\sum_{n=0}^\infty n^2x^n[/tex]Recall that for [tex]|x|<1[/tex],[tex]f(x)=\dfrac1{1-x}=\displaystyle\sum_{n=0}^\infty x^n[/tex]Taking the derivative, we have[tex]f'(x)=\dfrac1{(1-x)^2}=\displaystyle\sum_{n=0}^\infty nx^{n-1}=\frac1x\sum_{n=0}^\infty nx^n[/tex]and taking the derivative again, we have[tex]f''(x)=\dfrac2{(1-x)^3}=\displaystyle\frac1x\sum_{n=0}^\infty n^2x^{n-1}-\frac1{x^2}\sum_{n=0}^\infty nx^n[/tex][tex]f''(x)=\dfrac2{(1-x)^3}=\displaystyle\frac1{x^2}\left(\sum_{n=0}^\infty n^2x^n-\sum_{n=0}^\infty nx^n\right)[/tex]From this we can get an expression for [tex]g(x)[/tex] in terms of the derivatives of [tex]f(x)[/tex]:[tex]f''(x)=\dfrac{g(x)-xf'(x)}{x^2}[/tex][tex]\implies g(x)=x^2f''(x)+xf'(x)[/tex][tex]\implies g(x)=\dfrac{2x^2}{(1-x)^3}+\dfrac x{(1-x)^2}[/tex][tex]\implies\boxed{g(x)=\dfrac{x^2+x}{(1-x)^3}}[/tex]Then[tex]g\left(\dfrac1{100}\right)=\dfrac{10,100}{970,299}\approx0.\underline{01}\,\underline{04}\,\underline{09}\,\underline{16}\ldots[/tex][tex]g\left(\dfrac1{1000}\right)=\dfrac{1,001,000}{997,002,999}\approx0.\underline{001}\,\underline{004}\,\underline{009}\,\underline{016}\ldots[/tex]