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.

A090116 a(n)=x is the least number such that x^2 is "surrounded" by two closest primes, prevprime(x^2) and nextprime(x^2), whose difference nextprime - prevprime = 2n.

Original entry on oeis.org

2, 3, 5, 19, 12, 25, 11, 44, 23, 30, 57, 41, 50, 102, 76, 104, 100, 149, 175, 159, 348, 276, 305, 397, 461, 189, 345, 1059, 437, 820, 833, 1002, 509, 1283, 822, 1099, 729, 1090, 693, 2710, 1110, 1284, 3563, 1823, 1370, 4332, 3771, 1380, 4394, 2160, 2011, 1498
Offset: 1

Views

Author

Labos Elemer, Jan 09 2004

Keywords

Comments

a(14) > 16*10^6. - David A. Corneth, Jun 12 2017

Examples

			n=5: a(5)=12 because the primes closest to 12^2 = 144 are {139,149} whose difference 149 - 139 = 10 = 2n and 144 is the smallest square with this property;
n=1: a(1)=2 because 2^2=4 is surrounded by primes {3,5} with difference 5 - 3 = 2 = 2n.
		

Crossrefs

Programs

  • Mathematica
    de[x_] := Prime[PrimePi[x]+1]-Prime[PrimePi[x]]; de[1] = 0; t=Table[de[w^2], {w, 1, 50000}]; mt=Table[Min[Flatten[Position[t, 2*j]]], {j, 1, 100}]
  • PARI
    first(n) = my(todo = n, res = vector(n), p, x = 2); while(todo > 0, m = nextprime(x^2) - precprime(x^2); if(m <= 2*n, if(res[m/2]==0, res[m/2] = x; todo--)); x++); res \\ David A. Corneth, Jun 12 2017

A090117 a(n) = x^2 = A090116(n)^2 is the least square that is "surrounded" by two closest primes, by prevprime(x^2) and nextprime(x^2) whose difference nextprime - prevprime = 2n.

Original entry on oeis.org

4, 9, 25, 361, 144, 625, 121, 1936, 529, 900, 3249, 1681, 2500, 10404, 5776, 10816, 10000, 22201, 30625, 25281, 121104, 76176, 93025, 157609, 212521, 35721, 119025, 1121481, 190969, 672400, 693889, 1004004, 259081, 1646089, 675684, 1207801
Offset: 1

Views

Author

Labos Elemer, Jan 09 2004

Keywords

Examples

			n=5: a(5)=144, primes closest to 144 are {139,149} of which the difference 149 - 139 = 10 = 2n and 144 is the smallest square with this property;
n=1: a(1)=4, 2^2 = 4 is surrounded by {3,5} closest primes with difference 5 - 3 = 2 = 2n.
		

Crossrefs

Programs

  • Mathematica
    de[x_ ]:= Prime[PrimePi[x]+1]-Prime[PrimePi[x]] t=Table[de[w^2], {w, 1, 50000}]; q=Table[Min[Flatten[Position[t, 2*j]]]^2, {j, 1, 100}]
    Table[Min[Transpose[Select[{#,NextPrime[#]-NextPrime[#,-1]}&/@ (Range[ 2,5000]^2), Last[#]==2n&]][[1]]],{n,40}] (* Harvey P. Dale, Sep 04 2011 *)

A090118 a(n) = prevprime(A090117(n)), the largest prime previous to squares given in A090117, being such that distance of a(n) to the following prime equals 2*n.

Original entry on oeis.org

3, 7, 23, 359, 139, 619, 113, 1933, 523, 887, 3229, 1669, 2477, 10399, 5749, 10799, 9973, 22193, 30593, 25261, 121081, 76163, 93001, 157579, 212507, 35677, 118973, 1121453, 190921, 672379, 693881, 1003963, 259033, 1646033, 675643, 1207769
Offset: 1

Views

Author

Labos Elemer, Jan 09 2004

Keywords

Examples

			a(7) = 113 because 127-113 = 14 = 2*7 and 121 = 11^2 is between {127,113} closest primes; also 113 is the smallest prime with this property.
		

Crossrefs

Programs

  • Mathematica
    pre[x_] := Prime[PrimePi[x]]; nex[x_] := Prime[PrimePi[x]+1]; de[x_] := Prime[PrimePi[x]+1]-Prime[PrimePi[x]]; de[1] = 0; t=Table[de[w^2], {w, 1, 50000}]; mt=Table[Min[Flatten[Position[t, 2*j]]], {j, 1, 100}]; Table[pre[Part[mt, j]^2], {j, 1, Length[mt]}]

Formula

a(n) = prevprime(A090117(n)) = prevprime(A090116(n)^2).
a(n) = prime(pi(A090117(n))).

Extensions

Name corrected by Jason Yuen, Jun 23 2025

A090120 Numbers k such that nextprime(k^2) - prevprime(k^2) = 4.

Original entry on oeis.org

3, 4, 9, 10, 14, 15, 20, 21, 26, 33, 40, 110, 117, 124, 146, 206, 237, 250, 273, 303, 309, 326, 340, 350, 387, 429, 436, 440, 441, 447, 470, 513, 561, 573, 609, 634, 686, 704, 807, 897, 920, 1004, 1035, 1054, 1060, 1071, 1113, 1124, 1143, 1156, 1233, 1239
Offset: 1

Views

Author

Labos Elemer, Jan 09 2004

Keywords

Comments

Note that the gap = 4 is partitioned either as 2+2 or as 3+1; 1+3 never occurs since n^2-1 is composite if n>2.

Examples

			k = 3 is a term since, k^2 = 9 is surrounded by the closest primes: {7,[9],11}.
k = 10 is a term since k^2 = 100 is surrounded by {97,[100],101}.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[3,1500], NextPrime[#^2] == NextPrime[#^2, -1] + 4 &] (* Giovanni Resta, May 26 2018 *)
  • PARI
    isok(n) = nextprime(n^2) - precprime(n^2) == 4; \\ Michel Marcus, May 26 2018

Formula

Solutions to {x; A007918(x^2)-A007917(x^2) = 4}.
Showing 1-4 of 4 results.