# Let a_n be a sequence given by: {1, 6, 15, 28, 45,66,..., f(n)}. Show that the generating function f(n) is of the form  an^2 + bn + c. Find the formula by computing the coefficients a, b, c?

Apr 9, 2018

$\therefore {P}_{n}^{6} = 2 {n}^{2} - n$

#### Explanation:

Strategy:
Take the given sequence find the difference between consecutive numbers:
${P}_{n} = \left\{1 , 6 , 15 , 28 , 45 , 66 , 91 , 120 , \cdots\right\}$
Step 1 $\Rightarrow$ Layer 1
$\left\{1 , 5 , 9 , 13 , 17 , 21 , \cdots\right\}$
Step 2 $\Rightarrow$ Layer 2 , Do it again
$\left\{4 , 4 , 4 , 4 , 4 , \cdots\right\}$
Taking the difference is in discrete math is the same as taking the derivative (i.e. slope). took two subtraction (two layers) before we reached a comstant number $4$, that means the sequence is polynomial growth.
Give that I asert that: ${P}_{n} = a {n}^{2} + b n + c$
All I have to do now find the value of $a , b \mathmr{and} c$
To solve for $a , b \mathmr{and} c$ I use the first 3 entry of the sequence setting $n = \left\{1 , 2 , 3\right\}$

$E q .1 \Rightarrow$${P}_{1} = a + b + c = 1$
$E q .2 \Rightarrow$${P}_{2} = 4 a + 2 b + c = 6$
$E q .3 \Rightarrow$${P}_{3} = 9 a + 3 b + c = 15$
$\left[\begin{matrix}1 & 1 & 1 \\ 4 & 2 & 1 \\ 9 & 3 & 1\end{matrix}\right] \times \left[\begin{matrix}a \\ b \\ c\end{matrix}\right] = \left[\begin{matrix}1 \\ 6 \\ 15\end{matrix}\right]$

Solving a, b, c using any matrix calculator on the internet:
$\left[\begin{matrix}a \\ b \\ c\end{matrix}\right] = \left[\begin{matrix}2 \\ - 1 \\ 0\end{matrix}\right]$
$\therefore {P}_{n}^{6} = 2 {n}^{2} - n$

Check: P_1^6 = 1; P_2^6 = 6; P_3^6 = 15; checks out

PS: You can also use python, I used python simply... It is cool