OFFSET
0,7
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10200
EXAMPLE
For n=15, we start iterating from the next larger square, (⌊√15⌋+1)^2 = 16, and in just a single step (16 - A002828(16) = 15) we land to n, so a(15) = 1.
For n=16, we start iterating from the next larger square, which is 25, and thus we have 25 -> A255131(25) = 24, 24 -> A255131(24) = 21, 21 -> A255131(21) = 18, 18 -> A255131(18) = 16, thus four steps were required to reach 16, and a(16) = 4.
For n=17, when we do the same iteration, we see that we will pass by it, thus a(17) = 0.
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 28 2016
STATUS
approved