OFFSET
0,2
COMMENTS
a(n) is also the number of length n quaternary words with at least 7 0-digits between any other digits.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 0, 0, 0, 0, 3).
FORMULA
G.f.: 1/(x^7*(1-x-3*x^8)).
a(0)=1, a(1)=4, a(2)=7, a(3)=10, a(4)=13, a(5)=16, a(6)=19, a(7)=22, a(n)=a(n-1)+3*a(n-8). - Harvey P. Dale, Jul 22 2013
MAPLE
a := proc(k::nonnegint) local n, i, j; if k=0 then unapply (4^n, n) else unapply ((Matrix(k+1, (i, j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 3 else 0 fi)^(n+k))[1, 1], n) fi end(7): seq (a(n), n=0..60);
MATHEMATICA
LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 3}, {1, 4, 7, 10, 13, 16, 19, 22}, 50] (* Harvey P. Dale, Jul 22 2013 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alois P. Heinz, Aug 16 2008
STATUS
approved