OFFSET
1,1
COMMENTS
Note that the gap = 4 is partitioned either as 2+2 or as 3+1; 1+3 never occurs since n^2-1 is composite if n>2.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
k = 3 is a term since, k^2 = 9 is surrounded by the closest primes: {7,[9],11}.
k = 10 is a term since k^2 = 100 is surrounded by {97,[100],101}.
MATHEMATICA
Select[Range[3, 1500], NextPrime[#^2] == NextPrime[#^2, -1] + 4 &] (* Giovanni Resta, May 26 2018 *)
PROG
(PARI) isok(n) = nextprime(n^2) - precprime(n^2) == 4; \\ Michel Marcus, May 26 2018
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Labos Elemer, Jan 09 2004
STATUS
approved