OFFSET
0,3
LINKS
FORMULA
a(n) = a(n-1) + 3a(n-2) - a(n-3) for n>3.
G.f.: (1-2x^2+x^3)/(1-x-3x^2+x^3).
G.f.: A052973(x)/(1+x-x^2).
MATHEMATICA
CoefficientList[Series[(1-2x^2+x^3)/(1-x-3x^2+x^3), {x, 0, 40}], x] (* or *) LinearRecurrence[{1, 3, -1}, {1, 1, 2, 5}, 40] (* Harvey P. Dale, Dec 06 2015 *)
PROG
(PARI) {a(n) = if(n<=1, 1, ( sum(k=0, n-1, a(k))^2 - sum(k=0, n-1, a(k)^2) )/a(n-1))}
for(n=0, 40, print1(a(n), ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Sep 15 2003
STATUS
approved