This is LaTeX code:
[latex]
a_n = \frac{3^{n-2}}{2}(n^2 + 5n+ 18) - 2^{n-3}(n^2+3n+8), \quad n \in \mathbb{N}_0
[/latex]