reviewed
approved
reviewed
approved
proposed
reviewed
editing
proposed
b[n_, i_] := b[n, i] = If[n == 0, {1, 0}, If[i < 0, {0, 0}, Function[p, If[p > n || p > n - p + 1, {0, 0}, Function[h, h + {0, h[[1]]}][b[n - p, i]]]][2^i] + b[n, i - 1]]];
a[n_] := b[n, Floor@Log2[n]][[2]];
Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Nov 16 2022, after Alois P. Heinz *)
approved
editing
editing
approved
Alois P. Heinz, <a href="/A343944/b343944.txt">Table of n, a(n) for n = 0..20000</a>
a(5) = 12 = 5 + 4 + 3: [1,1,1,1,1], [1,1,1,2], [1,2,2].
a(6) = 15 = 6 + 5 + 4: [1,1,1,1,1,1], [1,1,1,1,2], [1,1,2,2].
a(7) = 29 = 7+6+5+4+4+3: [1,1,1,1,1,1,1], [1,1,1,1,1,2], [1,1,1,2,2], [1,2,2,2], [1,1,1,4], [1,2,4].
a(5) = 12 = 5 + 4 + 3: [1,1,1,1,1], [1,1,1,2], [1,2,2].
a(6) = 15 = 6 + 5 + 4: [1,1,1,1,1,1], [1,1,1,1,2], [1,1,2,2].
a
Total number of parts in all partitions of n into powers of 2: p1 <= p2 <= ... <= p_k such that p_i <= 1 + Sum_{j=1..i-1} p_j.