cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A158671 #22 May 20 2025 08:53:37
%S A158671 1,4,10,23,47,100,202,403,798,1592,3171,6293,12578,24987,49796,99190,
%T A158671 197699,394227,785804,1567419,3127966,6242519,12464093,24887586,
%U A158671 49698098,99261034,198285886
%N A158671 Frequency of 0's in a constant bit representation of primes.
%C A158671 From Table 1, p. 2, of Kak.
%H A158671 Subhash Kak, <a href="http://arxiv.org/abs/0903.3904">Prime Reciprocal Digit Frequencies and the Euler Zeta Function</a>, arXiv:0903.3904 [math.GM], 2009.
%e A158671 The number of 0's and 1's for all primes 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 A158671 (PARI) an=0; c=0;
%o A158671 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 A158671 an=f(2); print1(an,", "); for(n=3,28,an=an+c+f(n);print1(an,", ")) \\ _Washington Bomfim_, Jan 19 2011
%Y A158671 Cf. A000040, A004676, A036378.
%K A158671 nonn,base,more
%O A158671 2,2
%A A158671 _Jonathan Vos Post_, Mar 24 2009
%E A158671 a(28) from _Washington Bomfim_, Jan 19 2011