OFFSET
0,6
COMMENTS
a(n) = term (4,1) in the 4 X 4 matrix [0,1,1,1; 1,0,1,0; 0,1,0,0; 0,0,1,0]^n. There are 96 ways to define the sequence as an element of the n-th power of a 4 X 4 {0,1}-matrix. These are listed in the second Gribble link.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000 (first 50 terms from Christopher Hunt Gribble)
Christopher Hunt Gribble, Matrix elements
Index entries for linear recurrences with constant coefficients, signature (0,2,1,1).
FORMULA
G.f.: -x^3 / (x^4+x^3+2*x^2-1). - Colin Barker, Apr 20 2014
MAPLE
a:= proc(n) option remember; `if`(n<4, binomial(n, 3),
2*a(n-2) +a(n-3) +a(n-4))
end:
seq(a(n), n=0..50);
# second Maple program using the {0, 1}-matrix:
a:= n-> (<<0|1|1|1>, <1|0|1|0>, <0|1|0|0>, <0|0|1|0>>^n)[4, 1]:
seq(a(n), n=0..50); # Alois P. Heinz, Apr 26 2014
MATHEMATICA
LinearRecurrence[{0, 2, 1, 1}, {0, 0, 0, 1, 0, 2, 1, 5, 4}, 50] (* Harvey P. Dale, Jul 01 2015 *)
PROG
(PARI) concat([0, 0, 0], Vec(-x^3/(x^4+x^3+2*x^2-1) + O(x^100))) \\ Colin Barker, Apr 20 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Christopher Hunt Gribble, Apr 09 2014
EXTENSIONS
More terms from Colin Barker, Apr 20 2014
STATUS
approved