A326032 a(2^x + ... + 2^z) = w(x) + ... + w(z), where x...z are distinct nonnegative integers and w = A000120.
0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 3, 3, 4, 4, 4, 4, 5
Offset: 0
Keywords
Examples
For example, a(6) = a(2^2 + 2^1) = w(2) + w(1) = 2.
Crossrefs
Programs
-
Maple
Bwt:= proc(n) option remember; convert(convert(n,base,2),`+`) end proc: f:= proc(n) local L,i; L:= convert(n,base,2); add(L[i]*Bwt(i-1),i=1..nops(L)) end proc: map(f, [$0..100]); # Robert Israel, Jul 23 2019
-
Mathematica
bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1]; Table[Total[Length/@bpe/@(bpe[n]-1)],{n,0,100}]
Comments