# Getting 5 or 7 and returning the opposite? [closed]

I get 5 or 7 and if i get 5 i need to return 7 if i get 7 i need to return 5.

i need to do this in 1 mathematical formula.

I have those:

12 - x

35 / x


There are more solutions ?

Example in code:

public static int Transform(int x)
{
return (12-x);
//return (35/x);
}

-

## closed as not a real question by Aryabhata, J. M., Zev Chonoles, Henry, Ross MillikanMay 11 '11 at 17:18

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

There are infinitely many more... – Aryabhata May 11 '11 at 15:51
Example: $\sqrt{74 - x^2}$. This can be easily generalized. – Aryabhata May 11 '11 at 15:53
Why are you unsatisfied with the simple ones you already have? – J. M. May 11 '11 at 15:57
@Danpe, this isn't a puzzle site. – quanta May 11 '11 at 16:02
If $h$ is an invertible function we can define $f(x) = h^{-1}(h(5) + h(7) - h(x))$. This $f$ has the property that you want. This covers the two methods you have (with $h(x)=x$ and $h(x)=\log(x)$, respectively, and quite a few more. – Thomas Andrews May 11 '11 at 16:08

A way to verify this answer: $2 = 5\ \text{XOR}\ 7$. (So basically return x ^ (5 ^ 7);) – Aryabhata May 11 '11 at 16:25