# Thread: What is the pattern in these numbers

1. ## What is the pattern in these numbers

1, 2, 7, 20, 61, 182

2. ## Re: What is the pattern in these numbers

Hey parmis.

You should note that you can fit infinitely many patterns to this series that will retain the existing numbers but given completely different numbers for those past the last number in the series.

Anyway try x(n) = 3*x(n-1) + (-1)^n

3. ## Re: What is the pattern in these numbers

Additionally, we can always fit an n-1 dimensional to any n points. Here, there are six values so there exist a unique fifth degree polynomial f(x) such that f(1)= 1, f(2)= 2, f(3)= 7, f(4)= 20, f(5)= 61, f(6)= 182.

One way of finding that is to write $\displaystyle f(x)= ax^5+ bx^4+ cx^3+ dx^2+ ex+ f$. Then a+ b+ c+ d+ e+ f= 1, 32a+ 16b+ 8c+ 4d+ 2e+ f= 2, 243a+ 81b+ 27c+ 9d+ 3e+ f= 7, etc.

Another is to use "Leibniz's formula: $\displaystyle (1)\frac{(x- 2)(x- 3)(x- 4)(x- 5)(x- 6)}{(1-2)(1-3)(1-4)(1-5)(1-6)}+ 2\frac{(x- 1)(x- 3)(x- 4)(x- 5)(x- 6)}{(2-1)(2-3)(2-4)(2-5)(26)}+ 7\frac{(x- 1(x- 2)(x- 4)(x- 5)(x- 6)}{(3-1)(3-2)(3-4)(3-5)(3-6)}+ 20\frac{(x- 1)(x- 2)(x- 3)(x- 5)(x- 6)}{(4-1)(4-2)(4-3)(4-5)(4-6)}+ 61\frac{(x- 1)(x- 2(x- 3(x- 4)(x- 6)}{(5-1)(5-2)(5- 3)(5-4)(5-6)}+ 182\frac{(x- 1)(x- 2)(x- 3)(x- 4)(x- 5)}{(6-1)(6-2)(6-3)(6-4)(6-5)}$.

You can get the same polynomial with "Newton's difference formula".
The values are 1, 2, 7, 20, 61, 182. The "first differences" are 2-1= 1, 7- 2= 5, 20- 7= 13, 61- 20= 41, 182- 61= 121. The "second differences" are 5-1= 4, 13- 5= 8, 41- 13= 28, 121- 41= 80. The "third differences are 8- 4= 4, 28- 8= 20, 80- 28= 52. The "fourth differences" are 20- 4= 16, 52- 20= 32. The "fifth difference" is 32- 16= 16. We can then write the polynomial 1+ 1(n-1)+ 4(n-1)(n-2)+ 4(n-1)(n-2)(n-3)+ 16(n-1)(n-2)(n-3)(n-4)+ 16(n-1)(n-2)(n-3)(n-4)(n-5).

(Did you understand Chiro's answer? He is not saying that x(n) is equal to 3 times n-1 + (-1)^n. He is saying that each term, x(n), is equal to 3 times the previous value, x(n-1). He gave you a recursive formula, not a direct formula for the value of x(n).)

4. ## Re: What is the pattern in these numbers

Hello, parmis!

Chiro found a recurrence relation . . . Impressive!
Using his result, I found a closed formula.

What is the pattern? .$\displaystyle 1, 2, 7, 20, 61. 182$

$\displaystyle \begin{array}{ccccc}\text{He found:} & a_n &=& 3a_{n-1} + (\text{-}1)^n & [1] \\ \text{Then:} &a_{n+2} &=& 3a_{n+1} + (\text{-}1)^{n+2} & [2] \end{array}$

$\displaystyle \text{Subtract [2] - [1]: }\:a_{n+2} - a_n \;=\;3a_{n+1} - 3a_{n-1}$

$\displaystyle \text{We have: }\:a_{n+2} - 3a_{n+1} - a_n + 3a_{n-1} \;=\;0$

$\displaystyle \text{Let }X^n = a_n\!:\;X^{n+2} - 3X^{n+1} - X^n + 3X^{n-1} \;=\;0$

$\displaystyle \text{Factor: }\;X^{n+1}(X-3) - X^n(X-3) \;=\;0$

$\displaystyle \text{Factor: }\;(X-3)(X^{n+1} - X^{n-1}) \;=\;0$

$\displaystyle \text{Factor: }\;X^{n-1}(X-3)(X^2-1) \;=\;0$

$\displaystyle \text{We have: }\;\begin{Bmatrix}X^{n-1}&=& 0 && \Rightarrow && X &=& 0 \\ X-3 &=& 0 && \Rightarrow && X &=& 3 \\ X^2-1&=&0 && \Rightarrow && X &=& \pm1 \end{Bmatrix}$

$\displaystyle \text{Then: }\;f(n) \;=\;A\!\cdot\!3^n + B\!\cdot\!1^n + C(\text{-}1)^n$

$\displaystyle \begin{array}{ccccccc}f(1) =1: & 3A + B - C &=& 1 \\ f(2) = 2: & 9A + B + C &=& 2 \\ f(3) = 7: & 27A + B - C &=& 7 \end{array}$

$\displaystyle \text{Solve the system: }\;\begin{Bmatrix}A &=& \frac{1}{4} \\ B &=& 0 \\ C &=& \text{-}\frac{1}{4}\end{Bmatrix}$

$\displaystyle \text{Therefore: }\;f(n) \;=\;\tfrac{1}{4}\big[3^n - (\text{-}1)^n\big]$