OFFSET
1,1
COMMENTS
Nearest prime program by Ignacio Grande in LinkedIn Mathematica users group as answer to my question.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) local x, q, r, v;
x:= (ithprime(n)/2)^4;
q:= nextprime(floor(x));
r:= prevprime(ceil(x));
v:= (q+r)/2;
if v > x then r else q fi
end proc:
f(1):= 2:
map(f, [$1..50]); # Robert Israel, Aug 04 2019
MATHEMATICA
nearestPrime[n_Integer] := Module[{n2}, n2 = (Prime[n]/2)^4;
If[n2 < 2, {2}, Nearest[Prime[PrimePi[n2] + {0, 1}], n2, 1]][[1]]]; nearestPrime /@ Range[20]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Jan 22 2012
STATUS
approved