# Parity of primes [duplicate]

While working on a completely different (combinatorial) problem, I ran a simple program to calculate the parity of the first ~50000 primes (number of 1s in their binary representation modulo 2). The following graph summarizes the result:

The number of primes having even parity seems to grow slower.

Is there a math explanation ?

I looked to the correspoding OEIS entry, but it doesn't provide any detail.

## marked as duplicate by Felipe Voloch, Stefan Kohl, Boris Bukh, Peter Arndt, SuvritOct 22 '14 at 22:28

• What does "parity" mean? The parity of the number of ones in the binary representation? If so, please say it. If not, please say it. – Igor Rivin Oct 22 '14 at 18:46
• @IgorRivin: sorry, question edited (I had only one non-trivial definition of parity of a number in my mind :-) – Marzio De Biasi Oct 22 '14 at 18:54
• It's right there on the right hand side under "Related". mathoverflow.net/questions/44561/odd-bit-primes-ratio – Felipe Voloch Oct 22 '14 at 18:57
• @FelipeVoloch: thanks, I didn't notice it while typing the question (or perhaps it wasn' there) :-S ... a.k.a. the Thue-Morse numbers ... – Marzio De Biasi Oct 22 '14 at 19:00
• A version of this question was earlier explored in "Odd-bit primes ratio." – Joseph O'Rourke Oct 22 '14 at 19:36

• OK, so, asymptotically they are the same, but that doesn't rule out the possibility that odd parity up to $N$ exceeds even for all $N$. It doesn't even exclude the possibility that the difference goes to infinity. Do the published results speak to these more delicate questions? – Gerry Myerson Oct 22 '14 at 22:16
• It seems too that most primes end with a $1.$ It is rare to have all $1's$ but even rarer to only have that pair of $1$s..... – Aaron Meyerowitz Oct 23 '14 at 7:52