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

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

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

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

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)

A133450 Difference between 4*n^2 and the average of the two prime numbers which bracket this number.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			a(1)=0 because 4 - (3 + 5)/2 = 0
a(2)=1 because 16 - (13 + 17)/2 = 1
a(3)=2 because 36 - (31 + 37)/2 = 2
a(4)=0 because 64 - (61 + 67)/2 = 0
a(5)=1 because 100 - (97 + 101)/2 = 1
		

Crossrefs

Programs

  • Mathematica
    Table[n^2-(Prime[PrimePi[n^2]]+Prime[PrimePi[n^2]+1])/2,{n,2,200,2}] (* Zak Seidov *)
    diff4[n_]:=Module[{x=4n^2},x-(NextPrime[x]+NextPrime[x,-1])/2]; Array[ diff4,90] (* Harvey P. Dale, Aug 31 2017 *)
  • PARI
    A133450(n)=4*n^2-(precprime(4*n^2)+nextprime(4*n^2))/2 \\ M. F. Hasler, Dec 26 2007

Formula

a(n) = A056929(2n). - M. F. Hasler, Dec 26 2007

Extensions

Corrected and extended by Zak Seidov, Dec 23 2007
Edited by N. J. A. Sloane, Dec 23 2007
Showing 1-6 of 6 results.