The requirements are:
- $f(x, y) = f(y, x)$
- $f(x, x) = x$
$f(x, y) = f(x, x + y)$
f: $\mathbb{N}^2 \rightarrow \mathbb{N}$
I think $\gcd(x, y)$ works, but haven't found any other solutions nor have I been able to prove gcd is the sole function that works.