>>11528082The nth triangular number is n(n+1)/2
Find the largest triangular number, t, that is less than or equal to x-1.
Find the n corresponding to t.
Let r = x-t.
Map x to (n+2-r,r)
You can find n by solving y(y+1)/2 = x-1 then letting n = floor(y)
Use that n to get t.