Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

This probably isn't the most important question, but I'm working on something where I've found it convenient to define the following two functions (on the integers): $$ I_o(q):= \begin{cases} q & q \text{ is odd } \\ q-1 & q \text{ is even} \end{cases} \qquad \text{ and } \qquad I_e(q):= \begin{cases} q & q \text{ is even } \\ q-1 & q \text{ is odd} \end{cases}. $$

So $I_o(q)$ is just the largest odd number less than or equal to $q$ and $I_e(q)$ is the same, except for even numbers. I feel that I've seen this function before with a notation similar as to that of floor, but I've had little luck googling it. So I was curious if there was a common notation for this function.

share|improve this question

2 Answers 2

You have

$$I_o(q) = 2 \left\lfloor \frac{q-1}{2} \right\rfloor + 1 = \left\{ \begin{array}{lc} q & q \text{ is odd} \\ q-1 & q \text{ is even} \end{array} \right.$$


$$ I_e(q) = 2 \left\lfloor \frac{q}{2} \right\rfloor. $$

share|improve this answer
This gives a formula for the functions, but OP was asking for a common notation (if there is one). –  Gerry Myerson Jul 29 '11 at 6:12

I don't know if I'd call this common notation, but Microsoft Office seems to have a function EVEN(x) that rounds $x$ up to the nearest even integer. Of course, Microsoft has a strange definition of "up", as EVEN(-1) is -2, not 0. See this MS Office link.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.