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.

A095073 Primes in whose binary expansion the number of 1-bits is one more than the number of 0-bits.

This page as a plain text file.
%I A095073 #22 May 01 2021 15:57:41
%S A095073 5,19,71,83,89,101,113,271,283,307,313,331,397,409,419,421,433,457,
%T A095073 1103,1117,1181,1223,1229,1237,1303,1307,1319,1381,1427,1429,1433,
%U A095073 1481,1489,1559,1579,1607,1613,1619,1621,1637,1699,1733,1811,1861
%N A095073 Primes in whose binary expansion the number of 1-bits is one more than the number of 0-bits.
%H A095073 Indranil Ghosh, <a href="/A095073/b095073.txt">Table of n, a(n) for n = 1..25000</a>
%H A095073 Antti Karttunen and J. Moyer, <a href="/A095062/a095062.c.txt">C-program for computing the initial terms of this sequence</a>
%e A095073 71 is in the sequence because 71_10 = 1000111_2. '1000111' has four 1's and three 0's. - _Indranil Ghosh_, Feb 03 2017
%t A095073 Select[Prime[Range[500]], Differences[DigitCount[#, 2]] == {-1} &]
%o A095073 (PARI)
%o A095073 { forprime(p=2, 2000,
%o A095073   v=binary(p); s=0;
%o A095073   for(k=1,#v, s+=if(v[k]==1,+1,-1));
%o A095073   if(s==1,print1(p,", "))
%o A095073 ) }
%o A095073 (Python)
%o A095073 from sympy import isprime
%o A095073 i=1
%o A095073 j=1
%o A095073 while j<=25000:
%o A095073     if isprime(i) and bin(i)[2:].count("1")-bin(i)[2:].count("0")==1:
%o A095073         print(str(j)+" "+str(i))
%o A095073         j+=1
%o A095073     i+=1 # _Indranil Ghosh_, Feb 03 2017
%Y A095073 Intersection of A000040 and A031448. Subset of A095070. Cf. A095053.
%K A095073 nonn,base,easy
%O A095073 1,1
%A A095073 _Antti Karttunen_, Jun 01 2004