OFFSET
1,2
LINKS
Zak Seidov, Table of n, a(n) for n = 1..1000
EXAMPLE
a(5) = 9 because 5th prime is 11, and 11-9<16-11, that is 9 is the closest square to 11.
PROG
(PARI){forprime (p = 2, 300, a = sqrtint (p); b = (a + 1)^2; a = a^2;
s = if (b - p > p - a, a, b); print1 (s ", "))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Oct 02 2014
STATUS
approved