# What is the formula for the sequence 4,2,3,4,3,2,... ?

Nov 5, 2016

${a}_{n} = \frac{1}{120} \left(3 {n}^{5} - 40 {n}^{4} + 145 {n}^{3} + 40 {n}^{2} - 868 n + 1200\right)$

#### Explanation:

If you want a formula for a sequence with these as the first six terms then you can proceed as follows:

Write down the original sequence:

$\textcolor{b l u e}{4} , 2 , 3 , 4 , 3 , 2$

Write down a sequence formed by the differences of pairs of consecutive terms:

$\textcolor{b l u e}{- 2} , 1 , 1 , - 1 , - 1$

Write down a sequence formed by the differences of pairs of consecutive terms of that sequence:

$\textcolor{b l u e}{3} , 0 , - 2 , 0$

Write down the sequence of differences of that sequence:

$\textcolor{b l u e}{- 3} , - 2 , 2$

Write down the sequence of differences of that sequence:

$\textcolor{b l u e}{1} , 4$

Write down the sequence of differences of that sequence:

$\textcolor{b l u e}{3}$

We can then use the initial terms of these sequences as the coefficients of a formula for the $n$th term:

a_n = color(blue)(4)/(0!) + color(blue)(-2)/(1!)(n-1) + color(blue)(3)/(2!)(n-1)(n-2) + color(blue)(-3)/(3!)(n-1)(n-2)(n-3) + color(blue)(1)/(4!)(n-1)(n-2)(n-3)(n-4) + color(blue)(3)/(5!)(n-1)(n-2)(n-3)(n-4)(n-5)

$\textcolor{w h i t e}{{a}_{n}} = \frac{1}{120} \left(3 {n}^{5} - 40 {n}^{4} + 145 {n}^{3} + 40 {n}^{2} - 868 n + 1200\right)$

$\textcolor{w h i t e}{}$
Footnote

Note carefully that I said a formula. A finite sequence does not determine a unique formula. The above formula is the simplest polynomial function that matches the given values.