%I #20 Feb 26 2024 10:43:35
%S 1,1,2,2,3,4,7,9,10,11,11,14,17,19,20,22,23,24,28,31,35,37,40,43,47,
%T 50,52,54,56,59,59,64,69,73,77,80,83,87,90,93,96,99,100,105,109,112,
%U 115,116,119,122,125,126,129,130,137,142,147,151,156,161,165,170
%N Total number of 0's in the binary expansions of the first n primes.
%H Alois P. Heinz, <a href="/A345867/b345867.txt">Table of n, a(n) for n = 1..20000</a>
%F a(n) = Sum_{i=1..n} A035103(i).
%F a(n) = a(n-1) for n in { A059305 }.
%F a(n) = A328659(n) - A095375(n).
%e a(3) = 2: 2 = 10_2, 3 = 11_2, 5 = 101_2, so there are two 0's in the binary expansions of the first three primes.
%p a:= proc(n) option remember; `if`(n=0, 0, a(n-1)
%p +add(1-i, i=Bits[Split](ithprime(n))))
%p end:
%p seq(a(n), n=1..100);
%t Accumulate[DigitCount[Prime[Range[100]], 2, 0]] (* _Paolo Xausa_, Feb 26 2024 *)
%o (Python)
%o from sympy import prime, primerange
%o from itertools import accumulate
%o def f(n): return (bin(n)[2:]).count('0')
%o def aupton(nn): return list(accumulate(map(f, primerange(2, prime(nn)+1))))
%o print(aupton(62)) # _Michael S. Branicky_, Jun 26 2021
%Y Partial sums of A035103.
%Y Cf. A000040, A059305, A095375, A328659.
%K nonn,base
%O 1,3
%A _Alois P. Heinz_, Jun 26 2021