Find a recurrence expression which solution have $\sin$ or $\cos$. I, I'm a computer science student of the first course. 
My teacher have told us to try to find a recurrence equation for the closed-form expression:
$$f(n) = 2^n + 3^n \cos\left(\frac{n\pi}{2}\right)   $$
and I think I need a bit of help.
At the first, I tried to do the inverse process of solve a recurrence expression,  following the rules of an example recurrence with the complex roots $1+i$ and $1-i$ but I have tried for hours and I haven't had success.
Second, I tried to find $f(0), f(1), f(2), \dots$ and find similarities and I had only realized that, for the odd numbers, $f(n)=n^2$ ; but with the evens numbers stuffs get difficult. 
Finally, I've been trying to solve some recurrences which characteristic equation have complex roots like $3i$ or $-3i$, but at last I have an expression which I can't transform on a simple sin or cos expression.
My teacher have told us about some forms of transform an expression like $\cos\bigl(\frac{n \pi}{2}\bigr) + \sin\bigl(\frac{n \pi}{2}\bigr)$ on $\sin\bigl(\frac{n \pi}{4}+\frac{\pi}{4}\bigr)$ but, when I have an only complex root, I had no idea of how to transform it on a simple cosine, so I'm unable of overcome this challenge. 
Moreover, I can't find good books or lessons about the inverse process of solve a recurrence, and even less about do it when a cosine appears... (the only examples I have on my notes are when the characteristic equation have only the roots $1+i$ and $1-i$ which are the same example that I found everywhere...)
So... if someone could help me, I would be very grateful... 
Actually, I don't ask for someone who solve the problem, but someone who can help me to find the solution. If you could recommend me some good book which could be nice to learn about this, or if you can tell me about recurrences which have cosines or tell me if it is possible to solve a recurrence with an only complex root... I'll be gratefully. 
Greetings. 

You are so close! Since $e^{\frac{n\pi}2i}=\cos\left(\frac{n\pi}2\right)+i\sin\left(\frac{n\pi}2\right)$, you need $$e^{\frac{n\pi}2i}=\left(e^{\frac{\pi}2i}\right)^n=\left(\cos\left(\frac{\pi}2\right)+i\sin\left(\frac{\pi}2\right)\right)^n=(0+i)^n=i^n$$
Thus your second term is $3^ni^n=(3i)^n$ so you need the root of the characteristic equation $r_2=3i$ and to get real answers also its complex conjugate $r_3=-3i$. Already I think you were aware of the root $r_1=2$. So your characteristic equation reads
$$(r-r_1)(r-r_2)(r-r_3)=(r-2)(r-3i)(r+3i)=(r-2)(r^2+9)=r^3-2r^2+9r-18=0$$
My reading of your question is that this is all the help you wanted. If you need more, ask for an edit.
