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

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)

A070316 Numbers n such that nextprime(n^2)-n^2 (n>=1) sets a new record.

Original entry on oeis.org

1, 3, 5, 11, 18, 23, 42, 63, 69, 102, 128, 143, 226, 254, 349, 370, 590, 757, 833, 873, 1110, 1165, 5018, 14908, 49495, 87598, 106359, 185179, 269697, 558269, 1070246, 1673629, 4292936, 43957056, 148793437, 982920306, 1569443693, 4556758439
Offset: 1

Views

Author

Donald S. McDonald, May 11 2002

Keywords

Examples

			nextprime(63^2) - 63^2 = 3989 - 3969 = 20, giving the terms 63 in the present sequence and 20 in A070317.
		

Crossrefs

Positions of record values in A053000 for n >= 1. Cf. A070317.

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; d = 0; Do[m = n; a = NextPrim[n^2] - n^2; If[a > d, d = a; Print[n]], {n, 1, 10^8}]
  • PARI
    A070316(n,show_all=0)={my(k=0,r=0);for(n=1,n,until(nextprime(k++^2)-k^2>r ,); r=nextprime(k^2)-k^2; show_all&print1(k","));k} \\ M. F. Hasler, Mar 23 2013

Extensions

Edited by N. J. A. Sloane and Robert G. Wilson v, May 11 2002
More terms from Ralf Stephan, Oct 14 2002
Further terms from Charles R Greathouse IV, Jun 16 2007
Typo in a(38) corrected by M. F. Hasler, Mar 23 2013

A144831 (n+1)^2 - (smallest prime > n^2).

Original entry on oeis.org

2, 4, 5, 8, 7, 12, 11, 14, 17, 20, 17, 20, 23, 28, 29, 32, 31, 30, 33, 40, 41, 42, 35, 48, 45, 52, 51, 54, 47, 54, 57, 58, 65, 62, 67, 72, 71, 74, 77, 80, 71, 72, 75, 76, 89, 80, 91, 92, 89, 98, 95, 102, 97, 108, 99, 112, 113, 110, 109, 114, 117, 122, 107, 126, 127, 132, 131
Offset: 1

Views

Author

Enoch Haga, Sep 21 2008

Keywords

Comments

Suggested by Conjecture 60 in Carlos Rivera's The Prime Puzzles & Problems Connection.
Legendre's conjecture that there is always a prime between n^2 and (n+1)^2 is equivalent to a(n) >= 0 for all n. As the conjecture is still opened, it is not proved that a(n) is nonn, although the keyword is automatically added. - Jean-Christophe Hervé, Oct 26 2013

Examples

			a(2)=4 because n=2, 2^2=4 and (2+1)^2=9. The gap in which primes are to be found is 4 - 9. Next prime=5 and 9-5=4. For a(3)=5, 3^2=9 and (3+1)^2=16. Next prime=11 and 16-11=5.
		

Crossrefs

Programs

  • Mathematica
    Table[n^2-NextPrime[(n-1)^2],{n,2,70}] (* Harvey P. Dale, Jan 22 2019 *)
  • PARI
    a(n) = (n+1)^2 - nextprime(n^2); \\ Michel Marcus, Jun 08 2014

Formula

Calculate n^2 and (n+1)^2, e.g. 4 - 9. Find the next prime following n^2 and subtract from (n+1)^2. Next prime is 5 so 9-5=4, the distance from next prime to (n+1)^2.
a(n) = (n+1)^2 - A007491(n).

Extensions

Definition rewritten by N. J. A. Sloane, Sep 28 2008
Definition rewritten by Jean-Christophe Hervé, Oct 26 2013

A070317 Record values of nextprime(n^2)-n^2, cf. A070316.

Original entry on oeis.org

1, 2, 4, 6, 7, 12, 13, 20, 22, 23, 27, 28, 33, 37, 42, 43, 49, 52, 54, 58, 71, 108, 147, 163, 202, 225, 232, 270, 292, 328, 331, 388, 541, 613, 712, 773, 780, 868, 869, 964, 993, 1024, 1045, 1065, 1083
Offset: 1

Views

Author

Donald S. McDonald, May 11 2002

Keywords

Examples

			nextprime(63^2) - 63^2 = 3989 - 3969 = 20, giving the terms 63 in A070316 and 20 in the present sequence.
		

Crossrefs

Cf. A070316.

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; d = 0; Do[m = n; a = NextPrim[n^2] - n^2; If[a > d, d = a; Print[n]], {n, 1, 10^8}]

Formula

a(n) = A053000(A070316(n)). - M. F. Hasler, May 05 2013

Extensions

Edited by N. J. A. Sloane and Robert G. Wilson v, May 11 2002
More terms from Ralf Stephan, Oct 14 2002
More terms from Charles R Greathouse IV, Jun 16 2007, Aug 08 2007
More terms (using A070316) from M. F. Hasler, May 05 2013

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

A144832 Distance from nxtprm(n^2) to (n+1)^2 in A144831 is prime.

Original entry on oeis.org

2, 5, 7, 11, 17, 17, 23, 29, 31, 41, 47, 67, 71, 71, 89, 89, 97, 113, 109, 107, 127, 131, 137, 157, 167, 173, 173, 191, 197, 193, 197, 227, 233, 227, 251, 257, 271, 293, 271, 307, 313, 317, 331, 349, 353, 383, 383, 409, 419, 431, 449, 463, 467, 487, 503, 509
Offset: 1

Views

Author

Enoch Haga, Sep 22 2008

Keywords

Examples

			a(2)=5 because 3^2=9 and 4^2=16. Nxtprm(3^2)=11 and 16-11=5, a prime.
		

Crossrefs

Formula

Terms in this sequence are from A144831 iff the distance from nxtprm n^2 to (n+1)^2 is prime.

A362222 Slowest increasing sequence where a(n) + n^2 is a prime.

Original entry on oeis.org

1, 3, 4, 7, 12, 17, 18, 19, 20, 27, 28, 29, 30, 31, 32, 37, 42, 43, 48, 49, 50, 57, 58, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 93, 96, 97, 100, 103, 104, 105, 124, 133, 138, 147, 148, 153, 154, 163, 166, 171, 184, 193, 196, 197, 198, 205
Offset: 1

Views

Author

Angad Singh, Apr 11 2023

Keywords

Examples

			a(2) = 3, since the smallest number greater than all the previous terms which gives a prime when added to 2^2 is 3.
		

Crossrefs

Programs

  • Maple
    R:= 1: t:= 1:
    for n from 2 to 100 do
      t:= nextprime(t+n^2)-n^2;
      R:= R,t
    od:
    R; # Robert Israel, Apr 11 2023
  • Mathematica
    a[n_] := a[n] = Module[{k = a[n - 1] + 1}, While[! PrimeQ[n^2 + k], k++]; k]; a[0] = 0; Array[a, 100] (* Amiram Eldar, Apr 12 2023 *)
  • PARI
    seq(n)={my(a=vector(n), p=0); for(n=1, #a, p++; while(!isprime(p+n^2), p++); a[n]=p); a} \\ Andrew Howroyd, Apr 11 2023
    
  • Python
    from sympy import nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        an = 1
        for n in count(2):
            yield an
            an = nextprime(an + n**2) - n**2
    print(list(islice(agen(), 62))) # Michael S. Branicky, Apr 16 2023

A187409 n^2 + nextprime(n^2).

Original entry on oeis.org

3, 9, 20, 33, 54, 73, 102, 131, 164, 201, 248, 293, 342, 393, 452, 513, 582, 655, 728, 801, 884, 971, 1070, 1153, 1256, 1353, 1462, 1571, 1694, 1807, 1928, 2055, 2180, 2319, 2454, 2593, 2742, 2891, 3044, 3201, 3374, 3541, 3710, 3885, 4052, 4245, 4422, 4613
Offset: 1

Views

Author

Keywords

Examples

			1^2+2=3, 2^2+5=9, 3^2+11=20,..
		

Crossrefs

Programs

  • Mathematica
    Table[n2=n^2; NextPrime[n2]+n2, {n,100}]
    #+NextPrime[#]&/@(Range[100]^2) (* Harvey P. Dale, Sep 20 2022 *)

A276556 a(n) = smallest prime p such that (smallest prime > p^2) == p^2 + 4n^2, n>=1.

Original entry on oeis.org

5, 281, 461, 4937, 25367, 75997, 1193909, 3464389, 48591863, 23674667, 22486333, 1648510979, 12708853771, 25139472583, 53498475287
Offset: 1

Views

Author

Zak Seidov, Apr 18 2017

Keywords

Examples

			5^2+4*1^2=29, 281^2+4*2^2=78977, 461^2 + 4*3^2=212557 (all prime).
		

Crossrefs

Programs

  • Mathematica
    Table[p = 2; While[NextPrime[p^2] != p^2 + 4 n^2, p = NextPrime@ p]; p, {n, 8}] (* Michael De Vlieger, Apr 22 2017 *)
  • PARI
    a(n) = {forprime(p=2, , if (nextprime(p^2+1) == p^2 + 4*n^2, return (p)););} \\ Michel Marcus, Apr 19 2017

Extensions

a(13)-a(15) from Rémy Sigrist, Apr 28 2017
Previous Showing 11-19 of 19 results.