login
Number of 0's in binary representation of n-th prime.
32

%I #21 Mar 03 2023 16:34:35

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

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

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

%N Number of 0's in binary representation of n-th prime.

%H Reinhard Zumkeller, <a href="/A035103/b035103.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A035100(n) - A014499(n). - _M. F. Hasler_, Nov 21 2009

%F a(n) = 0 for n in { A059305 }. - _Alois P. Heinz_, Jun 26 2021

%t Table[ Count[ IntegerDigits[ Prime[ n ], 2 ], 0 ], {n, 120} ]

%t Table[DigitCount[p,2,0],{p,Prime[Range[120]]}] (* _Harvey P. Dale_, Mar 03 2023 *)

%o (PARI) A035103(n) = #(n=binary(prime(n)))-norml2(n) \\ _M. F. Hasler_, Nov 21 2009

%o (Haskell)

%o a035103 = a023416 . a000040 -- _Reinhard Zumkeller_, Feb 19 2013

%Y Cf. A014499, A035100.

%Y Cf. A023416, A000040.

%Y Cf. A059305.

%K nonn,base,easy

%O 1,7

%A _N. J. A. Sloane_

%E More terms from _Erich Friedman_