OFFSET
1,3
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4)=3 because the smallest prime with a square excess of 4 is 13 and 13 - 4 = 3^2.
MATHEMATICA
a = {}; Do[p = 2; While[n != p - (r = Floor@Sqrt[p])^2, p = NextPrime[p]]; AppendTo[a, r], {n, 74}]; a (* Ivan Neretin, May 02 2019 *)
PROG
(PARI) a(n) = {my(p=2); while(n != p-sqrtint(p)^2, p = nextprime(p+1)); sqrtint(p - n); } \\ Michel Marcus, May 05 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Henry Bottomley, Jul 05 2000
STATUS
approved