I've written down how to get the formula for cantor unpairing (wiki refers to here)
cantor_pairing_calc.pdf