A027699 Evil primes: primes with even number of 1's in their binary expansion.
3, 5, 17, 23, 29, 43, 53, 71, 83, 89, 101, 113, 139, 149, 163, 197, 257, 263, 269, 277, 281, 293, 311, 317, 337, 347, 349, 353, 359, 373, 383, 389, 401, 449, 461, 467, 479, 503, 509, 523, 547, 571, 593, 599, 619, 643, 673, 683, 691, 739, 751, 773, 797, 811
Offset: 1
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- E. Fouvry, C. Mauduit, Sommes des chiffres et nombres presque premiers, (French) [Sums of digits and almost primes] Math. Ann. 305 (1996), no. 3, 571--599. MR1397437 (97k:11029).
- V. Shevelev, A conjecture on primes and a step towards justification, arXiv:0706.0786 [math.NT], 2007.
Crossrefs
Programs
-
Mathematica
Select[Prime[Range[200]], EvenQ[Count[IntegerDigits[ #,2],1]]&] (* T. D. Noe, Jun 12 2007 *)
-
PARI
forprime(p=1,999,norml2(binary(p))%2 || print1(p","))
-
PARI
isA027699(p)=isprime(p) && !bittest(norml2(binary(p)),0) \\ M. F. Hasler, Dec 12 2010
-
Python
from sympy import isprime def ok(n): return bin(n).count("1")%2 == 0 and isprime(n) print([k for k in range(812) if ok(k)]) # Michael S. Branicky, Jun 27 2022
Extensions
More terms from Erich Friedman
Comments