OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Julien Leroy, Michel Rigo, and Manon Stipulanti, Behavior of Digital Sequences Through Exotic Numeration Systems, Electronic Journal of Combinatorics 24(1) (2017), #P1.44. See Section 4.
Index entries for linear recurrences with constant coefficients, signature (3,-1,1,-2,2).
FORMULA
G.f.: (1 + x^2 - 2*x^3 + 2*x^4) / (1 - 3*x + x^2 - x^3 + 2*x^4 - 2*x^5). - Colin Barker, Mar 04 2017
MAPLE
a:=proc(n) option remember;
if n=0 then 1
elif n=1 then 3
elif n=2 then 9
elif n=3 then 23
elif n=4 then 63
else 3*a(n-1)-a(n-2)+a(n-3)-2*a(n-4)+2*a(n-5);
fi;
end;
[seq(a(n), n=0..40)];
MATHEMATICA
LinearRecurrence[{3, -1, 1, -2, 2}, {1, 3, 9, 23, 63}, 40] (* Harvey P. Dale, Jun 06 2020 *)
PROG
(PARI) Vec((1 + x^2 - 2*x^3 + 2*x^4) / (1 - 3*x + x^2 - x^3 + 2*x^4 - 2*x^5) + O(x^40)) \\ Colin Barker, Mar 04 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Mar 03 2017
STATUS
approved