The down function is moving along the usual Cantor pairing function $\mathbb{N}\times\mathbb{N}\to\mathbb{N}$, since it moves from each point on the diagonals until the diagonal runs out at the y-axis, and then it jumps back to the next lower diagonal.
The cane function counts how many times that happens before you hit the origin. So the cane function is the precisely (a version of) the usual Cantor pairing function. (Your function differs in that it swaps $x$ and $y$ from the usual function, since Cantor's function goes down and to the right, rather than up and the to left as with your recursion.) It maps a pair $(x,y)$ to the code of that pair.
So in fact, $\text{down}(x,y)$ is a quadratic polynomial in $x$ and $y$, and I challenge you to figure out the precise formula.