# Floor of Half of n+m plus Floor of Half of n-m+1

## Theorem

Let $n, m \in \Z$ be integers.

$\floor {\dfrac {n + m} 2} + \floor {\dfrac {n - m + 1} 2} = n$

where $\floor x$ denotes the floor of $x$.

## Proof

Either $n + m$ or $n - m + 1$ is even.

Thus:

$\dfrac {n + m} 2 \bmod 1 + \dfrac {n - m + 1} 2 \bmod 1 = \dfrac 1 2 < 1$

and so:

 $\ds \floor {\dfrac {n + m} 2} + \floor {\dfrac {n - m + 1} 2}$ $=$ $\ds \floor {\dfrac {n + m} 2 + \dfrac {n - m + 1} 2}$ Sum of Floors not greater than Floor of Sum $\ds$ $=$ $\ds \floor {\dfrac {n + m + n - m + 1} 2}$ $\ds$ $=$ $\ds \floor {n + \dfrac 1 2}$ $\ds$ $=$ $\ds n$

$\blacksquare$