OFFSET
0,1
LINKS
Eric Weisstein's World of Mathematics, Nearest Prime
MATHEMATICA
a[n_] := (np = NextPrime[n]; pp = NextPrime[np, -1]; Which[np > 2n - pp, pp, np < 2n - pp, np, True, np]); a[0] = a[1] = 2; Table[a[n], {n, 0, 71}] (* Jean-François Alcover, Oct 31 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric W. Weisstein, Oct 17 2002
STATUS
approved