login
Binary weight of terms of A005187: a(n) = A000120(A005187(n)).
6

%I #17 Apr 30 2021 16:29:35

%S 0,1,2,1,3,1,2,3,4,1,2,3,3,4,3,3,5,1,2,3,3,4,3,3,4,5,3,3,4,4,3,4,6,1,

%T 2,3,3,4,3,3,4,5,3,3,4,4,3,4,5,6,3,3,4,4,3,4,5,5,3,4,4,5,6,4,7,1,2,3,

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

%N Binary weight of terms of A005187: a(n) = A000120(A005187(n)).

%H Antti Karttunen, <a href="/A280700/b280700.txt">Table of n, a(n) for n = 0..8191</a>

%F a(n) = A000120(A005187(n)).

%F a(n) = A001221(A283475(n)) = A001222(A283475(n)))) = A001222(A280705(n)).

%t Table[DigitCount[2 n - DigitCount[2 n, 2, 1], 2, 1], {n, 0, 120}] (* _Michael De Vlieger_, Mar 18 2017 *)

%o (Scheme) (define (A280700 n) (A000120 (A005187 n)))

%o (PARI)

%o b(n) = if(n<1, 0, b(n\2) + n%2);

%o for(n=0, 150, print1(b(2*n - b(2*n)), ", ")) \\ _Indranil Ghosh_, Mar 21 2017

%o (Python)

%o def A(n): return bin(2*n - bin(2*n)[2:].count("1"))[2:].count("1")

%o print([A(n) for n in range(151)]) # _Indranil Ghosh_, Mar 21 2017

%Y Cf. A000120, A001221, A001222, A005187, A279357, A280705, A283475.

%K nonn

%O 0,3

%A _Antti Karttunen_, Mar 16 2017