OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..4801
FORMULA
G.f.: 1 + Sum_{n>=1} x^(2*n-1)/(1 - Sum_{k=1..n} x^(2*k-1) ).
EXAMPLE
The a(10) = 18 such compositions are:
1: [ 1 1 1 1 1 1 1 1 1 1 ]
2: [ 3 1 1 1 1 1 1 1 ]
3: [ 3 1 1 1 1 3 ]
4: [ 3 1 1 1 3 1 ]
5: [ 3 1 1 3 1 1 ]
6: [ 3 1 3 1 1 1 ]
7: [ 3 1 3 3 ]
8: [ 3 3 1 1 1 1 ]
9: [ 3 3 1 3 ]
10: [ 3 3 3 1 ]
11: [ 5 1 1 1 1 1 ]
12: [ 5 1 1 3 ]
13: [ 5 1 3 1 ]
14: [ 5 3 1 1 ]
15: [ 5 5 ]
16: [ 7 1 1 1 ]
17: [ 7 3 ]
18: [ 9 1 ]
MAPLE
b:= proc(n, m) option remember; `if`(n=0, 1, `if`(m=0,
add(b(n-2*j+1, 2*j-1), j=1..(n+1)/2), add(
b(n-2*j+1, min(n-2*j+1, m)), j=1..(min(n, m)+1)/2)))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..45); # Alois P. Heinz, Jan 04 2024
MATHEMATICA
b[n_, m_] := b[n, m] = If[n == 0, 1, If[m == 0,
Sum[b[n - 2j + 1, 2j - 1], {j, 1, (n + 1)/2}], Sum[
b[n - 2j + 1, Min[n - 2j + 1, m]], {j, 1, (Min[n, m] + 1)/2}]]];
a[n_] := b[n, 0];
Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Mar 03 2024, after Alois P. Heinz *)
PROG
(PARI) my(N=44, x='x+O('x^N)); Vec(1+sum(n=1, N, x^(2*n-1)/(1-sum(k=1, n, x^(2*k-1)))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Joerg Arndt, Jan 04 2024
STATUS
approved