OFFSET
0,1
COMMENTS
LINKS
Clark Kimberling, Table of n, a(n) for n = 0..2000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,1).
FORMULA
G.f.: (2 - x - x^2 - x^3)/(1 - x - x^3 - x^4).
a(n) = (2/5) * A000045(n) + (4/5) * A000045(n-1) + (6/5) * A056594(n) + (3/5) * A056594(n-1) for n >= 1. - Robert Israel, Apr 03 2019
MAPLE
f:= gfun:-rectoproc(a(n) = a(n-1) + a(n-3) + a(n-4), a(0) = 2, a(1) = 1, a(2) = 0, a(3) = 1}, a(n), remember):
map(f, [$0..100]); # Robert Israel, Apr 03 2019
MATHEMATICA
LinearRecurrence[{1, 0, 1, 1}, {2, 1, 0, 1}, 45]
PROG
(PARI) my(x='x+O('x^45)); Vec((-2 + x + x^2 + x^3)/(-1 + x + x^3 + x^4)) \\ Georg Fischer, Apr 03 2019
(Magma) I:=[2, 1, 0, 1]; [n le 4 select I[n] else Self(n-1) +Self(n-3) +Self(n-4): n in [1..45]]; // G. C. Greubel, Apr 03 2019
(Sage) ((2-x-x^2-x^3)/(1-x-x^3-x^4)).series(x, 45).coefficients(x, sparse=False) # G. C. Greubel, Apr 03 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Nov 29 2017
EXTENSIONS
a(0) = 2 amended by Georg Fischer, Apr 03 2019
STATUS
approved