OFFSET
0,2
COMMENTS
|a(n)| equals the number of n-length ternary words avoiding runs of zeros of lengths 3i+2, (i=0,1,2,...). - Milan Janjic, Feb 26 2015
LINKS
Index entries for linear recurrences with constant coefficients, signature (-2,2,-1).
FORMULA
a(n) = -2*a(n-1)+2*a(n-2)-a(n-3), a(0)=1, a(1)=-3, a(2)=8.
a(n) = sum(m=1..n, sum(k=m..n, (sum(j=0..m, binomial(j,-3*m+k+2*j) *2^(-3*m+k+2*j)*(-1)^(j-m)*(-3)^(3*m-k-j)*binomial(m,j))) *binomial(n+m-k-1,m-1))), n>0, a(0)=1. - Vladimir Kruchinin, May 06 2011
MATHEMATICA
a[n_] := a[n] = -2 a[n - 1] + 2 a[n - 2] - a[n - 3]; a[0] = 1; a[1] = -3; a[2] = 8; Table[Simplify[a[n]], {n, 0, 20}] (* Rigoberto Florez, Mar 22 2020 *)
PROG
(Maxima)
a(n):=sum(sum((sum(binomial(j, -3*m+k+2*j)*2^(-3*m+k+2*j)*(-1)^(j-m)*(-3)^(3*m-k-j)*binomial(m, j), j, 0, m))*binomial(n+m-k-1, m-1), k, m, n), m, 1, n); /* Vladimir Kruchinin, May 06 2011 */
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved