login
A277253
a(n) = a(n-2) + a(n-3) + a(n-4) for n>3, a(0)=1, a(1)=a(2)=0, a(3)=2.
2
1, 0, 0, 2, 1, 2, 3, 5, 6, 10, 14, 21, 30, 45, 65, 96, 140, 206, 301, 442, 647, 949, 1390, 2038, 2986, 4377, 6414, 9401, 13777, 20192, 29592, 43370, 63561, 93154, 136523, 200085, 293238, 429762, 629846, 923085, 1352846, 1982693, 2905777, 4258624, 6241316, 9147094, 13405717, 19647034, 28794127, 42199845
OFFSET
0,4
COMMENTS
a(n+1)/a(n) = 1.465571... like Narayana's cows sequence A000930.
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
Cf. A000930.
Sequence in context: A253026 A341145 A204994 * A309494 A132405 A057192
KEYWORD
nonn,easy
AUTHOR
Nicolas Bègue, Oct 07 2016
STATUS
approved