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.

A056927 Difference between n^2 and largest prime less than n^2.

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 3, 2, 3, 8, 5, 2, 3, 2, 5, 6, 7, 2, 3, 2, 5, 6, 5, 6, 3, 2, 11, 2, 13, 8, 3, 2, 3, 2, 5, 2, 5, 10, 3, 12, 5, 2, 3, 8, 3, 2, 7, 2, 23, 8, 5, 6, 7, 2, 15, 20, 3, 12, 7, 2, 11, 2, 3, 6, 7, 6, 3, 2, 11, 2, 5, 6, 5, 2, 27, 2, 5, 12, 3, 8, 5, 6, 13, 6, 3, 8, 3, 2, 7, 8, 3, 2, 5, 12, 7, 6, 3
Offset: 2

Views

Author

Henry Bottomley, Jul 12 2000

Keywords

Comments

Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2 is equivalent to the conjecture that a(n) < 2n-1 for all n>1.
Will the most common subsequence seen be (2,3,2)? - Bill McEachen, Jan 30 2011

Examples

			a(4)=3 because largest prime less than 4^2 is 13 and 16-13=3.
		

Crossrefs

Programs

  • Maple
    A056927 := n-> n^2-prevprime(n^2); seq(A056927(n), n=2..100);
  • Mathematica
    Table[n2=n^2;n2-NextPrime[n2,-1],{n,2,100}] (* Vladimir Joseph Stephan Orlovsky, Mar 09 2011 *)
  • PARI
    {my(maxx=10000);n=2;ptr=2;while(n<=maxx,q=n^2;pp=precprime(q); diff=q-pp;print(ptr,"  ",diff);n++;ptr++ );} \\ Bill McEachen, May 07 2014

Formula

a(n) = A000290(n)-A053001(n).

Extensions

More terms from James Sellers, Jul 13 2000

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

A056928 Average of the smallest prime greater than n^2 and the largest prime less than n^2.

Original entry on oeis.org

4, 9, 15, 26, 34, 50, 64, 81, 99, 120, 144, 170, 195, 225, 254, 288, 324, 363, 399, 441, 483, 532, 574, 625, 675, 730, 780, 846, 897, 960, 1026, 1089, 1158, 1226, 1294, 1370, 1443, 1517, 1599, 1681, 1768, 1854, 1941, 2022, 2121, 2210, 2303, 2405, 2490
Offset: 2

Views

Author

Henry Bottomley, Jul 12 2000

Keywords

Examples

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

Crossrefs

Programs

Formula

a(n) = (A007491(n) - A053001(n))/2.
a(n) = A000290(n) + (A053000(n) - A056927(n))/2.
a(n) = A000290(n) - A056929(n).

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)
Showing 1-4 of 4 results.