I was reviewing other posts to find an Arithmetic way for XOR and found this, but cannot apply to natural numbers in python3.
The trivial way:
a = 12
b = 5
a^b ===> 9
Using the other posts formula:
a = 12
b = 5
a + b - a*b*(1 + a + b - (a*b)) ===> 2537
Another option:
a = 12
b = 5
(a-b)**2 ===> 49
Off course, all the previous is working well as the trivial way if a and b are zero or one, like the other posts said, but...
Is there a function for getting XOR with natural numbers in a more Arithmetic way?
UPDATE: Using the code of the response, I built the arithmetic fórmulas in a more mathematical way, just getting more clear the question and the answer. Thank you!