login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Total number of binary digits in the partitions of n into odd parts.
2

%I #15 Dec 12 2020 14:17:38

%S 1,2,5,7,12,19,26,36,52,71,92,124,158,204,265,331,413,522,641,791,976,

%T 1184,1435,1741,2093,2506,3005,3574,4237,5030,5928,6971,8202,9593,

%U 11212,13087,15210,17653,20472,23665,27308,31488,36205,41570,47701,54584,62387

%N Total number of binary digits in the partitions of n into odd parts.

%H Alois P. Heinz, <a href="/A319142/b319142.txt">Table of n, a(n) for n = 1..10000</a>

%p h:= proc(n) option remember; 1+ilog2(n) end:

%p b:= proc(n, i) option remember; `if`(n=0, [1, 0],

%p `if`(i<1, 0, b(n, i-1-irem(i, 2))+`if`(i::even

%p or i>n, 0, (p-> p+[0, p[1]*h(i)])(b(n-i, i)))))

%p end:

%p a:= n-> b(n$2)[2]:

%p seq(a(n), n=1..60); # _Alois P. Heinz_, Sep 27 2018

%t h[n_] := h[n] = 1 + Floor@Log[2, n];

%t b[n_, i_] := b[n, i] = If[n==0, {1, 0}, If[i<1, 0, b[n, i-1-Mod[i, 2]] + If[EvenQ[i] || i>n, 0, Function[p, p + {0, p[[1]] h[i]}][b[n - i, i]]]]];

%t a[n_] := b[n, n][[2]];

%t Array[a, 60] (* _Jean-François Alcover_, Dec 12 2020, after _Alois P. Heinz_ *)

%Y Cf. A000009, A070939.

%K nonn

%O 1,2

%A _David S. Newman_, Sep 11 2018