A mathematical function f() that partitions integers into two sets, {1} and the rest of integers.

74 Views Asked by At

To elaborate a little more,

I want an algebraic formula for a function f such that $f(1)=x$ and $f(y)=z$ where $y\neq 1$ and $z\neq x$ ($z$ being the same value for all $\Bbb Z\setminus\{1\}$).

If possible, I would like to have this solution.

$$f(1) = 0, \qquad f(y) = 1, \text{ where } y\neq1$$

This way, given the output of this function $f$, I will know the number passed to $f$ is not $1$.

I want to use it in an equation (containing variable $x$ and bunch of other variables) where I want to set the value of the equation to zero when $x=1$.

So, if I have equation $$p = (x-1)(x+1) + 2y$$

I want it to function properly except when $x=1$ in which case I want the output to be zero.

So, I will modify the equation to

$$p = ((x-1)(x+1)+2y)\cdot f(x)$$

The output won't change for any other number since $f(z)=1$.

1

There are 1 best solutions below

1
On BEST ANSWER

The expression $$f(x)=1-0^{|x-1|}=0^{0^{|x-1|}}$$ does the trick, provided you're O.K. with $0^0=1.$

Alternatively, using the ceiling function: $$f(x)=\left\lceil\frac{(x-1)^2}{(x-1)^2+1}\right\rceil$$