Functions $f$ and $g$ such that $f(a, b) = f(g(a, b), b)$ over non-negative integers

33 Views Asked by At

Are there some properties which make it easier to find such $f$ and $g$?

Few examples:

$gcd(a, b) = gcd(|a-b|, b)$

$a | b = (a \oplus b) | b$, where $\oplus$ is bitwise XOR and $|$ is bitwise OR