OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) ~ 3 * 2^(n-3). - Vaclav Kotesovec, May 01 2014
EXAMPLE
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 ]).
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt, Apr 21 2013
STATUS
approved