Solution for a recurrence relation [closed]

I want to find the solution of the recurrence relation $$a_n =a_{n–1} +2a_{n–2} \text{ with } a_0 =2 \text{ and } a_1 =7$$

thanks for any help.

-
what have you tried? –  Prahlad Vaidyanathan Sep 24 at 8:12
maybe $a_n=a_{n-1}+2a_{n-2}$ –  Adi Dani Sep 24 at 8:19
@experimentX, Adi Dani: ya its a_n =a_{n–1} +2a_{n–2} –  steve Sep 24 at 8:21
@steve know of characteristics equations? –  experimentX Sep 24 at 8:22
@steve: Look at my answer here: math.stackexchange.com/questions/154667/… –  Dennis Gulko Sep 24 at 8:59
show 1 more comment

closed as off-topic by azimut, mau, Matt Pressland, Peter Taylor, Daniel RustSep 24 at 9:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – azimut, mau, Matt Pressland
If this question can be reworded to fit the rules in the help center, please edit the question.

If the recurrence equation is: $$a_n=a_{n-1}+2a_{n-2}$$ the solution is: $$a_n=c_1(-1)^n+c_22^n$$ So, with your initial conditions you have: $c_1=-1,c_2=3$
$a_n=a\lambda_1^n+b\lambda_2^n$, where $\lambda_1,\lambda_2$ are solutions of equation $\lambda^2=\lambda+2$. From the relations for $a_0$, $a_1$ we can find constants $a,b$: $$a_0=2=a+b,$$ $$a_1=7=2a-b,$$ from where is $a_n=3*2^n-(-1)^n$.