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.

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

A090119 a(n) = nextprime(A090117(n)), the smallest prime following squares listed in A090117 and also the distance of a(n) from the preceding prime is 2*n.

Original entry on oeis.org

5, 11, 29, 367, 149, 631, 127, 1949, 541, 907, 3251, 1693, 2503, 10427, 5779, 10831, 10007, 22229, 30631, 25301, 121123, 76207, 93047, 157627, 212557, 35729, 119027, 1121509, 190979, 672439, 693943, 1004027, 259099, 1646101, 675713, 1207841
Offset: 1

Views

Author

Labos Elemer, Jan 09 2004

Keywords

Examples

			a(7) = 127 because 127-113 = 14 = 2*7 and 121 = 11^2 is between {127,113} closest primes to 121 a suitable square number. Also 127 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[nex[Part[mt, j]^2], {j, 1, Length[mt]}]

Formula

a(n) = nextprime(A090117(n)) = nextprime(A090116(n)^2).
a(n) = A007918(A090117(n)) = prime(1+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.