[Math] ‘is odd’ / ‘is even’ notation

logicnotation

I would like to write down that $x$ is $true$ if $n$ is odd and $false$ if $n$ is even.

So far I made this up:

$x = ( n – 2⌊\frac{n}{2}⌋ = 1)$

However, I was wondering whether this can be expressed this way at all, and whether there is a general notation that means 'is odd' or 'is even'.

Thanks for any hints on this.

Best Answer

There's a standard notation $a|b$ that means "a divides b", or more precisely "$\exists c : ac = b$" (in the context of a particular ring). So "n is even" can be written concisely as "$2|n$".

Related Question