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 11-20 of 25 results. Next

A056930 Average of smallest prime greater than n^2 and largest prime less than (n+1)^2.

Original entry on oeis.org

6, 12, 20, 30, 42, 57, 73, 90, 107, 133, 158, 183, 210, 239, 270, 305, 345, 382, 420, 461, 505, 556, 598, 652, 702, 753, 813, 870, 930, 994, 1059, 1122, 1193, 1260, 1332, 1406, 1479, 1560, 1635, 1726, 1812, 1897, 1983, 2070, 2168, 2255, 2354, 2444
Offset: 2

Views

Author

Henry Bottomley, Jul 12 2000

Keywords

Comments

a(1)=2.5 which is not an integer

Examples

			a(4)=1 because smallest prime greater than 4^2 is 17, largest prime less than 5^2 is 23 and average of 17 and 23 is 20
		

Crossrefs

Programs

  • Mathematica
    Table[Mean[{NextPrime[n^2],NextPrime[(n+1)^2,-1]}],{n,2,50}] (* Harvey P. Dale, May 10 2019 *)

Formula

a(n) =(A007491(n)+A053001(n+1))/2 =A002378(n)-A056931(n)

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

A065384 Largest prime <= n * (n + 1) / 2.

Original entry on oeis.org

3, 5, 7, 13, 19, 23, 31, 43, 53, 61, 73, 89, 103, 113, 131, 151, 167, 181, 199, 229, 251, 271, 293, 317, 349, 373, 401, 433, 463, 491, 523, 557, 593, 619, 661, 701, 739, 773, 811, 859, 887, 941, 983, 1033, 1069, 1123, 1171, 1223, 1259, 1321, 1373, 1429, 1483
Offset: 2

Views

Author

Reinhard Zumkeller, Nov 05 2001

Keywords

Crossrefs

Programs

  • Mathematica
    PrimePrev[n_]:=Module[{k=n},While[ !PrimeQ[k],k-- ];k];f[n_]:=n*(n+1)/2;lst={};Do[AppendTo[lst,PrimePrev[f[n]]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Feb 26 2010 *)
  • PARI
    { for (n=2, 1000, write("b065384.txt", n, " ", precprime(n*(n + 1)/2)) ) } [Harry J. Smith, Oct 17 2009]

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}.

A132657 a(n) is the product of the least prime > n^2 and the greatest prime < (n+1)^2.

Original entry on oeis.org

6, 35, 143, 391, 899, 1739, 3233, 5293, 8051, 11413, 17653, 24883, 33389, 43931, 56977, 72731, 92881, 118829, 145699, 176039, 212197, 254701, 308911, 357163, 424663, 492179, 566609, 660293, 756611, 864371, 987307, 1120697, 1257923
Offset: 1

Views

Author

Jonathan Vos Post, Nov 15 2007

Keywords

Examples

			a(1) = 6 = 2*3 = (smallest prime in [1^2,2^2]) * (largest prime in [1^2,2^2]).
a(2) = 35 = 5*7 = (smallest prime in [2^2,3^2]) * (largest prime in [2^2,3^2]).
		

Crossrefs

Programs

  • Maple
    seq(nextprime(n^2)*prevprime((n+1)^2,n=1..100); # Robert Israel, Jan 26 2020
  • Mathematica
    Table[Prime[PrimePi[n^2] + 1]*Prime[PrimePi[(n + 1)^2]], {n, 1, 40}] (* Stefan Steinerberger, Nov 20 2007 *)
    NextPrime[#[[1]]]NextPrime[#[[2]],-1]&/@Partition[Range[40]^2,2,1] (* Harvey P. Dale, Aug 27 2022 *)
  • PARI
    for(n=1,33,print1(nextprime(n^2)*precprime((n+1)^2),", ")) \\ Hugo Pfoertner, Jan 26 2020

Formula

a(n) = A007491(n) * A053001(n+1).

Extensions

More terms from Stefan Steinerberger, Nov 20 2007

A243893 a(n) = prime(k-1) with k = n^2 + prime(n)^2.

Original entry on oeis.org

7, 37, 137, 311, 829, 1249, 2269, 2939, 4483, 7411, 8681, 12653, 15877, 17827, 21673, 28087, 35393, 38317, 46957, 53327, 56897, 67493, 75269, 87523, 105143, 115057, 120427, 130811, 136547, 147863, 189067, 202481, 222991, 230393, 267401, 275677
Offset: 1

Views

Author

Freimut Marschner, Jun 14 2014

Keywords

Comments

prime(k-1) is also the largest prime number < (n^2 + prime(n)^2). Remark : Largest prime number < n^2 is A053001. Largest prime number < n^3 is A077037.

Examples

			n=1, 1^2=1, prime(1)^2 = 4, 1 + 4 = 5, 5 - 1= 4, prime(4) = 7 ;
n=2, 2^2=4, prime(2)^2 = 9, 4 + 9= 13, 13 - 1= 12, prime(12) = 37.
		

Crossrefs

Cf. A000290 (squares n^2), A000040 (prime(n)), A001248 (prime(n)^2), A106587 (n^2 + prime(n)^2).

Programs

  • Mathematica
    a[n_]:=Prime[(n^2 + Prime[n]^2) - 1]; Array[a,36] (* Stefano Spezia, Mar 12 2025 *)

Formula

a(n) = prime((n^2 + prime(n)^2) - 1) = prime(A106587(n) - 1).

A101593 a(n) is the number of m <= 2^n which are in A075190, i.e., such that m^2 is exactly at the center between two consecutive primes, or in other words A056929(m) = 0.

Original entry on oeis.org

1, 2, 3, 6, 9, 14, 19, 34, 62, 109, 202, 336, 587, 1100, 2003, 3630, 6784, 12607, 23647, 44206, 83510, 157851, 299810, 571264, 1090986, 2088445, 4004347, 7687694, 14788984, 28496850, 54955214, 106159961
Offset: 1

Views

Author

Zak Seidov and M. F. Hasler, Dec 27 2007

Keywords

Comments

A056929(m) = 0 iff m^2 is an interprime <=> m^2 = (A007491(m^2) + A053001(m^2))/2 = average of the next higher and next lower primes.
From M. F. Hasler, Oct 18 2022: (Start)
The ratio a(n+1)/a(n) oscillates between 1.5 and 2 for the first few values, but then seems to converge to a limit between 1.9 and 2; from n = 19 on these ratios appear to be strictly increasing (from 1.87 at n = 19 to 1.92 at n = 27).
At first sight it seems natural that there are twice as many interprimes of the form f(m) when the upper limit on m is increased by a factor of 2, but this might depend on the function f.
If instead of m^2 we consider the same for m^3, then we find the sequence 0, 1, 1, 3, 5, 8, 18, 29, 52, 86, 136, 223, 421, 758, 1376, 2517, 4616, 8714, 16173, 30414, 57583, 109539, ... which follows roughly the same asymptotic behavior. (End)

Crossrefs

Programs

  • PARI
    a(n)=sum(i=2,2^n,!A056929(i))
    
  • PARI
    a(n)=sum(i=2,2^n,nextprime(i^2)+precprime(i^2)==2*i^2)
    
  • PARI
    t=0;vector(15,n,t+=sum(i=1/2<M. F. Hasler, Oct 18 2022] */
    for(n=16, 30, print1("/* a("n") = */ ", t += sum(i=2^(n-1)+1,2^n, nextprime(i^2)+precprime(i^2)==2*i^2),", "))

Formula

a(1) counts the squares m^2 with m <= 2^n = 2 which are interprimes. The squares 0^2 = 0 and 1^2 = 1 obviously aren't interprimes, so the only such square in that range is m^2 = 2^2 = 4 = (nextprime + precprime)/2 = (3 + 5)/2, so a(1) = 1.
Then for n = 2, up to m <= 2^n = 4 we have the additional squares m^2 = 3^2 = 9 = (7 + 11)/2 (an interprime) and m^2 = 4^2 = 16 <> (13 + 17)/2 = 15, so this m^2 is not an interprime, and a(2) = a(1) + 1 = 2.

Extensions

a(23)-a(25) from Kevin P. Thompson, Nov 26 2021
a(26)-a(28) from M. F. Hasler, Oct 18 2022
a(29)-a(32) from Bill McEachen, Dec 14 2022

A173831 Largest prime < n^4.

Original entry on oeis.org

13, 79, 251, 619, 1291, 2399, 4093, 6553, 9973, 14639, 20731, 28559, 38393, 50599, 65521, 83497, 104971, 130307, 159979, 194479, 234239, 279823, 331769, 390581, 456959, 531383, 614639, 707279, 809993, 923513, 1048573, 1185907, 1336333
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    PrimePrev[n_]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k];f[n_]:=n^4;lst={};Do[AppendTo[lst,PrimePrev[f[n]]],{n,5!}];lst
    NextPrime[Range[2,40]^4,-1] (* Harvey P. Dale, May 05 2018 *)

A180724 a(n) = n^2 + largest prime < n^2.

Original entry on oeis.org

7, 16, 29, 48, 67, 96, 125, 160, 197, 234, 283, 336, 389, 448, 507, 572, 641, 720, 797, 880, 963, 1052, 1147, 1244, 1349, 1456, 1557, 1680, 1787, 1914, 2045, 2176, 2309, 2448, 2587, 2736, 2883, 3032, 3197, 3350, 3523, 3696, 3869, 4042, 4229, 4416, 4601
Offset: 2

Views

Author

Ian Stewart, Sep 18 2010

Keywords

Programs

  • Mathematica
    #+NextPrime[#,-1]&/@(Range[2,50]^2) (* Harvey P. Dale, Apr 08 2023 *)
  • PARI
    a(n) = n^2 + precprime(n^2-1); \\ Michel Marcus, Aug 23 2013

Formula

4 + 3 = 7; 9 + 7 = 16; 16 + 13 = 29; 25 + 23 = 48;
a(n) = n^2+A053001(n). - R. J. Mathar, Sep 19 2010
2n^2 - O(n^1.05) < a(n) < 2n^2. (Probably a much tighter lower bound is true.) - Charles R Greathouse IV, Jan 31 2023

A187918 Largest semiprime < n^2.

Original entry on oeis.org

6, 15, 22, 35, 46, 62, 77, 95, 119, 143, 166, 194, 221, 254, 287, 323, 358, 398, 437, 482, 527, 573, 623, 674, 723, 781, 838, 899, 959, 1018, 1082, 1154, 1219, 1294, 1366, 1441, 1517, 1594, 1679, 1763, 1843, 1934, 2021, 2105, 2206, 2302, 2395, 2498
Offset: 3

Views

Author

Jonathan Vos Post, Mar 15 2011

Keywords

Comments

This is to semiprimes A001358 as A053001 is to primes A000040.

Examples

			Offset is 3 because there is no semiprime less than 2^2 = 4 (as 4 is the smallest semiprime).
a(3) = 6 because 6 is the largest semiprime less than 3^2 = 9 (itself a semiprime), with only the prime 7 and the triprime 8 properly in the [6,9] interval.
a(4) = 15 < 16 = 4^2.
		

Crossrefs

Programs

  • Mathematica
    semiPrimeQ[n_] := Total[FactorInteger[n]][[2]] == 2; Table[k = n^2 - 1; While[! semiPrimeQ[k], k--]; k, {n, 3, 100}] (* T. D. Noe, Mar 15 2011 *)
  • PARI
    issemi(n)=bigomega(2)==2
    a(n)=n*=n; while(!issemi(n--),); n \\ Charles R Greathouse IV, Mar 16 2011

Formula

a(n) = MAX{k in A001358 and k < n^2}.
Previous Showing 11-20 of 25 results. Next