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.

A095287 Primes in whose binary expansion the number of 1-bits is <= 1 + number of 0-bits.

This page as a plain text file.
%I A095287 #24 Aug 16 2025 04:49:56
%S A095287 2,5,17,19,37,41,67,71,73,83,89,97,101,113,131,137,139,149,163,193,
%T A095287 197,257,263,269,271,277,281,283,293,307,313,331,337,353,389,397,401,
%U A095287 409,419,421,433,449,457,521,523,541,547,557,563,569,577,587,593,601,613
%N A095287 Primes in whose binary expansion the number of 1-bits is <= 1 + number of 0-bits.
%H A095287 Indranil Ghosh, <a href="/A095287/b095287.txt">Table of n, a(n) for n = 1..25000</a>
%H A095287 A. Karttunen and J. Moyer: <a href="/A095062/a095062.c.txt">C-program for computing the initial terms of this sequence</a>
%e A095287 From _Indranil Ghosh_, Feb 03 2017: (Start)
%e A095287 5 is in the sequence because 5_10 = 101_2. '101' has two 1's and one 0.
%e A095287 17 is in the sequence because 17_10 = 10001_2. '10001' has two 1's and three 0's. (End)
%t A095287 Select[Prime[Range[200]],DigitCount[#,2,1]<=1+DigitCount[#,2,0]&] (* _Harvey P. Dale_, Apr 18 2023 *)
%o A095287 (PARI) forprime(p=2,613,v=binary(p);s=0;for(k=1,#v,s+=if(v[k]==1,+1,-1));if(s<=1,print1(p,", "))) \\ _Washington Bomfim_, Jan 13 2011
%o A095287 (Python)
%o A095287 from sympy import isprime
%o A095287 i=1
%o A095287 j=1
%o A095287 while j<=250:
%o A095287     if isprime(i) and bin(i)[2:].count("1")<=1+bin(i)[2:].count("0"):
%o A095287         print(str(j)+" "+str(i))
%o A095287         j+=1
%o A095287     i+=1 # _Indranil Ghosh_, Feb 03 2017
%Y A095287 Complement of A095286 in A000040. Subset: A095075. Subset of A095315. Cf. also A095297.
%K A095287 nonn,base,easy
%O A095287 1,1
%A A095287 _Antti Karttunen_, Jun 04 2004