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