OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The three closest primes to 113 are 109 (difference = 4), 107 (difference = 6) and 103 (difference = 10). 109, 107 and 103 are all smaller than 113, so 113 is in the list.
MATHEMATICA
NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; ps = {0, 0, 0, 0, 1}; Do[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; If[ ps[[ -1]] - ps[[ -2]] > ps[[ -2]] - ps[[1]], Print[ ps[[ -2]]]], {n, 1, 756}]
Select[Partition[Prime[Range[800]], 5, 1], #[[4]]-#[[1]]<#[[5]]-#[[4]]&][[All, 4]] (* Harvey P. Dale, Mar 14 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Neil Fernandez, Oct 10 2002
EXTENSIONS
Edited by Robert G. Wilson v, Oct 11 2002
STATUS
approved