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.

Showing 1-4 of 4 results.

A036378 Number of primes p between powers of 2, 2^n < p <= 2^(n+1).

Original entry on oeis.org

1, 1, 2, 2, 5, 7, 13, 23, 43, 75, 137, 255, 464, 872, 1612, 3030, 5709, 10749, 20390, 38635, 73586, 140336, 268216, 513708, 985818, 1894120, 3645744, 7027290, 13561907, 26207278, 50697537, 98182656, 190335585, 369323305, 717267168, 1394192236, 2712103833
Offset: 0

Views

Author

Keywords

Comments

Number of primes whose binary order (A029837) is n+1, i.e., those with ceiling(log_2(p)) = n+1. [corrected by Jon E. Schoenfield, May 13 2018]
First differences of A007053. This sequence illustrates how far the Bertrand postulate is oversatisfied.
Scaled for Ramanujan primes as in A190501, A190502.
This sequence appears complete such that any nonnegative number can be written as a sum of distinct terms of this sequence. The sequence has been checked for completeness up to the gap between 2^46 and 2^47. Assuming that after 2^46 the formula x/log(x) is a good approximation to primepi(x), it can be proved that 2*a(n) > a(n+1) for all n >= 46, which is a sufficient condition for completeness. [Frank M Jackson, Feb 02 2012]

Examples

			The 7 primes for which A029837(p)=6 are 37, 41, 43, 47, 53, 59, 61.
		

Crossrefs

Programs

  • Magma
    [1,1] cat [#PrimesInInterval(2^n, 2^(n+1)): n in [2..29]]; // Vincenzo Librandi, Nov 18 2014
  • Mathematica
    t = Table[PrimePi[2^n], {n, 0, 20}]; Rest@t - Most@t (* Robert G. Wilson v, Mar 20 2006 *)
  • PARI
    a(n) = primepi(1<<(n+1))-primepi(1<
    				

Formula

a(n) = primepi(2^(n+1)) - primepi(2^n).
a(n) = A095005(n)+A095006(n) = A095007(n) + A095008(n) = A095013(n) + A095014(n) = A095015(n) + A095016(n) (for n > 1) = A095021(n) + A095022(n) + A095023(n) + A095024(n) = A095019(n) + A095054(n) = A095020(n) + A095055(n) = A095060(n) + A095061(n) = A095063(n) + A095064(n) = A095094(n) + A095095(n).

Extensions

More terms from Labos Elemer, May 13 2004
Entries checked by Robert G. Wilson v, Mar 20 2006

A095071 Zero-bit dominant primes, i.e., primes whose binary expansion contains more 0's than 1's.

Original entry on oeis.org

17, 67, 73, 97, 131, 137, 193, 257, 263, 269, 277, 281, 293, 337, 353, 389, 401, 449, 521, 523, 547, 577, 593, 641, 643, 673, 769, 773, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1091, 1093, 1097, 1109, 1123, 1129, 1153, 1163, 1171
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Examples

			73 is in the sequence because 73 is a prime and 73_10 = 1001001_2. '1001001' has four 0's and one 1. - _Indranil Ghosh_, Jan 31 2017
		

Crossrefs

Complement of A095074 in A000040. Subset: A095072. Cf. A095019.

Programs

  • Mathematica
    Reap[Do[p=Prime[k];id=IntegerDigits[p,2];n=Length@id;If[Count[id,0]>n/2,Sow[p]],{k,200}]][[2,1]]
    (* Zak Seidov *)
    Select[Prime[Range[200]],DigitCount[#,2,0]>DigitCount[#,2,1]&] (* Harvey P. Dale, Nov 28 2024 *)
  • PARI
    B(x) = { nB = floor(log(x)/log(2)); b1 = 0; b0 = 0;
    for(i = 0, nB, if(bittest(x,i), b1++;, b0++;); );
    if(b0 > b1, return(1);, return(0););};
    forprime(x = 2, 1171, if(B(x), print1(x, ", "); ); ); \\ Washington Bomfim, Jan 11 2011
    
  • PARI
    {forprime(p=2,1171,nB=floor(log(p)/log(2));
    sum(i=0,nB,bittest(p,i))<=nB/2&print1(p,","))} \\ Zak Seidov, Jan 11 2011
    
  • Python
    #Program to generate the b-file
    from sympy import isprime
    i=1
    j=1
    while j<=200:
        if isprime(i) and bin(i)[2:].count("0")>bin(i)[2:].count("1"):
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Jan 31 2017

A095055 Number of primes with number of 1-bits <= number of 0-bits (A095075) in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 0, 1, 2, 3, 7, 11, 27, 40, 80, 130, 343, 482, 1180, 1756, 4473, 6479, 15387, 24022, 58714, 89306, 213397, 335115, 802311, 1265350, 2965114, 4781514, 11185644, 18079040, 42048314, 68709969, 159433693, 262002130, 602733406, 1000343760, 2297551889, 3828253857, 8748722270, 14683465908
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Formula

a(n) = A095019(n) + (if n is odd) A095018((n+1)/2).

Extensions

a(34)-a(40) from Amiram Eldar, Jun 13 2024

A095324 Number of A095322-primes in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 4, 13, 8, 35, 44, 124, 150, 466, 701, 1717, 2326, 6380, 9354, 23904, 34443, 88200, 134780, 331769, 508200, 1258386, 1957824, 4741344, 7424464, 17964801, 28737086, 68371012, 109643089
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0.2, 0, 0.076923, 0.173913, 0.302326, 0.106667, 0.255474, 0.172549, 0.267241, 0.172018, 0.289082, 0.231353, 0.300753, 0.216392, 0.312898, 0.242112, 0.324844, 0.245432, 0.328839, 0.262367, 0.336542, 0.268304, 0.345166, 0.278603, 0.349607, 0.283298, 0.354353, 0.29269, 0.359213, 0.296876
Ratios a(n)/A095019(n) converge as: 1, 1, 1, 1, 1, 0.333333, 1.333333, 1.181818, 0.8, 0.875, 0.846154, 0.953846, 0.974026, 0.966805, 1.080123, 0.97779, 0.93677, 0.98472, 0.970332, 0.995088, 0.9894, 0.987616, 0.985673, 0.990015, 0.994846, 0.994496, 0.987642, 0.991599, 0.988865, 0.993681, 0.996653, 0.995067, 0.994296

Crossrefs

a(n) = A036378(n)-A095325(n).
Showing 1-4 of 4 results.