# Thread: Introducing myself + recurrence problem

1. ## Introducing myself + recurrence problem

Hi. I'm Paul from Romania. I joined this forum because i wanted to share my knowledge and learn from you all.

I have a small problem.
Is there any particular formula to find the general term of a recurrence relation?
I must find it for this one:

a1=1
a2=5
an+2=an+1 + 2an
--------------------
an=?

2. ## Re: Introducing myself + recurrence problem

See Wikipedia.

3. ## Re: Introducing myself + recurrence problem

Hello, Paul!

Welcome aboard!
Here is a rather primitive method for this problem.

$a_1\,=\,1\quad a_2 \,=\,5\quad a_{n+2}\:=\:a_{n+1} + 2a_n$

$\text{Find }a_n.$

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

We conjecture that: . $X^n \,=\,a_n$
. . (The general term is exponential in nature.)

Then we have: . $X^{n+2} - X^{n+1} - 2X^n \;=\;0$

Divide by $X^n\!:\;\;X^2 - X - 2 \:=\:0 \quad\Rightarrow\quad (X+1)(X-2) \:=\:0$

Hence: . $X \:=\:\text{-}1,\,2$

The function seems to be: . $f(n) = (\text{-}1)^n\,\text{ or }\,f(n) = 2^n$

Assume that $f(n)$ is a linear combination of these two functions.
. . That is: . $f(n) \;=\;A(\text{-}1)^n + B(2^n)$

We know the first two terms of the sequence:

. . $\begin{array}{cccccccc}f(1) = 1\!: & \text{-}A + 2B &=& 1 & [1] \\ f(2) = 5\!: & A + 4B &=& 5 & [2]\end{array}$

Add [1] and [2]: . $6B \,=\,6 \quad\Rightarrow\quad B \,=\,1$

Substitute into [1]: . $\text{-}A + 2(1) \:=\:1 \quad\Rightarrow\quad A \,=\,1$

Therefore: . $f(n) \;=\;(\text{-}1)^n + 2^n$