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