# Is there a symbol with values 0 and 1 depending on parity of a parameter

Is there a reasonably standard symbol depending on a parameter, like $\delta_i$ or something, that takes the value $1$ when $i$ is even and $0$ when $i$ is odd? or the other way around?

$$\frac{1 + (-1)^i}{2}$$ is far too cumbersome.

Edit: I really don't see why it was closed for lack of context. The context should be obvious -- the numerous formulas where such a symbol would be useful. If I asked, "is there a symbol depending on two parameters i and j which is 1 when i=j and 0 otherwise", I would have gotten the answer, "yes, the Kronecker delta symbol!" -- not a vote to put on hold.

But okay, if you want a particular context, I'll offer that this would give an alternative way to write coefficients of power series with alternating zero and nonzero terms.

There are other ways around that, so here's a different context. I'm writing a paper where I need to write a formula for the general term in the sequence of polynomials:

$x$, $-x+x^2$, $3x+x^2+x^3$, $-3x+4x^2-x^3+x^4$, $\ldots$

The coefficient of the $i$th degree term in the $m$th degree polynomial is, up to a sign,

$$\binom{\left\lfloor \frac{m+i-2}{2} \right\rfloor}{i-1}$$ then multiplied by $m/i$ when $m-i$ is even or $(m-1)/i$ when $m-i$ is odd. This latter factor would be easy to write using the symbol I asked about. I could also write this as a sum of two polynomials, one with odd degree terms and the other with even, but I would prefer one formula.

• would (i+1)mod2 do? – Paul Apr 28 '15 at 12:45
• Reason for down vote? I'm sure lots of people need such a symbol on occasion. What's wrong if asking if there is a standard? – Barry Smith Apr 28 '15 at 13:01
• I don't like using mod as an operator, like the computer scientists do, and I know others who feel the same. But that's just personal aesthetics. Mostly, I hope there's something more compact. – Barry Smith Apr 28 '15 at 13:02
• You can use Iverson brackets. – GFauxPas Apr 28 '15 at 14:05
• If $2{\mathbb N}$ is the set of even numbers, then you can use the characteristic function $1_{2{\mathbb N}}(x)$. It is quite common to use characteristic functions in analysis and very common in probability and statistics. – Taladris Apr 28 '15 at 15:06

Consider the Iverson bracket convention.

If $p$ is a statement: $[p] = \begin{cases} 1; & p \\ 0; & \neg p\end{cases}$

If $P$ is a predicate: $[P(x)] = \begin{cases} 1; & P(x) \\ 0; & \neg P(x)\end{cases}$

So your desired notation would be $[2 | i]$ or $[i \equiv 0 \bmod 2]$

Or maybe (these two I made up):

$[\mathcal{E}(i)]$, or $[i \equiv 0]_2$

Or the characteristic function on evens:

$$\chi_{\mathcal E}(i) = \mathbf{1}_{\mathcal E}(i)$$

I use $\mathcal E$ and $\mathcal O$ for the set of even and odd numbers in my personal notes, but of course you can use some other symbol.

edit: I've seen $[p]_q$ to mean the remainder of $p / q$, I think, somewhere. So that would be $[i]_2$.