A224960 Number of compositions [p(1), p(2), ..., p(k)] of n such that p(j) >= p(1) - 1.
1, 1, 2, 4, 7, 14, 26, 52, 101, 200, 396, 787, 1564, 3117, 6214, 12398, 24749, 49427, 98740, 197303, 394323, 788201, 1575695, 3150265, 6298732, 12594595, 25184598, 50361842, 100711888, 201404839, 402779246, 805509560, 1610940381, 3221753990
Offset: 0
Keywords
Examples
The a(5) = 14 such compositions of 5 are 01: [ 1 1 1 1 1 ] 02: [ 1 1 1 2 ] 03: [ 1 1 2 1 ] 04: [ 1 1 3 ] 05: [ 1 2 1 1 ] 06: [ 1 2 2 ] 07: [ 1 3 1 ] 08: [ 1 4 ] 09: [ 2 1 1 1 ] 10: [ 2 1 2 ] 11: [ 2 2 1 ] 12: [ 2 3 ] 13: [ 3 2 ] 14: [ 5 ] (the two forbidden compositions are [ 3 1 1 ] and [ 4 1 ]).
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
Maple
b:= proc(n, i) option remember; `if`(n=0, 1, add(b(n-j, `if`(i=0, max(1, j-1), i)), j=`if`(i=0, 1, i)..n)) end: a:= n-> b(n, 0): seq(a(n), n=0..50); # Alois P. Heinz, May 02 2013
-
Mathematica
b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n - j, If[i == 0, Max[1, j - 1], i]], {j, If[i == 0, 1, i], n}]]; a[n_] := b[n, 0]; a /@ Range[0, 50] (* Jean-François Alcover, Dec 20 2020, after Alois P. Heinz *)
Formula
a(n) ~ 3 * 2^(n-3). - Vaclav Kotesovec, May 01 2014