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-2 of 2 results.

A350100 Numbers k such that the prime gap between the consecutive primes p1 < k^2 < p2 sets a new record.

Original entry on oeis.org

2, 3, 5, 11, 23, 30, 41, 50, 76, 100, 149, 159, 189, 345, 437, 509, 693, 1110, 1165, 5018, 14908, 18906, 19079, 28634, 38682, 80444, 105686, 185179, 265236, 269697, 409049, 558269, 1673629, 2965232, 3528015, 4292936, 34919969, 43957056, 148793437, 187220890, 424171123
Offset: 1

Views

Author

Hugo Pfoertner, Dec 25 2021

Keywords

Comments

a(51) (in b-file) > 1.5*10^11, corresponding to A378904(51) > 723. - Hugo Pfoertner, Jan 04 2025

Examples

			  n  a(n)  p1   a(n)^2   p2   gap=2*A378904(n)
  1   2     3      4      5    2
  2   3     7      9     11    4
  3   5    23     25     29    6
  4  11   113    121    127   14
  5  23   523    529    541   18
  6  30   887    900    907   20
  7  41  1669   1681   1693   24
  8  50  2477   2500   2503   26
		

Crossrefs

A378904 are the corresponding gaps, divided by 2.

Programs

  • Mathematica
    Module[{nn=4242*10^5,pg},pg=Table[{n,NextPrime[n^2]-NextPrime[n^2,-1]},{n,2,nn}];DeleteDuplicates[pg,GreaterEqual[#1[[2]],#2[[2]]]&]][[All,1]] (* Harvey P. Dale, Jan 28 2023 *)
  • PARI
    a350100(limit) = {my(pmax=0); for(k=2,limit, my(kk=k*k, pp=precprime(kk), pn=nextprime(kk), d=pn-pp); if(d>pmax, print1(k,", "); pmax=d))};
    a350100(3000000)
    
  • Python
    from itertools import count, islice
    from sympy import prevprime, nextprime
    def A350100_gen(): # generator of terms
        c = 0
        for k in count(2):
            a = nextprime(m:=k**2)-prevprime(m)
            if a>c:
                yield k
                c = a
    A350100_list = list(islice(A350100_gen(),20)) # Chai Wah Wu, Dec 17 2024

A379444 a(n) is the difference between the least prime > (n+1)^2 and the largest prime < n^2, divided by 2.

Original entry on oeis.org

4, 5, 8, 7, 11, 10, 11, 11, 15, 18, 17, 15, 17, 17, 21, 24, 25, 21, 23, 24, 31, 27, 30, 29, 30, 30, 40, 34, 40, 39, 35, 38, 38, 37, 41, 40, 42, 45, 48, 54, 51, 51, 47, 56, 50, 51, 57, 52, 66, 57, 60, 57, 64, 57, 65, 71, 65, 69, 67, 64, 78, 66, 68, 69, 72, 77, 81
Offset: 2

Views

Author

Hugo Pfoertner, Dec 23 2024

Keywords

Comments

2*a(n) would be the gap needed between consecutive primes to provide a counterexample to Legendre's conjecture that there is always a prime between n^2 and (n+1)^2. The gaps actually observed are significantly smaller; see A378904 for comparison.

Crossrefs

Programs

  • Mathematica
    a[n_]:=(NextPrime[(n+1)^2] - NextPrime[n^2,-1])/2; Array[a,67,2] (* Stefano Spezia, Jan 24 2025 *)
  • PARI
    a379444(n) = (nextprime((n+1)^2) - precprime(n^2))/2

Formula

a(n) = (A007491(n+1) - A053001(n))/2.
a(n) >= n + 2.
Showing 1-2 of 2 results.