# Thread: Formula to reflect sequence of numbers

1. ## Formula to reflect sequence of numbers

 Is there a formula to reflect this sequence of numbers so that, for instance I could show the calculations for 8^3 without having to do the preceding calculations? 1^3=1 1+(6x0)=1+0=1 2^3=8 1+(6x1)=7+1=8 3^3=27 7+(6x2)=19+8=27 4^3=64 19+(6x3)=37+27=64 5^3=125 37+(6x4)=61+64=125

2. ## Re: Formula to reflect sequence of numbers

Originally Posted by tridoddytri
 Is there a formula to reflect this sequence of numbers so that, for instance I could show the calculations for 8^3 without having to do the preceding calculations?
$(N+1)^3=N^3+3N^2+3N+1=N^3+3N(N+1)+1$

$\mathcal{a}_{1}=1$, if $N\ge 1~~\mathcal{a}_{N+1}=N^3+3N(N+1)+1$

3. ## Re: Formula to reflect sequence of numbers

Isn't $\displaystyle 8 \times 8 \times 8$ easier to calculate?

We could try to formalise your method. We seem to have two sequences $\displaystyle \{a_n\}$ the result of the first part of the calculation and $\displaystyle \{b_n\}$ for which $\displaystyle b_n = n^3$, but we won't use this fact.

Your calculation appears to be as follows:
$\displaystyle a_{n+1} = a_{n} + 6n \qquad b_n = a_n + b_{n-1}$
$\displaystyle a_0=1 \qquad b_0 = 0$

The first equation is easily solved
\displaystyle \begin{aligned} a_{n+1} - a_{n} = 6n \implies a_{n+2} - a_{n+1} &= 6(n+1) = 6n + 6 \\ a_{n+2} - a_{n+1} &= a_{n+1} - a{n} + 6 \\ a_{n+2} - 2a_{n+1} + a_{n} &= 6 \\ \implies a_{n+3} - 2a_{n+2} + a_{n+1} &= 6 \\ \text{and so} \quad a_{n+3} - 2a_{n+2} + a_{n+1} &= a_{n+2} - 2a_{n+1} + a_{n} \\ \text{and finally} \quad a_{n+3} - 3a_{n+2} + 3a_{n+1} - a_n &= 0 \end{aligned}

This has characteristic equation $\displaystyle (r-1)^3 = 0$ so our solution will be
$\displaystyle a_n = (An^2 + Bn + C)1^n = An^2 + Bn + C$

We know that $\displaystyle a_0 = 1$, $\displaystyle a_1 = 1$ and $\displaystyle a_2 = 7$ so we deduce that $\displaystyle C=1$, $\displaystyle A+B+1=1$ and $\displaystyle 4A + 2B +1 = 7$ which result in $\displaystyle A = 3$ and $\displaystyle B = -3$.

Thus we have
$\displaystyle a_n = 3n^2 - 3n + 1$

We can now put this into our equation for $\displaystyle b_{n+1}$ getting (after a bit of rearranging)
$\displaystyle b_{n+1} - b_n = 3n^2 - 3n + 1$

We can solve this using the same method.
\displaystyle \begin{aligned} b_{n+2} - b_{n+1} &= 3(n+1)^2 - 3(n+1) + 1 = 3n^2 + 3n + 1 \\ b_{n+2} - 2b_{n+1} +b_n &= 6n \\ \implies b_{n+3} - 2b_{n+2} +b_{n+1} &= 6(n+1) + 1 = 6n + 1 \\ b_{n+3} - 3b_{n+2} + 3b_{n+1} - b_{n} = 1 \\ \implies b_{n+4} - 3b_{n+3} + 3b_{n+2} - b_{n+1} &= 1 \\ \text{and so} \quad b_{n+4} - 4b_{n+3} + 6b_{n+2} - 4b_{n+1} + b_{n} &= 0\end{aligned}
And the characteristic equation $\displaystyle (r-1)^4 = 0$ gives us a solution $\displaystyle b_n = (pn^3 + qn^2 + rn + s)1^n = pn^3 + qn^2 + rn + s$. But we know that $\displaystyle b_0 = 0$, $\displaystyle b_1 = 1$, $\displaystyle b_2 = 8$, $\displaystyle b_3 = 27$ which results in $\displaystyle q=r=s=0$ and $\displaystyle p=1$. And thus
$\displaystyle b_n = n^3$
Are you surprised?

4. ## Re: Formula to reflect sequence of numbers

Let's use n^3

You apparently want to see a "breakdown" of the calculation...

Li'l computer program:
...........................................
INPUT n [n = 5]

a = 3(n^2 - 3n + 2) + 1
b = 6(n - 1)
c = (n - 1)^3

PRINT a, b, c, a+b+c
...........................................

OUTPUT:
37, 24, 64, 125 : that's what you show for 5^3

If n = 8:
127, 42, 343, 512

Kinda silly, if you ask me...