login
Frequency of 0's in a constant bit representation of primes.
1

%I #14 Apr 07 2020 21:57:00

%S 1,4,10,23,47,100,202,403,798,1592,3171,6293,12578,24987,49796,99190,

%T 197699,394227,785804,1567419,3127966,6242519,12464093,24887586,

%U 49698098,99261034,198285886

%N Frequency of 0's in a constant bit representation of primes.

%C From Table 1, p. 2, of Kak.

%H Subhash Kak, <a href="http://arxiv.org/abs/0903.3904">Prime Reciprocal Digit Frequencies and the Euler Zeta Function</a>, Mar 23, 2009.

%e The number of 0's and 1's for all primes of with respect to different binary lengths from 2 to 27 is given in Table 1. Thus for all primes of binary length 3, we have the primes 2, 3, 5, and 7 which in the binary form are 010, 011, 101, and 111, with four 0's and 8 1's, so a(2) = 4. Likewise, for all primes of bit length 4, we count the primes 2, 3, 5, 7, 11, and 13 corresponding to the sequences 0010, 0011, 0101, 0111, 1011, 1101, which gives us ten 0's and 14 1's, so a(3) = 10.

%o (PARI) an=0; c=0;

%o f(n)={i=2^(n-1); j=2^n - 1; z=0; for(k=i,j, if(isprime(k), c++;v=binary(k);L=#v; for(m=1,L, if(v[m]==0,z++)))); return(z)};

%o an=f(2); print1(an,", "); for(n=3,28,an=an+c+f(n);print1(an,", ")) \\ _Washington Bomfim_, Jan 19 2011

%Y Cf. A000040, A004676.

%K base,easy,nonn

%O 2,2

%A _Jonathan Vos Post_, Mar 24 2009

%E a(28) from _Washington Bomfim_