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

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

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

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)

A309726 Numbers k such that k^2 - 12 is prime.

Original entry on oeis.org

5, 7, 11, 13, 17, 19, 25, 29, 35, 41, 49, 53, 59, 61, 79, 85, 91, 95, 97, 103, 107, 113, 119, 121, 137, 139, 145, 149, 163, 169, 173, 179, 181, 185, 191, 205, 209, 227, 233, 235, 245, 251
Offset: 1

Views

Author

Daniel Starodubtsev, Aug 14 2019

Keywords

Comments

All terms are odd and not divisible by 3.

Examples

			11 is in the sequence because 11^2 - 12 = 109, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[5,301,2],PrimeQ[#^2-12]&] (* Harvey P. Dale, Dec 23 2019 *)
  • PARI
    select(n->isprime(n^2-12), [1..1000]) \\ Andrew Howroyd, Aug 14 2019

Formula

If A056927(k) = 12, then k is a term. - A.H.M. Smeets, Aug 15 2019

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 *)

A253474 Numbers n such that the difference between n^2 and largest prime less than n^2 is not prime.

Original entry on oeis.org

2, 11, 17, 23, 25, 31, 39, 41, 45, 51, 53, 56, 57, 59, 65, 67, 73, 76, 79, 81, 83, 85, 87, 91, 95, 97, 99, 100, 101, 105, 109, 111, 113, 115, 123, 125, 129, 133, 137, 141, 143, 147, 149, 151, 153, 154, 157, 159, 163, 165, 167, 170, 171, 175, 179, 181, 185, 187, 189, 193, 195, 197, 199, 201, 203, 207, 209, 213, 215, 219, 221, 225
Offset: 1

Views

Author

Keywords

Comments

Indices of terms in A056927 that are not prime.

Examples

			a(1) = 2, since 2^2 - 3 = 1.
a(2) = 11, since 11^2 - 113 = 8.
a(3) = 17, since 17^2 - 283 = 6.
a(4) = 23, since 23^2 - 523 = 6.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := n^2 - NextPrime[n^2, -1]; Select[Range[2, 230], !PrimeQ[f[#]] &]
  • PARI
    lista(nn) = for (n=2, nn, if (!isprime(n^2-precprime(n^2)), print1(n, ", "))); \\ Michel Marcus, Mar 22 2015
Showing 1-8 of 8 results.