OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 4, 0, -3).
FORMULA
3^i-1 then 3^i.
a(n) = 4*a(n-2)-3*a(n-4); g.f.: -x*(x^2-2*x-1) / ((x-1)*(x+1)*(3*x^2-1)). - Colin Barker, Sep 13 2014
a(n) = 3^floor(n/2) -1 +(n mod 2). - Alois P. Heinz, Sep 14 2014
PROG
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; -3, 0, 4, 0]^n*[0; 1; 2; 3])[1, 1] \\ Charles R Greathouse IV, Jun 02 2026
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved
