Without loss of generality, let the numbers be $x$ and $y$ with $x\leq y$. Let $f(x,y)$ denote the function of counting how many integers are strictly between $x$ and $y$.
$$f(x,y)=\begin{cases}0&\text{if}~\lfloor y\rfloor - \lfloor x\rfloor = 0\\
\lfloor y\rfloor - \lfloor x\rfloor-1&\text{if otherwise and}~y\in\Bbb Z\\ \lfloor y\rfloor - \lfloor x\rfloor&\text{otherwise} \end{cases}$$
Let us look at each of these cases in detail and see why that is so.
If $\lfloor y\rfloor - \lfloor x\rfloor = 0$ that implies that $\lfloor x\rfloor \leq x \leq y = \lfloor x\rfloor + \{y\} < \lfloor x\rfloor + 1$. As there are no integers between $\lfloor x\rfloor$ and $\lfloor x\rfloor + 1$, we get the answer of zero.
Let us look at the third case next, where $\lfloor y\rfloor-\lfloor x\rfloor \neq 0$ and $y\notin\Bbb Z$. We have the following numbers are all integers between $x$ and $y$: $\{\lfloor x\rfloor+1, \lfloor x\rfloor+2,\dots, \lfloor y\rfloor\}$ (note here that $\lfloor x\rfloor\leq x<\lfloor x\rfloor+1\leq\lfloor y\rfloor < y$, so $\lfloor y\rfloor$ is indeed going to be in this list, unlike as is possible in the first and second cases)
The last term in that set can be written instead as $\lfloor y\rfloor = \lfloor x\rfloor +(\lfloor y\rfloor -\lfloor x\rfloor)$. The number of terms in the set is then the same as the number of terms in the set $\{1,2,\dots,\lfloor y\rfloor-\lfloor x\rfloor\}$ which we know to be $\lfloor y\rfloor-\lfloor x\rfloor$.
Finally, looking at the second case, we see it is the same as the third case with the exception that $\lfloor y\rfloor$ will not be included in the list as $x<\lfloor y\rfloor\not < y$, so the list we formed earlier will be correct all but the final term which will be removed, reducing the count by one.
I think the three most common notations are:
- $x \bmod n$
- $x \operatorname{rem} n$
- $x \% n$
The first is an abuse of notation and somewhat misleading to people learning the subject, but it is common. The others, IMO, would be readily understood if you state once at the beginning of whatever you're writing what the notation means.
For your specific application you could also use the iverson bracket:
The Iverson bracket is basically the mathematical incarnation of the usual ways to coerce a boolean value to an integer: it gives $0$ when false and $1$ when true.
In the specific formula you write, a possibly more useful alternative is
$$ 2^{[i \text{ odd} ]} = 1 + [i \text{ odd} ]$$
since this form is more amenable to doing series manipulations. In fact, the context of series manipulations is the first time I saw extensive use of the Iverson bracket.
Best Answer
they are $$(2k+1)\cdot \frac{\pi}{2}$$ with $$k \in \mathbb{Z}$$