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.

Previous Showing 81-90 of 114 results. Next

A345755 a(n) is the number of primes p satisfying n*(log_2(n))^2 < p <= (n+1)*(log_2(n+1))^2.

Original entry on oeis.org

1, 3, 2, 3, 3, 4, 4, 4, 5, 3, 4, 4, 6, 3, 5, 7, 3, 4, 6, 5, 5, 7, 5, 3, 6, 6, 7, 6, 4, 6, 5, 7, 5, 6, 5, 6, 7, 6, 8, 4, 6, 6, 9, 3, 5, 7, 9, 5, 7, 9, 4, 7, 7, 5, 7, 6, 5, 9, 7, 8, 3, 7, 8, 8, 8, 6, 4, 7, 6, 8, 10, 7, 8, 7, 6, 7, 6, 6, 6, 7, 7, 10, 4, 8, 9, 7
Offset: 1

Views

Author

Hal M. Switkay, Jun 27 2021

Keywords

Comments

Prime gaps appear to grow more slowly than any power function.
Cramér's conjecture states that prime gaps grow as follows: prime(n+1) - prime(n) = O(log(prime(n))^2).
Since prime(n) ~ n*log(n), we conjecture that a(n) > 0 for n > 0, and that the exponent 2 cannot be replaced by any smaller exponent.
Note: n*(log_2(n))^2 < n^(log(127)/log(16)) when n >= 267. Therefore the conjecture immediately above is stronger than the conjecture that A143935(n) > 0 when n > 0, which in turn is stronger than Legendre's conjecture.
This sequence relies on intervals that are slightly more than twice as wide as those in the similar sequence A166363. A comment at that sequence by Greathouse discovers zero values (representing prime-free intervals). In contrast, the present sequence does not include zero entries for n <= 2772, suggesting that the lengths of prime gaps may be bracketed by the two sequences. We conjecture that prime gaps may be larger than log(p)^2, but are not larger than log_2(p)^2. - Hal M. Switkay, Aug 29 2023

Examples

			a(10) is the number of primes > 110.35 and <= 131.64. a(10) = 3, because the primes in this interval are 113, 127, and 131.
		

Crossrefs

Programs

  • Mathematica
    Differences @ Table[PrimePi[n*Log2[n]^2], {n, 1, 100}] (* Amiram Eldar, Jun 27 2021 *)
  • PARI
    f(n) = n*(log(n)/log(2))^2;
    a(n) = primepi(f(n+1)) - primepi(f(n)); \\ Michel Marcus, Jun 30 2021

A348194 a(n) = A077767(n) - A077766(n).

Original entry on oeis.org

1, 0, 0, 1, 0, 0, -1, 2, -1, -1, 2, 1, -1, 2, 0, -1, -1, 0, 0, -1, 1, 3, 0, -1, 0, 1, -2, 1, 0, 0, 0, 1, -2, -1, 0, 1, -1, 4, 5, -2, -3, 3, -2, 1, 1, 0, -3, -1, 0, 3, -1, -2, 0, 3, -3, -2, 5, -3, 2, 0, -1, 5, -1, 0, -2, -1, 1, 3, -3, 3, 5, -5, 1, 3, -4, 4, 2, -2, -1, -3, 0, -1, 6, 1, -4, -3, 2, -4, -4, 2, 0, -1, 1, 1, -1, -1, 2, -1, 3, 1, 2, -2, 5, 1, -1
Offset: 1

Views

Author

Seiichi Manyama, Oct 06 2021

Keywords

Crossrefs

Programs

  • PARI
    a(n) = sum(k=n^2, (n+1)^2, (isprime(k)&&k%4==3)-(isprime(k)&&k%4==1));

Formula

a(n) = A348193(n+1) - A348193(n).

A349791 a(n) is the median of the primes between n^2 and (n+1)^2.

Original entry on oeis.org

6, 12, 19, 30, 42, 59, 72, 89, 107, 134, 157, 181, 205, 236, 271, 311, 348, 381, 421, 461, 503, 560, 601, 650, 701, 754, 821, 870, 933, 994, 1051, 1113, 1193, 1268, 1319, 1423, 1482, 1559, 1624, 1723, 1801, 1884, 1993, 2081, 2148, 2267, 2357, 2444, 2549, 2663
Offset: 2

Views

Author

Hugo Pfoertner, Dec 05 2021

Keywords

Comments

The median of an even number of values is assumed to be defined as the arithmetic mean of the two central elements in their sorted list. The special case of the primes 2 and 3 in the interval [1,4] is excluded because their median would be 5/2.

Crossrefs

Programs

  • Mathematica
    Table[Median@Select[Range[n^2,(n+1)^2],PrimeQ],{n,2,51}] (* Giorgos Kalogeropoulos, Dec 05 2021 *)
  • PARI
    medpsq(n) = {my(p1=nextprime(n^2), p2=precprime((n+1)^2), np1=primepi(p1), np2=primepi(p2), nm=(np1+np2)/2);
    if(denominator(nm)==1, prime(nm), (prime(nm-1/2)+prime(nm+1/2))/2)};
    for(k=2,51,print1(medpsq(k),", "))
    
  • Python
    from sympy import primerange
    from statistics import median
    def a(n): return int(median(primerange(n**2, (n+1)**2)))
    print([a(n) for n in range(2, 52)]) # Michael S. Branicky, Dec 05 2021
    
  • Python
    from sympy import primepi, prime
    def A349791(n):
        b = primepi(n**2)+primepi((n+1)**2)+1
        return (prime(b//2)+prime((b+1)//2))//2 if b % 2 else prime(b//2) # Chai Wah Wu, Dec 05 2021

A349792 Numbers k such that k*(k+1) is the median of the primes between k^2 and (k+1)^2.

Original entry on oeis.org

2, 3, 5, 6, 8, 25, 29, 38, 59, 101, 135, 217, 260, 295, 317, 455, 551, 686, 687, 720, 825, 912, 1193, 1233, 1300, 1879, 1967, 2200, 2576, 2719, 2857, 3303, 3512, 4215, 4241, 4448, 4658, 5825, 5932, 5952, 6155, 6750, 7275, 10305, 10323, 10962, 11279, 13495, 14104
Offset: 1

Views

Author

Hugo Pfoertner, Dec 05 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range@3000,Median@Select[Range[#^2,(#+1)^2],PrimeQ]==#(#+1)&] (* Giorgos Kalogeropoulos, Dec 05 2021 *)
  • PARI
    a349791(n) = {my(p1=nextprime(n^2), p2=precprime((n+1)^2), np1=primepi(p1), np2=primepi(p2), nm=(np1+np2)/2); if(denominator(nm)==1, prime(nm), (prime(nm-1/2)+prime(nm+1/2))/2)};
    for(k=2,5000, my(t=k*(k+1)); if(t==a349791(k),print1(k,", ")))
    
  • Python
    from sympy import primerange
    from statistics import median
    def ok(n): return n>1 and int(median(primerange(n**2, (n+1)**2)))==n*(n+1)
    print([k for k in range(999) if ok(k)]) # Michael S. Branicky, Dec 05 2021
    
  • Python
    from itertools import count, islice
    from sympy import primepi, prime, nextprime
    def A349792gen(): # generator of terms
        p1 = 0
        for n in count(1):
            p2 = primepi((n+1)**2)
            b = p1 + p2 + 1
            if b % 2:
                p = prime(b//2)
                q = nextprime(p)
                if p+q == 2*n*(n+1):
                    yield n
            p1 = p2
    A349792_list = list(islice(A349792gen(),12)) # Chai Wah Wu, Dec 08 2021

A037037 Number of primes between n and 3n.

Original entry on oeis.org

2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 7, 6, 7, 7, 8, 9, 9, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 14, 14, 14, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 17, 18, 18, 18, 19, 20, 19, 19, 20, 21, 21, 22, 21, 22, 23, 23, 24, 24, 24, 25, 24, 24, 25, 26, 27, 28, 27, 27, 27, 28, 27, 27, 26, 27, 28
Offset: 1

Views

Author

Keywords

Examples

			For example a(5)=4 because between 5 and 15 there are 4 primes: 5, 7, 11 and 13.
		

Crossrefs

Cf. A014085.

Programs

  • Mathematica
    Array[Count[Range[#, 3 #], k_ /; PrimeQ@ k] &, 76] (* Michael De Vlieger, Mar 20 2017 *)
  • PARI
    a(n) = primepi(3*n) - primepi(n-1); \\ Michel Marcus, Sep 28 2013

Formula

a(n) = A000720(3n) - A000720(n-1). - Wesley Ivan Hurt, Jun 15 2013

Extensions

More terms from Erich Friedman

A037038 Number of primes between n and 4n+1.

Original entry on oeis.org

3, 4, 5, 5, 6, 6, 7, 7, 8, 9, 10, 10, 11, 10, 12, 12, 13, 14, 14, 14, 15, 16, 16, 16, 17, 18, 20, 21, 21, 20, 20, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 26, 28, 28, 28, 29, 30, 31, 31, 31, 32, 31, 31, 32, 34, 35, 35, 36, 36, 35, 36, 37, 37, 38, 39, 39, 40, 41, 42, 41
Offset: 1

Views

Author

Keywords

Examples

			a(5)=6 because between 5 and 21 there are 6 primes: 5, 7, 11, 13, 17 and 19.
		

Crossrefs

Cf. A000720 (pi), A014085.

Programs

Formula

a(n) = A000720(4*n+1) - A000720(n-1). - Michel Marcus, Sep 28 2013

Extensions

More terms from Erich Friedman

A069160 Number of primes p such that n^2 < p < n^2 + pi(n), where pi(n) is the number of primes less than n.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 1, 2, 0, 0, 1, 2, 2, 1, 1, 0, 1, 1, 1, 2, 0, 1, 1, 2, 1, 1, 0, 1, 2, 2, 3, 1, 2, 3, 1, 3, 2, 3, 1, 0, 1, 1, 2, 1, 2, 2, 1, 1, 1, 3, 1, 2, 1, 1, 4, 2, 1, 2, 2, 3, 0, 2, 3, 3, 2, 2, 0, 2, 2, 2, 2, 3, 2, 3, 1, 3, 2, 1, 5, 2, 3, 2, 4, 2, 5, 3, 3, 4, 4, 1, 2, 3, 3, 3, 5, 3, 3
Offset: 1

Views

Author

T. D. Noe, Apr 09 2002

Keywords

Comments

A more restrictive version of the conjecture that there is always a prime between n^2 and (n+1)^2.

Examples

			a(10)= 2 because pi(10) = 4 and there are 2 primes between 100 and 104.
		

Crossrefs

Programs

  • Mathematica
    maxN=100; lst={}; For[i=1, i
    				

A069163 Number of symmetric primes between n^2 and (n+2)^2. Two primes are termed symmetric in n^2 to (n+2)^2 if there is a k < 2n such that mid-k and mid+k are both prime, where mid =n(n+2).

Original entry on oeis.org

0, 1, 2, 2, 1, 2, 2, 1, 2, 4, 1, 2, 3, 1, 5, 3, 1, 4, 4, 3, 5, 3, 2, 4, 4, 1, 4, 4, 2, 5, 4, 0, 6, 2, 3, 4, 4, 2, 4, 8, 0, 3, 4, 2, 5, 4, 4, 5, 5, 3, 7, 5, 3, 5, 7, 2, 4, 6, 3, 7, 7, 5, 6, 6, 5, 5, 7, 5, 6, 8, 1, 3, 8, 3, 11, 6, 1, 10, 5, 2, 5, 8, 5, 5, 7, 5, 4, 6, 2, 8, 7, 4, 13, 7, 5, 9, 7, 4, 9
Offset: 1

Views

Author

T. D. Noe, Apr 09 2002

Keywords

Comments

This relates primes between n^2 and (n+1)^2 to primes between (n+1)^2 and (n+2)^2. It appears that the number of symmetric primes is zero for only n=0,32,41.

Examples

			a(5) = 1 because in the range 25 to 49, the primes 29 and 41 are the only primes symmetric about the number 35.
		

Crossrefs

Cf. A014085.

Programs

  • Mathematica
    maxN=100; lst={}; For[n=1, n
    				

A078764 List primes between (2n)^2 and (2n+1)^2.

Original entry on oeis.org

5, 7, 17, 19, 23, 37, 41, 43, 47, 67, 71, 73, 79, 101, 103, 107, 109, 113, 149, 151, 157, 163, 167, 197, 199, 211, 223, 257, 263, 269, 271, 277, 281, 283, 331, 337, 347, 349, 353, 359, 401, 409, 419, 421, 431, 433, 439, 487, 491, 499, 503, 509, 521, 523, 577
Offset: 1

Views

Author

Donald S. McDonald, Jan 09 2003

Keywords

Comments

The primes may be on adjacent sides of Ulam square prime-spiral. 7 8 9 / 6 1 2 / 5 4 3/...

Examples

			The 3 primes between 4^2=16 (even) and 5^2=25 (odd) are just a(3)=17, a(4)=19 and a(5)=23.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Select[Range[(2n)^2, (2n + 1)^2], PrimeQ];Flatten@Array[f, 12] (* Ray Chandler, May 03 2007 *)

Extensions

Extended by Ray Chandler, May 03 2007

A104481 Bisection of A104477.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 3, 2, 4, 3, 4, 4, 3, 5, 6, 4, 5, 5, 6, 6, 6, 5, 8, 7, 6, 7, 8, 7, 7, 9, 8, 9, 8, 9, 8, 8, 11, 10, 11, 10, 8, 11, 10, 12, 9, 12, 14, 9, 10, 14, 15, 11, 12, 10, 11, 16, 12, 15, 15, 12, 16, 14, 13, 15, 14, 14, 16, 12, 20, 14, 14, 16, 16, 17, 21, 13, 17, 22, 12, 19, 18, 19
Offset: 1

Views

Author

Alexandre Wajnberg, Apr 18 2005

Keywords

Comments

a(n) = A014085(n) - 1. - Klaus Brockhaus, Apr 20 2005

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; f[n_] := PrimePi[ PrevPrim[(n + 1)^2]] - PrimePi[ NextPrim[n^2]]; Table[ f[n], {n, 83}] (* Robert G. Wilson v, Apr 23 2005 *)

Extensions

More terms from Robert G. Wilson v, Apr 23 2005
Previous Showing 81-90 of 114 results. Next