OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
EXAMPLE
a(2) = 2: [1,1,1,1], [1,1,2].
a(3) = 3: [1,1,1,1,1,1], [1,1,1,1,2], [1,1,2,2].
a(4) = 6: [1,1,1,1,1,1,1,1], [1,1,1,1,1,1,2], [1,1,1,1,2,2], [1,1,2,2,2], [1,1,1,1,4], [1,1,2,4].
MAPLE
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<0, 0, (p->
`if`(p>n or p>n-p+1, 0, b(n-p, i)))(2^i)+b(n, i-1)))
end:
a:= n-> b(2*n, ilog2(n)+1):
seq(a(n), n=0..80);
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 0, 0, Function[p, If[p > n || p > n - p + 1, 0, b[n - p, i]]][2^i] + b[n, i - 1]]];
a[n_] := b[2n, BitLength[n] + 1];
Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Feb 13 2023, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 30 2021
STATUS
approved