Rating: 9.29

n - m * (m +1) / 2 + 1, m = [(sqrt (8 * n +1) - 1) / 2]
-