OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10100
EXAMPLE
a(5) = 4 as A000037(5) = 7 and the nonsquare numbers m such that 1 <= m <= 7 are 2, 3, 5, 6, 7. Listing and sorting the fractional parts of sqrt(m) for these numbers gives [0.23..., 5], [0.41..., 2], [0.44..., 6], [0.64..., 7], [0.73..., 3] and 7 is 4th from the left.
PROG
(PARI) a(n) = {n += (1 + sqrtint(4*n)) \ 2; my(l = List()); for(i = 1, n, if(!issquare(i), listput(l, [frac(sqrt(i)), i]))); listsort(l); select(x->x[2] == n, l, 1)[1]}
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, May 29 2026
STATUS
approved
