I have two series that I wanted to expand and to have the possibility to find the nth element for it. Using Wolfram software I was able to get the patterns but in generating function form. I tried to find some information and examples on how to find a closed-form from generating function but I do not quite understand how to do this except for several simple examples.
Here's the result I get for my series:
$G_n(a_n)(z) = (-626 z^3 + 90 z^2 + 45 z + 731)/((z - 1)^2 (z^2 + z + 1))$
and
$G_n(a_n)(z) = -(3 (27 z^2 - 20 z - 87))/((z - 1)^2 (z + 1))$
Any help is appreciated, thanks in advance.