# Function for unique hash code

I am interested in finding $F(x,y)$, such that $x$ and $y$ $\in \mathbb Z^+$ and $F(x,y)$ is one to one function i.e., $F(x,y)$ is unique for any unique unordered pairs of $x$ and $y$.

Regards,

Apologies for noobish language I am new to branch of number theory.

-
By writing "unordered pairs," you are asking that $F(x,y)=F(y,x)$, is that right? –  Gerry Myerson Jan 16 '13 at 8:55
Yes, precisely the order is immaterial . –  user58460 Jan 16 '13 at 8:58

$F(x,y)=(1+\max(x,y))^2-|x-y|$ will do.
I figured the easiest way was to get some function such that $F(x,x)$ increased pretty quickly with $x$ --- quadratically would do --- and then subtract something off it as you went away from $(x,x)$, subtracting more the farther down from or to the left of $(x,x)$ you went. That's what this function does. Along the $(x,x)$ line, it goes $1,4,9,16,\dots$, and it drops by $1$ for each step you take away from $(x,x)$. –  Gerry Myerson Jan 16 '13 at 10:43