%I #21 Nov 20 2023 10:47:49
%S 1,1,2,4,7,15,29,57,111,218,429,841,1651,3239,6355,12473,24475,48029,
%T 94249,184946,362932,712194,1397569,2742507,5381729,10560797,20723884,
%U 40667338,79803197,156601100,307304821,603036937,1183364302,2322164658,4556879623
%N The number of compositions of n with no more than 3 consecutive identical parts (summands).
%H Alois P. Heinz, <a href="/A232394/b232394.txt">Table of n, a(n) for n = 0..1000</a>
%F 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.
%F a(n) ~ c * d^n, where d=1.962341312018097075518216734398388302205091029921968626465436021267458..., c=0.506212613637348069558928622560083229757824786467201325660889396545904... - _Vaclav Kotesovec_, May 01 2014
%e 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.
%p b:= proc(n, t, c) option remember;
%p `if`(n=0, 1, add(`if`(t<>j, b(n-j, j, 1),
%p `if`(c<3, b(n-j, j, c+1), 0)), j=1..n))
%p end:
%p a:= n-> b(n, 0, 1):
%p seq(a(n), n=0..50); # _Alois P. Heinz_, Nov 24 2013
%t Series[1/(1-Sum[(z^j+z^(2j)+z^(3j))/(1+z^j+z^(2j)+z^(3j)),{j,1,nn}]),{z,0,nn}],z]
%Y Cf. A003242, A128695, A232464.
%K nonn
%O 0,3
%A _Geoffrey Critzer_, Nov 23 2013