OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
The g.f. for the number of compositions of n with no more than m consecutive identical parts is 1/( 1 - sum_{j>=1} x^j*(1 - x^(j*m))/(1 - x^j)/ (1 + x^j*(1 - x^(j*m))/(1 - x^j)) ); set m = 3 for this sequence.
a(n) ~ c * d^n, where d=1.962341312018097075518216734398388302205091029921968626465436021267458..., c=0.506212613637348069558928622560083229757824786467201325660889396545904... - Vaclav Kotesovec, May 01 2014
EXAMPLE
a(6) = 29 because there are 32 compositions of 6 but we exclude: 1+1+1+1+1+1, 1+1+1+1+2, 2+1+1+1+1.
MAPLE
b:= proc(n, t, c) option remember;
`if`(n=0, 1, add(`if`(t<>j, b(n-j, j, 1),
`if`(c<3, b(n-j, j, c+1), 0)), j=1..n))
end:
a:= n-> b(n, 0, 1):
seq(a(n), n=0..50); # Alois P. Heinz, Nov 24 2013
MATHEMATICA
Series[1/(1-Sum[(z^j+z^(2j)+z^(3j))/(1+z^j+z^(2j)+z^(3j)), {j, 1, nn}]), {z, 0, nn}], z]
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Nov 23 2013
STATUS
approved