login
a(2^x + ... + 2^z) = w(x) + ... + w(z), where x...z are distinct nonnegative integers and w = A000120.
1

%I #7 Jul 23 2019 15:54:09

%S 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,

%T 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,

%U 3,3,4,4,4,4,5,5,5,5,6,6,3,3,4,4,4,4,5

%N a(2^x + ... + 2^z) = w(x) + ... + w(z), where x...z are distinct nonnegative integers and w = A000120.

%C From _Robert Israel_, Jul 23 2019: (Start)

%C a(2*n+1)=a(2*n).

%C a(n)=1 if and only if n > 1 is in A283526. (End)

%e For example, a(6) = a(2^2 + 2^1) = w(2) + w(1) = 2.

%p Bwt:= proc(n) option remember; convert(convert(n,base,2),`+`) end proc:

%p f:= proc(n) local L,i;

%p L:= convert(n,base,2);

%p add(L[i]*Bwt(i-1),i=1..nops(L))

%p end proc:

%p map(f, [$0..100]); # _Robert Israel_, Jul 23 2019

%t bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];

%t Table[Total[Length/@bpe/@(bpe[n]-1)],{n,0,100}]

%Y Other sequences that are built by replacing 2^k in the binary representation with other numbers: A022290 (Fibonacci), A059590 (factorials), A073642, A089625 (primes), A116549, A326031.

%Y Cf. A000120, A029931, A035327, A048793, A070939, A283526, A305830, A326031, A326669, A326702.

%K nonn

%O 0,7

%A _Gus Wiseman_, Jul 22 2019