OFFSET
2,1
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.
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 2..10000
MATHEMATICA
a[n_]:=(NextPrime[(n+1)^2] - NextPrime[n^2, -1])/2; Array[a, 67, 2] (* Stefano Spezia, Jan 24 2025 *)
PROG
(PARI) a379444(n) = (nextprime((n+1)^2) - precprime(n^2))/2
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hugo Pfoertner, Dec 23 2024
STATUS
approved
