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-3 of 3 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

A095075 Primes in whose binary expansion the number of 1-bits is less than or equal to number of 0-bits.

Original entry on oeis.org

2, 17, 37, 41, 67, 73, 97, 131, 137, 139, 149, 163, 193, 197, 257, 263, 269, 277, 281, 293, 337, 353, 389, 401, 449, 521, 523, 541, 547, 557, 563, 569, 577, 587, 593, 601, 613, 617, 641, 643, 647, 653, 659, 661, 673, 677, 709, 769, 773, 787
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Examples

			From _Indranil Ghosh_, Feb 03 2017: (Start)
17 is in the sequence because 17_10 = 10001_2. '10001' has two 1's and three 0's.
37 is in the sequence because 37_10 = 100101_2. '100101' has three 1's and 3 0's. (End)
		

Crossrefs

Complement of A095070 in A000040.
Cf. A095055.

Programs

  • Mathematica
    Select[Prime[Range[150]], Differences[DigitCount[#, 2]][[1]] >= 0 &] (* Amiram Eldar, Jul 25 2023 *)
    Select[Prime[Range[150]],DigitCount[#,2,1]<=DigitCount[#,2,0]&] (* Harvey P. Dale, Sep 27 2023 *)
  • PARI
    B(x) = {nB = floor(log(x)/log(2)); z1 = 0; z0 = 0;
    for(i = 0, nB, if(bittest(x,i), z1++;, z0++;); );
    if(z1 <= z0, return(1);, return(0););};
    forprime(x = 2, 787, if(B(x), print1(x, ", "); ); );
    \\ Washington Bomfim, Jan 11 2011
    
  • Python
    from sympy import isprime
    i=1
    j=1
    while j<=250:
        if isprime(i) and bin(i)[2:].count("1")<=bin(i)[2:].count("0"):
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 03 2017

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

Original entry on oeis.org

0, 0, 0, 1, 3, 1, 4, 13, 32, 35, 96, 124, 335, 466, 1116, 1717, 4371, 6380, 15490, 23904, 58041, 88200, 209875, 331769, 795599, 1258386, 2951789, 4741344, 11144763, 17964801, 41781268, 68371012, 158643268
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratios a(n)/A036378(n) converge as: 0, 0, 0, 0.2, 0.428571, 0.076923, 0.173913, 0.302326, 0.426667, 0.255474, 0.376471, 0.267241, 0.384174, 0.289082, 0.368317, 0.300753, 0.406642, 0.312898, 0.400932, 0.324844, 0.413586, 0.328839, 0.408549, 0.336542, 0.420036, 0.345166, 0.420047, 0.349607, 0.425255, 0.354353, 0.425546, 0.359213, 0.429551
Ratios a(n)/A095055(n) converge as: 1, 1, 1, 1, 1.5, 0.333333, 0.571429, 1.181818, 1.185185, 0.875, 1.2, 0.953846, 0.976676, 0.966805, 0.945763, 0.97779, 0.977197, 0.98472, 1.006694, 0.995088, 0.988538, 0.987616, 0.983496, 0.990015, 0.991634, 0.994496, 0.995506, 0.991599, 0.996345, 0.993681, 0.993649, 0.995067, 0.995042

Crossrefs

a(n) = A036378(n)-A095329(n).
Showing 1-3 of 3 results.