login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A091618
Number of compositions (ordered partitions) of n such that some part is repeated consecutively 4 times and no part is repeated consecutively more than 4 times.
2
1, 0, 2, 4, 10, 22, 46, 101, 218, 466, 991, 2093, 4405, 9232, 19288, 40169, 83416, 172806, 357170, 736710, 1516714, 3117133, 6396116, 13105012, 26814264, 54795330, 111842771, 228030558, 464439943, 945029466, 1921169854, 3902239742, 7919743405, 16061152291
OFFSET
4,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, 4) -b(n, 0, 3):
seq(a(n), n=4..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, 4] - b[n, 0, 3];
Table[a[n], {n, 4, 50}] (* Jean-François Alcover, May 21 2018, after Alois P. Heinz *)
CROSSREFS
Column k=4 of A091613.
Sequence in context: A369491 A274313 A291397 * A181158 A018108 A033497
KEYWORD
nonn
AUTHOR
Christian G. Bower, Jan 23 2004
STATUS
approved