login
A091617
Number of compositions (ordered partitions) of n such that some part is repeated consecutively 3 times and no part is repeated consecutively more than 3 times.
2
1, 0, 2, 5, 11, 22, 48, 105, 223, 468, 979, 2037, 4224, 8710, 17906, 36693, 74973, 152795, 310669, 630353, 1276544, 2580614, 5208522, 10496954, 21126102, 42464498, 85255651, 170980512, 342553389, 685641724, 1371134291, 2739685107, 5469923466, 10912945300
OFFSET
3,3
LINKS
MAPLE
b:= proc(n, l, k) option remember; `if`(n=0, 1, add(`if`(
i=l, 0, add(b(n-i*j, i, k), j=1..min(k, n/i))), i=1..n))
end:
a:= n-> b(n, 0, 3) -b(n, 0, 2):
seq(a(n), n=3..50); # Alois P. Heinz, Feb 08 2017
MATHEMATICA
b[n_, l_, k_] := b[n, l, k] = If[n == 0, 1, Sum[If[i == l, 0, Sum[b[n - i*j, i, k], {j, 1, Min[k, n/i]}]], {i, 1, n}]];
a[n_] := b[n, 0, 3] - b[n, 0, 2];
Table[a[n], {n, 3, 50}] (* Jean-François Alcover, May 21 2018, after Alois P. Heinz *)
CROSSREFS
Column k=3 of A091613.
Sequence in context: A044432 A033120 A365243 * A205880 A009293 A180337
KEYWORD
nonn
AUTHOR
Christian G. Bower, Jan 23 2004
STATUS
approved