OFFSET
0,4
COMMENTS
a(n+1)/a(n) = 1.465571... like Narayana's cows sequence A000930.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,1,1).
FORMULA
G.f.: (1 - x^2 + x^3)/((1 + x)*(1 - x - x^3)).
MAPLE
a:= n-> (<<0|1|0|0>, <0|0|1|0>,
<0|0|0|1>, <1|1|1|0>>^n. <<1, 0, 0, 2>>)[1, 1]:
seq(a(n), n=0..50); # Alois P. Heinz, Oct 07 2016
MATHEMATICA
RecurrenceTable[{a[n] == a[n - 2] + a[n - 3] + a[n - 4], a[1] ==1, a[2] == a[3] == 0, a[4] == 2}, a, {n, 50}]
LinearRecurrence[{0, 1, 1, 1}, {1, 0, 0, 2}, 52]
CoefficientList[Series[(-1 + x^2 - x^3)/(-1 + x^2 + x^3 + x^4), {x, 0, 52}], x]
nxt[{a_, b_, c_, d_}]:={b, c, d, a+b+c}; NestList[nxt, {1, 0, 0, 2}, 50][[;; , 1]] (* Harvey P. Dale, Jun 10 2023 *)
PROG
(Magma) I:=[1, 0, 0, 2]; [n le 4 select I[n] else Self(n-2)+Self(n-3)+Self(n-4): n in [1..50]]; // Vincenzo Librandi, Nov 07 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nicolas Bègue, Oct 07 2016
STATUS
approved