Yesterday, nobody contributed anything. :-( The official answer is: abs(floor(sqrt(x) - 2 * (x + 1))).