login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A027697 Odious primes: primes with odd number of 1's in binary expansion. 42
2, 7, 11, 13, 19, 31, 37, 41, 47, 59, 61, 67, 73, 79, 97, 103, 107, 109, 127, 131, 137, 151, 157, 167, 173, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 271, 283, 307, 313, 331, 367, 379, 397, 409, 419, 421, 431, 433, 439, 443, 457, 463, 487, 491, 499, 521, 541, 557, 563 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Conjecture: a(n) < A027699(n) except for n = 2; verified up to n=5*10^7. Moreover, I conjecture that A027699(n) - a(n) tends to infinity. - Vladimir Shevelev
LINKS
E. Fouvry and 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)
Ben Green, Three topics in additive prime number theory, arXiv:0710.0823 [math.NT], Oct 03, 2007, pp. 12-27.
Vladimir Shevelev, Generalized Newman phenomena and digit conjectures on primes, Internat. J. of Mathematics and Math. Sciences, 2008 (2008), Article ID 908045, 1-12.
MAPLE
a:=proc(n) local nn: nn:= convert(ithprime(n), base, 2): if `mod`(sum(nn[j], j =1..nops(nn)), 2)=1 then ithprime(n) else end if end proc: seq(a(n), n=1..103); # Emeric Deutsch, Oct 24 2007
MATHEMATICA
Clear[BinSumOddQ]; BinSumOddQ[a_]:=Module[{i, s=0}, s=0; For[i=1, i<=Length[IntegerDigits[a, 2]], s+=Extract[IntegerDigits[a, 2], i]; i++ ]; OddQ[s]]; lst={}; Do[p=Prime[n]; If[BinSumOddQ[p], AppendTo[lst, p]], {n, 4!}]; lst (* Vladimir Joseph Stephan Orlovsky, Apr 06 2009 *)
Select[Prime@ Range@ 120, OddQ@ First@ DigitCount[#, 2] &] (* Michael De Vlieger, Feb 08 2016 *)
PROG
(PARI) f(p)={v=binary(p); s=0; for(k=1, #v, if(v[k]==1, s++)); return(s%2)};
forprime(p=2, 563, if(f(p), print1(p, ", "))) \\ Washington Bomfim, Jan 14 2011
(PARI) s=[]; forprime(p=2, 1000, if(norml2(binary(p))%2==1, s=concat(s, p))); s \\ Colin Barker, Feb 18 2014
(Python)
from sympy import primerange
print([n for n in primerange(1, 1001) if bin(n)[2:].count("1")%2]) # Indranil Ghosh, May 03 2017
CROSSREFS
Cf. A000069 (odious numbers), A092246 (odd odious numbers)
Sequence in context: A161681 A020583 A140557 * A364470 A235475 A146315
KEYWORD
nonn,easy,base
AUTHOR
EXTENSIONS
More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 20:26 EDT 2024. Contains 371781 sequences. (Running on oeis4.)