login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A156549 Race between primes having an odd/even number of zeros in their binary representation. 2
1, 0, 1, 0, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 4, 5, 6, 5, 6, 5, 4, 5, 6, 5, 6, 5, 4, 3, 4, 3, 4, 5, 4, 3, 4, 5, 4, 5, 6, 7, 8, 9, 10, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 20, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 23, 24, 25, 26, 25, 26, 25, 26, 27, 26, 27, 26, 25, 24, 23, 22 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,6

COMMENTS

See A066148 and A066149 for primes with an even/odd number of zeros in their binary representation. Sequence A130911 shows the race between primes having an odd/even number of ones in their binary representation. In this sequence (and A130911), it appears that the primes with an odd number of zeros (or ones) dominate the primes with an even number of zeros (or ones). In general, it appears that the sequences grow for primes having an odd number of bits and "rest" for primes having an even number of bits.

LINKS

T. D. Noe, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = (number primes having an odd number of zeros <= prime(n)) - (number of primes having an even number of zeros <= prime(n))

MATHEMATICA

cnt=0; Table[p=Prime[n]; If[OddQ[Count[IntegerDigits[p, 2], 0]], cnt++, cnt-- ]; cnt, {n, 100}]

PROG

(PARI) f(p)={v=binary(p); s=0; for(k=1, #v, if(v[k]==0, s++)); return(s%2)}; nO=0; nE=0; forprime(p=2, 435, if(f(p), nO++, nE++); an = nO-nE; print1(an, ", ")) \\ Washington Bomfim, Jan 14 2011

CROSSREFS

Sequence in context: A256993 A173523 A199323 * A275868 A100795 A045781

Adjacent sequences:  A156546 A156547 A156548 * A156550 A156551 A156552

KEYWORD

nonn,base

AUTHOR

T. D. Noe, Feb 09 2009

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 22 17:25 EDT 2019. Contains 321422 sequences. (Running on oeis4.)