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

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

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

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.

A158061 a(1)=2, a(n+1) is the smallest prime > n^smallest digit of a(n).

Original entry on oeis.org

2, 2, 5, 251, 5, 3137, 7, 823547, 67, 531457, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 401, 2, 487, 279847, 577, 9765629, 677, 387420499, 2, 853, 27011, 2, 1031, 2, 1163, 37, 46663, 50671, 2, 1523, 41, 43, 74093, 2, 1949, 47, 4477457, 4879687, 5308417, 2
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 12 2009

Keywords

Examples

			2, 2(>1=1^2), 5(>4=2^2), 251(>241=3^5), 5(>4=4^1), 3137(>3125=5^5), 7(>6=6^1).
		

Crossrefs

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,NextPrime[(n+1)^Min[IntegerDigits[a]]]}; Join[ {2},NestList[ nxt,{1,2},50][[All,2]]] (* Harvey P. Dale, Nov 18 2021 *)

Extensions

More terms from R. J. Mathar, Mar 17 2009
Edited by Charles R Greathouse IV, Mar 25 2010

A181616 a(1)=5; thereafter a(2n) = nextprime(a(2n-1)^2), a(2n+1) = nextprime(floor(2*a(2n)/(a(2n-1) + 1))) where nextprime(.) is A007918(.).

Original entry on oeis.org

5, 29, 11, 127, 23, 541, 47, 2213, 97, 9413, 193, 37253, 389, 151337, 787, 619373, 1579, 2493259, 3163, 10004573, 6329, 40056253, 12659, 160250297, 25321, 641153069, 50647, 2565118639, 101293, 10260271859, 202591, 41043113401, 405199
Offset: 1

Views

Author

Bill McEachen, Jan 30 2011

Keywords

Comments

This gives a sawtooth log plot a bit reminiscent of Goldbach's comet, with wave frequency and amplitude increasing indefinitely. I started at 5 for no particular reason.
The two "lines" in the graph approach ratio 2.0 and 4.0 respectively for consecutive terms. The two are then (5, 11, 23, 47, ...) and (29, 127, 541, 2213, ...). - Bill McEachen, Sep 27 2013

Examples

			Beginning at 5 (n=1), a(2) via nextprime(5^2) = 29.
Divisor = ceiling(5/2) = 3 so a(3) = nextprime(floor(29/3)) = 11.
Then repeat: a(4) via nextprime(11^2) = 127.
Divisor = ceiling(11/2) = 6 so a(5) = nextprime(floor(127/6)) = 23.
		

Programs

  • Maple
    A007491 := proc(n) nextprime(n^2) ; end proc:
    A181616 := proc(n) option remember; if n = 1 then 5; elif type(n,'even') then A007491(procname(n-1)) ; else 2*procname(n-1)/(procname(n-2)+1) ; nextprime(floor(%)) ; end if; end proc: # R. J. Mathar, Feb 09 2011
  • Mathematica
    a[1] = 5; a[n_] := a[n] = If[OddQ@ n, NextPrime[ a[n - 1]/Ceiling[ a[n - 2]/2]], NextPrime[ a[n - 1]^2]]; Array[a, 33]
  • PARI
    \\ example call newseq9(2,50) to use square power, 1st 50 terms
    \\  I never tried any power but 2
    newseq9(a,iend)=
    {
    a=floor(a);
    if(a<2,a=2);
    i5=5;
    print(i5);
    for(n=1,iend,
      i6=nextprime(i5^a);
      b=ceil(i5/2);   \\ vary as f{i5}
      i7=nextprime(floor(i6/b));
      print(i6);
      print(i7);
      i5=i7
    );  \\end FOR
    print("Designed pgm exit (a,b) ...",a," , ",b);
    }

A187872 Second smallest prime after 2^n.

Original entry on oeis.org

3, 5, 7, 13, 19, 41, 71, 137, 263, 523, 1033, 2063, 4111, 8219, 16417, 32779, 65539, 131111, 262151, 524341, 1048589, 2097211, 4194329, 8388619, 16777289, 33554473, 67108913, 134217773, 268435463, 536870951, 1073741831, 2147483693
Offset: 0

Views

Author

Keywords

Examples

			2^2=4, second smallest prime=7;
2^3=8, second smallest prime=13; ..
		

Crossrefs

Programs

  • Maple
    seq(nextprime(nextprime(2^n)),n=0..100); # Robert Israel, Nov 04 2020
  • Mathematica
    NextPrime[2^Range[0,100], 2]
  • PARI
    a(n) = nextprime(nextprime(2^n+1)+1); \\ Michel Marcus, Nov 05 2020

A187873 Second smallest prime after n^2.

Original entry on oeis.org

3, 3, 7, 13, 19, 31, 41, 59, 71, 89, 103, 131, 151, 179, 199, 229, 263, 307, 337, 373, 409, 449, 491, 547, 587, 641, 683, 739, 797, 857, 911, 971, 1033, 1093, 1171, 1231, 1301, 1381, 1451, 1531, 1607, 1697, 1783, 1867, 1951, 2029
Offset: 0

Views

Author

Keywords

Comments

From Robert Israel, Dec 18 2018: (Start)
Oppermann's conjecture implies a(n) < (n+1)^2 for n > 0.
For n > 1, a(n) >= n^2 + 3, with equality for n in A080149. (End)

Examples

			2^2=4, second smallest prime=7;
3^2=9, second smallest prime=13; ..
		

Crossrefs

Programs

  • Maple
    seq(nextprime(nextprime(n^2)),n=0..50); # Robert Israel, Dec 18 2018
  • Mathematica
    NextPrime[Range[0,100]^2, 2]

A236627 Number of positive integers <= sqrt(n) not dividing n.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Feb 05 2014

Keywords

Comments

It appears that the indices of the zeros in the sequence are in A018253.

Crossrefs

Programs

  • PARI
    a(n) = sum(i=1, sqrtint(n), (n % i) != 0); \\ Michel Marcus, Mar 16 2014

Formula

a(n) = A000196(n) - A038548(n) = A160812(n)/2.

A331698 a(n) = (1/2) * ((greatest prime < (n+1)^2) - (least prime > n^2)) for n >= 2.

Original entry on oeis.org

1, 1, 3, 1, 5, 4, 6, 7, 6, 6, 9, 10, 13, 12, 13, 12, 14, 15, 19, 18, 18, 15, 21, 21, 25, 20, 26, 17, 23, 27, 28, 31, 30, 31, 35, 33, 32, 37, 34, 33, 35, 36, 34, 43, 39, 42, 45, 33, 45, 45, 48, 45, 53, 42, 46, 55, 49, 51, 56, 53, 60, 52, 60, 60, 63, 64, 61, 53
Offset: 2

Views

Author

Hugo Pfoertner, Jan 27 2020

Keywords

Examples

			a(2) = 1 because 7 is the greatest prime < 3^2 and 5 is the least prime > 2^2. (7-5)/2 = 1.
		

Crossrefs

Programs

  • PARI
    for(n=2, 69, print1((precprime((n+1)^2)-nextprime(n^2))/2, ", "))

A379444 a(n) is the difference between the least prime > (n+1)^2 and the largest prime < n^2, divided by 2.

Original entry on oeis.org

4, 5, 8, 7, 11, 10, 11, 11, 15, 18, 17, 15, 17, 17, 21, 24, 25, 21, 23, 24, 31, 27, 30, 29, 30, 30, 40, 34, 40, 39, 35, 38, 38, 37, 41, 40, 42, 45, 48, 54, 51, 51, 47, 56, 50, 51, 57, 52, 66, 57, 60, 57, 64, 57, 65, 71, 65, 69, 67, 64, 78, 66, 68, 69, 72, 77, 81
Offset: 2

Views

Author

Hugo Pfoertner, Dec 23 2024

Keywords

Comments

2*a(n) would be the gap needed between consecutive primes to provide a counterexample to Legendre's conjecture that there is always a prime between n^2 and (n+1)^2. The gaps actually observed are significantly smaller; see A378904 for comparison.

Crossrefs

Programs

  • Mathematica
    a[n_]:=(NextPrime[(n+1)^2] - NextPrime[n^2,-1])/2; Array[a,67,2] (* Stefano Spezia, Jan 24 2025 *)
  • PARI
    a379444(n) = (nextprime((n+1)^2) - precprime(n^2))/2

Formula

a(n) = (A007491(n+1) - A053001(n))/2.
a(n) >= n + 2.
Previous Showing 21-30 of 33 results. Next