login
A078054
Expansion of (1-x)/(1+2*x-2*x^2+x^3).
3
1, -3, 8, -23, 65, -184, 521, -1475, 4176, -11823, 33473, -94768, 268305, -759619, 2150616, -6088775, 17238401, -48804968, 138175513, -391199363, 1107554720, -3135683679, 8877676161, -25134274400, 71159584801, -201465394563, 570384233128, -1614858840183, 4571951541185
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
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
Cf. A077983 (partial sums).
Sequence in context: A305561 A014398 A176880 * A018043 A291037 A147704
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved