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

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, ", "))

A365706 For n >= 1, a(n) is the least prime p such that the arithmetic mean of (n + 1) consecutive primes starting with p is a perfect square, or a(n) = -1 if no such p exists.

Original entry on oeis.org

3, 2393, 5, 827, 53, 271, 1063, 23993, 197, 29, 193, 2143, 359, 6829, 397, 17, 433, 661, 2837, 25171, 13597, 563, 10301, 1814233, 51427, 6781, 316817, 7477, 71, 238919, 11491, 3109, 42293, 38653, 6263, 13043, 474497, 21433, 13, 21419, 16963, 5119, 705209, 183761
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 15 2023

Keywords

Comments

Does a(n) exists for all n >= 1 ?
From David A. Corneth, Oct 18 2023: (Start)
Let s(n) be the sum of n + 1 consecutive primes starting with a(n). Then s(n)/(n+1) = m^2 for some positive integer m.
This means s(n) = (n + 1) * m^2. If n is even then m is odd if a(n) > 2.
As s(n) >= A007504(n) we have m^2 >= s(n)/(n+1) >= A007504(n)/(n+1) i.e. m >= sqrt(A007504(n)/(n+1)). So for some m we can see if m^2 * (n+1) is the sum of n+1 consecutive primes and if so a(n) is the smallest prime of these n+1 primes after testing all candidates up to m. (End)
s(n) = (n + 1)* a(n) + Sum_{i=0..(n-1)} (n-i)*g(i+1), thus we have Sum_{i=0..(n-1)} (n-i)*g(i+1) = (m^2 - a(n)) * (n + 1), g(j) are the n gaps between n + 1 consecutive primes. - Ctibor O. Zizka, Oct 18 2023

Examples

			n = 2: we search for the least prime(i) such that (prime(i) + prime(i + 1) + prime(i + 2))/3 = m^2, m an integer. This is valid for (2393 + 2399 + 2411)/3 = 49^2 thus a(2) = 2393.
		

Crossrefs

Programs

  • PARI
    isok(x) = (denominator(x)==1) && issquare(x);
    a(n) = my(k=1); while (!isok((vecsum(primes(k+n))-vecsum(primes(k-1)))/(n+1)), k++); prime(k); \\ Michel Marcus, Oct 16 2023
    
  • PARI
    a(n) = {my(m = n + 1, ps = vector(m, i, prime(i)), s); forprime(p = ps[m] + 1, , s = vecsum(ps); if(!(s % m) && issquare(s/m), return(ps[1])); ps = concat(vecextract(ps, "^1"), p));} \\ Amiram Eldar, Oct 18 2023

Extensions

More terms from Amiram Eldar, Oct 18 2023

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.

A173832 Largest prime < n^5.

Original entry on oeis.org

31, 241, 1021, 3121, 7759, 16787, 32749, 59029, 99991, 161047, 248827, 371291, 537811, 759371, 1048573, 1419839, 1889561, 2476081, 3199997, 4084081, 5153623, 6436327, 7962607, 9765619, 11881357, 14348891, 17210353, 20511143, 24299981
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    PrimePrev[n_]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k];f[n_]:=n^5;lst={};Do[AppendTo[lst,PrimePrev[f[n]]],{n,5!}];lst
    NextPrime[Range[2, 30]^5, -1]  (* Ray Chandler, Dec 08 2018 *)

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
Previous Showing 21-25 of 25 results.