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.

A027697 Odious primes: primes with odd number of 1's in binary expansion.

This page as a plain text file.
%I A027697 #61 Oct 18 2022 06:05:30
%S A027697 2,7,11,13,19,31,37,41,47,59,61,67,73,79,97,103,107,109,127,131,137,
%T A027697 151,157,167,173,179,181,191,193,199,211,223,227,229,233,239,241,251,
%U A027697 271,283,307,313,331,367,379,397,409,419,421,431,433,439,443,457,463,487,491,499,521,541,557,563
%N A027697 Odious primes: primes with odd number of 1's in binary expansion.
%C A027697 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_
%H A027697 T. D. Noe, <a href="/A027697/b027697.txt">Table of n, a(n) for n=1..10000</a>
%H A027697 E. Fouvry and C. Mauduit, <a href="http://dx.doi.org/10.1007/BF01444238">Sommes des chiffres et nombres presque premiers</a>, (French) [Sums of digits and almost primes] Math. Ann. 305 (1996), no. 3, 571--599. MR1397437 (97k:11029)
%H A027697 Ben Green, <a href="http://arXiv.org/abs/0710.0823">Three topics in additive prime number theory</a>, arXiv:0710.0823 [math.NT], Oct 03, 2007, pp. 12-27.
%H A027697 Vladimir Shevelev, <a href="https://doi.org/10.1155/2008/908045">Generalized Newman phenomena and digit conjectures on primes</a>, Internat. J. of Mathematics and Math. Sciences, 2008 (2008), Article ID 908045, 1-12.
%p A027697 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
%t A027697 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 *)
%t A027697 Select[Prime@ Range@ 120, OddQ@ First@ DigitCount[#, 2] &] (* _Michael De Vlieger_, Feb 08 2016 *)
%o A027697 (PARI) f(p)={v=binary(p);s=0;for(k=1,#v,if(v[k]==1,s++));return(s%2)};
%o A027697 forprime(p=2, 563, if(f(p), print1(p,", "))) \\ _Washington Bomfim_, Jan 14 2011
%o A027697 (PARI) s=[]; forprime(p=2, 1000, if(norml2(binary(p))%2==1, s=concat(s, p))); s \\ _Colin Barker_, Feb 18 2014
%o A027697 (Python)
%o A027697 from sympy import primerange
%o A027697 print([n for n in primerange(1, 1001) if bin(n)[2:].count("1")%2]) # _Indranil Ghosh_, May 03 2017
%Y A027697 Cf. A027699, A066148, A066149, A081092.
%Y A027697 Cf. A000069 (odious numbers), A092246 (odd odious numbers)
%K A027697 nonn,easy,base
%O A027697 1,1
%A A027697 _N. J. A. Sloane_
%E A027697 More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)