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-10 of 33 results. Next

A113911 Prime numbers not appearing in the nextprime(x^2) sequence A007491.

Original entry on oeis.org

3, 7, 13, 19, 23, 31, 41, 43, 47, 59, 61, 71, 73, 79, 89, 97, 103, 107, 109, 113, 131, 137, 139, 151, 157, 163, 167, 179, 181, 191, 193, 199, 211, 223, 229, 233, 239, 241, 251, 263, 269, 271, 277, 281, 283, 307, 311, 313, 317, 337, 347, 349, 353, 359, 373, 379
Offset: 1

Views

Author

Jorge Coveiro, Jan 29 2006

Keywords

Programs

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Apr 09 2013

Extensions

More terms from Robert G. Wilson v, Jan 30 2006

A014085 Number of primes between n^2 and (n+1)^2.

Original entry on oeis.org

0, 2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 4, 5, 5, 4, 6, 7, 5, 6, 6, 7, 7, 7, 6, 9, 8, 7, 8, 9, 8, 8, 10, 9, 10, 9, 10, 9, 9, 12, 11, 12, 11, 9, 12, 11, 13, 10, 13, 15, 10, 11, 15, 16, 12, 13, 11, 12, 17, 13, 16, 16, 13, 17, 15, 14, 16, 15, 15, 17, 13, 21, 15, 15, 17, 17, 18, 22, 14, 18, 23, 13
Offset: 0

Views

Author

Jon Wild, Jul 14 1997

Keywords

Comments

Suggested by Legendre's conjecture (still open) that for n > 0 there is always a prime between n^2 and (n+1)^2.
a(n) is the number of occurrences of n in A000006. - Philippe Deléham, Dec 17 2003
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
Legendre's conjecture may be written pi((n+1)^2) - pi(n^2) > 0 for all positive n, where pi(n) = A000720(n), [the prime counting function]. - Jonathan Vos Post, Jul 30 2008 [Comment corrected by Jonathan Sondow, Aug 15 2008]
Legendre's conjecture can be generalized as follows: for all integers n > 0 and all real numbers k > K, there is a prime in the range n^k to (n+1)^k. The constant K is conjectured to be log(127)/log(16). See A143935. - T. D. Noe, Sep 05 2008
For n > 0: number of occurrences of n^2 in A145445. - Reinhard Zumkeller, Jul 25 2014

Examples

			a(17) = 5 because between 17^2 and 18^2, i.e., 289 and 324, there are 5 primes (which are 293, 307, 311, 313, 317).
		

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.

Crossrefs

First differences of A038107.
Counts of primes between consecutive higher powers: A060199, A061235, A062517.

Programs

  • Haskell
    a014085 n = sum $ map a010051 [n^2..(n+1)^2]
    -- Reinhard Zumkeller, Mar 18 2012
    
  • Mathematica
    Table[PrimePi[(n + 1)^2] - PrimePi[n^2], {n, 0, 80}] (* Lei Zhou, Dec 01 2005 *)
    Differences[PrimePi[Range[0,90]^2]] (* Harvey P. Dale, Nov 25 2015 *)
  • PARI
    a(n)=primepi((n+1)^2)-primepi(n^2) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from sympy import primepi
    def a(n): return primepi((n+1)**2) - primepi(n**2)
    print([a(n) for n in range(81)]) # Michael S. Branicky, Jul 05 2021

Formula

a(n) = A000720((n+1)^2) - A000720(n^2). - Jonathan Vos Post, Jul 30 2008
a(n) = Sum_{k = n^2..(n+1)^2} A010051(k). - Reinhard Zumkeller, Mar 18 2012
Conjecture: for all n>1, abs(a(n)-(n/log(n))) < sqrt(n). - Alain Rocchelli, Sep 20 2023
Up to n=10^6 there are no counterexamples to this conjecture. - Hugo Pfoertner, Dec 16 2024
Sorenson & Webster show that a(n) > 0 for all 0 < n < 7.05 * 10^13. - Charles R Greathouse IV, Jan 31 2025

A056899 Primes of the form k^2 + 2.

Original entry on oeis.org

2, 3, 11, 83, 227, 443, 1091, 1523, 2027, 3251, 6563, 9803, 11027, 12323, 13691, 15131, 21611, 29243, 47963, 50627, 56171, 59051, 62003, 65027, 74531, 88211, 91811, 95483, 103043, 119027, 123203, 131771, 136163, 140627, 149771, 173891
Offset: 1

Views

Author

Henry Bottomley, Jul 05 2000

Keywords

Comments

Also, primes of the form k^2 - 2k + 3.
Note that all terms after the first two are equal to 11 modulo 72 and that (a(n)-11)/72 is a triangular number, since they have to be 2 more than the square of an odd multiple of 3 to be prime, and if k = 6*m+3 then a(n) = k^2 + 2 = 72*m*(m+1)/2 + 11.
The quotient cycle length is 2 in the continued fraction expansion of sqrt(p) for these primes. E.g.: cfrac(sqrt(6563),6) = 81+1/(81+1/(162+1/(81+1/(162+1/(81+1/(162+`...`)))))). - Labos Elemer, Feb 22 2001
Primes in A059100; except for a(2)=3 a subsequence of A007491 and congruent to 2 modulo 9. For n>2, a(n)=11 (mod 72). - M. F. Hasler, Apr 05 2009

References

  • M. Cerasoli, F. Eugeni and M. Protasi, Elementi di Matematica Discreta, Bologna 1988.
  • Emanuele Munarini and Norma Zagaglia Salvi, Matematica Discreta, UTET, CittaStudiEdizioni, Milano 1997.

Crossrefs

Intersection of A146327 and A000040; intersection of A059100 and A000040.
Cf. A002496.

Programs

  • Magma
    [n: n in PrimesUpTo(175000) | IsSquare(n-2)];  // Bruno Berselli, Apr 05 2011
    
  • Magma
    [ a: n in [0..450] | IsPrime(a) where a is n^2 +2 ]; // Vincenzo Librandi, Apr 06 2011
    
  • Maple
    select(isprime, [seq(t^2+2, t = 0..1000)]); # Robert Israel, Sep 03 2015
  • Mathematica
    Select[ Range[0, 500]^2 + 2, PrimeQ] (* Robert G. Wilson v, Sep 03 2015 *)
  • PARI
    print1("2, 3");forstep(n=3,1e4,6,if(isprime(t=n^2+2),print1(", "t))) \\ Charles R Greathouse IV, Jul 19 2011

Formula

For n>1, a(n) = 72*A000217(A056900(n-2))+11
a(n) = A067201(n)^2 + 2. - M. F. Hasler, Apr 05 2009

A053001 Largest prime < n^2.

Original entry on oeis.org

3, 7, 13, 23, 31, 47, 61, 79, 97, 113, 139, 167, 193, 223, 251, 283, 317, 359, 397, 439, 479, 523, 571, 619, 673, 727, 773, 839, 887, 953, 1021, 1087, 1153, 1223, 1291, 1367, 1439, 1511, 1597, 1669, 1759, 1847, 1933, 2017, 2113, 2207, 2297, 2399, 2477, 2593
Offset: 2

Views

Author

N. J. A. Sloane, Feb 21 2000

Keywords

Comments

Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Legendre's conjecture is equivalent to a(n) > (n-1)^2. - John W. Nicholson, Dec 11 2013

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.

Crossrefs

Programs

  • Haskell
    a053001 = a007917 . a000290  -- Reinhard Zumkeller, Jun 07 2015
    
  • Maple
    [seq(prevprime(i^2),i=2..100)];
  • Mathematica
    Table[Prime[PrimePi[n^2]], {n, 2, 60}] (* Stefan Steinerberger, Apr 01 2006 *)
    Table[NextPrime[n^2, -1], {n, 2, 60}] (* Jean-François Alcover, Oct 14 2013 *)
  • PARI
    a(n) = precprime(n^2) \\ Michel Marcus, Oct 14 2013
    
  • Python
    from sympy import prevprime
    def a(n):  return prevprime(n*n)
    print([a(n) for n in range(2, 52)]) # Michael S. Branicky, Jul 29 2022

Formula

a(n) = A007917(A000290(n)). - Reinhard Zumkeller, Jun 07 2015

Extensions

More terms from James Sellers, Feb 22 2000

A053000 a(n) = (smallest prime > n^2) - n^2.

Original entry on oeis.org

2, 1, 1, 2, 1, 4, 1, 4, 3, 2, 1, 6, 5, 4, 1, 2, 1, 4, 7, 6, 1, 2, 3, 12, 1, 6, 1, 4, 3, 12, 7, 6, 7, 2, 7, 4, 1, 4, 3, 2, 1, 12, 13, 12, 13, 2, 13, 4, 5, 10, 3, 8, 3, 10, 1, 12, 1, 2, 7, 10, 7, 6, 3, 20, 3, 4, 1, 4, 13, 22, 3, 10, 5, 4, 1, 14, 3, 10, 5, 6, 21, 2, 9, 10, 1, 4, 15, 4, 9, 6, 1, 6, 3, 14
Offset: 0

Views

Author

N. J. A. Sloane, Feb 21 2000

Keywords

Comments

Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Record values are listed in A070317, their indices in A070316. - M. F. Hasler, Mar 23 2013
Conjecture: a(n) <= 1+phi(n) = 1+A000010(n), for n>0. This improves on Oppermann's conjecture, which says a(n) < n. - Jianglin Luo, Sep 22 2023

References

  • J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A1.

Crossrefs

Programs

  • Magma
    [NextPrime(n^2) - n^2: n in [0..100]]; // Vincenzo Librandi, Jul 06 2015
    
  • Maple
    A053000 := n->nextprime(n^2)-n^2;
  • Mathematica
    nxt[n_]:=Module[{n2=n^2},NextPrime[n2]-n2]
    nxt/@Range[0,100]  (* Harvey P. Dale, Dec 20 2010 *)
  • PARI
    A053000(n)=nextprime(n^2)-n^2  \\ M. F. Hasler, Mar 23 2013
    
  • Python
    from sympy import nextprime
    def a(n): nn = n*n; return nextprime(nn) - nn
    print([a(n) for n in range(94)]) # Michael S. Branicky, Feb 17 2022

Formula

a(n) = A013632(n^2). - Robert Israel, Jul 06 2015

Extensions

More terms from James Sellers, Feb 22 2000

A014220 Next prime after n^3.

Original entry on oeis.org

2, 2, 11, 29, 67, 127, 223, 347, 521, 733, 1009, 1361, 1733, 2203, 2749, 3389, 4099, 4919, 5839, 6863, 8009, 9277, 10651, 12197, 13829, 15629, 17579, 19687, 21961, 24391, 27011, 29803, 32771, 35951, 39313
Offset: 0

Views

Author

Keywords

Comments

According to Borwein's Remark 1, this is an example of a sequence of primes whose mean value is in [0,1]. - T. D. Noe, Sep 15 2008
More precisely, Borwein, Choi and Coons remark that the generalized Liouville function for this sequence has mean value in (0,1). - Jonathan Sondow, May 19 2013

Crossrefs

Programs

Formula

a(n) < (n+1)^3 for n sufficiently large, by Ingham's theorem in A060199. - Jonathan Sondow, May 19 2013

A056929 Difference between n^2 and average of smallest prime greater than n^2 and largest prime less than n^2.

Original entry on oeis.org

0, 0, 1, -1, 2, -1, 0, 0, 1, 1, 0, -1, 1, 0, 2, 1, 0, -2, 1, 0, 1, -3, 2, 0, 1, -1, 4, -5, 3, 1, -2, 0, -2, -1, 2, -1, 1, 4, 1, 0, -4, -5, -5, 3, -5, -1, 1, -4, 10, 0, 1, -2, 3, -5, 7, 9, -2, 1, 0, -2, 4, -9, 0, 1, 3, 1, -5, -10, 4, -4, 0, 1, 2, -6, 12, -4, 0, 3, -9, 3, -2, -2, 6, 1, -6, 2, -3
Offset: 2

Views

Author

Henry Bottomley, Jul 12 2000

Keywords

Comments

Conjecture: the most frequent value will be 1 (including sequence variants with any even power n^2k). - Bill McEachen, Dec 12 2022

Examples

			a(4)=1 because smallest prime greater than 4^2 is 17, largest prime less than 4^2 is 13, average of 17 and 13 is 15 and 16-15=1.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A056929 := n-> n^2-(prevprime(n^2)+nextprime(n^2))/2);
  • Mathematica
    Array[# - Mean@ {NextPrime[#], NextPrime[#, -1]} &[#^2] &, 87, 2] (* Michael De Vlieger, May 20 2018 *)
  • PARI
    a(n) = n^2 - (nextprime(n^2) + precprime(n^2))/2; \\ Michel Marcus, May 20 2018

Formula

a(n) = A000290(n) - A056928(n).
a(n) = (A056927(n) - A053000(n))/2.

Extensions

More terms from James Sellers, Jul 13 2000

A065383 a(n) = smallest prime >= n*(n + 1)/2.

Original entry on oeis.org

2, 2, 3, 7, 11, 17, 23, 29, 37, 47, 59, 67, 79, 97, 107, 127, 137, 157, 173, 191, 211, 233, 257, 277, 307, 331, 353, 379, 409, 439, 467, 499, 541, 563, 599, 631, 673, 709, 743, 787, 821, 863, 907, 947, 991, 1039, 1087, 1129, 1181, 1229, 1277, 1327, 1381, 1433
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 05 2001

Keywords

Comments

Besides 7, terms exclude the greater of the twin primes (A006512). - Bill McEachen, Dec 01 2022

Crossrefs

See A097050 for another version.
Cf. A000217.

Programs

  • Haskell
    a065383 n = head $ dropWhile (< a000217 n) a000040_list
    -- Reinhard Zumkeller, Aug 03 2012
  • Mathematica
    PrimeNext[n_]:=Module[{k=n},While[ !PrimeQ[k],k++ ];k];f[n_]:=n*(n+1)/2;lst={};Do[AppendTo[lst,PrimeNext[f[n]]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Feb 26 2010 *)
    NextPrime/@(Accumulate[Range[0,60]]-1) (* Harvey P. Dale, Jul 31 2012 *)
  • PARI
    { for (n=0, 1000, write("b065383.txt", n, " ", nextprime(n*(n + 1)/2)) ) } \\ Harry J. Smith, Oct 17 2009
    

Extensions

Edited by N. J. A. Sloane, Nov 21 2008

A056931 Difference between n-th oblong (promic) number, n(n+1), and the average of the smallest prime greater than n^2 and the largest prime less than (n+1)^2.

Original entry on oeis.org

0, 0, 0, 0, 0, -1, -1, 0, 3, -1, -2, -1, 0, 1, 2, 1, -3, -2, 0, 1, 1, -4, 2, -2, 0, 3, -1, 0, 0, -2, -3, 0, -3, 0, 0, 0, 3, 0, 5, -4, -6, -5, -3, 0, -6, 1, -2, 6, 2, -2, 1, -2, 0, 1, 9, 0, 2, -2, -3, 2, -1, -9, 1, 1, 2, -1, -6, -6, -1, -3, 0, 0, 0, 6, -1, -3, 3, -2, -7, 1, -2, 1, 2, -1, -4
Offset: 2

Views

Author

Henry Bottomley, Jul 12 2000

Keywords

Comments

a(1)=-0.5 which is not an integer

Examples

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

Crossrefs

Programs

  • Maple
    with(numtheory): A056931 := n-> n*(n+1)-(prevprime((n+1)^2)+nextprime(n^2))/2);

Formula

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

Extensions

More terms from James Sellers, Jul 13 2000

A060272 Distance from n^2 to closest prime.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 6, 5, 2, 1, 2, 1, 4, 7, 2, 1, 2, 3, 6, 1, 6, 1, 2, 3, 2, 7, 6, 3, 2, 3, 2, 1, 2, 3, 2, 1, 12, 5, 2, 3, 2, 3, 2, 5, 2, 3, 8, 3, 6, 1, 2, 1, 2, 3, 10, 7, 2, 3, 2, 3, 4, 1, 4, 3, 2, 3, 2, 5, 4, 1, 2, 3, 2, 5, 6, 3, 2, 5, 6, 1, 4, 3, 4, 3, 2, 1, 6, 3, 2, 1, 4, 5, 4, 3, 2, 7, 8, 5, 2
Offset: 1

Views

Author

Labos Elemer, Mar 23 2001

Keywords

Examples

			n=1: n^2=1 has next prime 2, so a(1)=1;
n=11: n^2=121 is between primes {113,127} and closer to 127, thus a(11)=6.
		

Crossrefs

Programs

  • Maple
    seq((s-> min(nextprime(s)-s, `if`(s>2, s-prevprime(s), [][])))(n^2), n=1..256);  # edited by Alois P. Heinz, Jul 16 2017
  • Mathematica
    Table[Function[k, Min[k - #, NextPrime@ # - k] &@ If[n == 1, 0, Prime@ PrimePi@ k]][n^2], {n, 103}] (* Michael De Vlieger, Jul 15 2017 *)
    Min[#-NextPrime[#,-1],NextPrime[#]-#]&/@(Range[110]^2) (* Harvey P. Dale, Jun 26 2021 *)
  • PARI
    a(n) = if (n==1, nextprime(n^2) - n^2, min(n^2 - precprime(n^2), nextprime(n^2) - n^2)); \\ Michel Marcus, Jul 16 2017

Formula

a(n) = abs(A000290(n) - A113425(n)) = abs(A000290(n) - A113426(n)). - Reinhard Zumkeller, Oct 31 2005
Showing 1-10 of 33 results. Next