[Math] Proving that for any odd integer:$\left\lfloor \frac{n^2}{4} \right\rfloor = \frac{(n-1)(n+1)}{4}$

discrete mathematicsproof-writing

I'm trying to figure out how to prove that for any odd integer, the floor of:

$$\left\lfloor \frac{n^2}{4} \right\rfloor = \frac{(n-1)(n+1)}{4}$$

Any help is appreciated to construct this proof!

Thanks guys.

Best Answer

Let $n$ be an odd integer.

Then there exists an integer $k$, such that: $$n=2k+1$$

It follows that: $$\begin{align} \left\lfloor\frac{n^2}{4}\right\rfloor &= \left\lfloor\frac{(2k+1)^2}{4}\right\rfloor\\ &=\left\lfloor\frac{(4k^2+4k+1)}{4}\right\rfloor\\ &=\left\lfloor\frac{(4k^2+4k)}{4}+\frac{1}{4}\right\rfloor\\ &=\left\lfloor(k^2+k)+\frac{1}{4}\right\rfloor \end{align} $$

Because $k^2+k$ is an integer, we can now say: $$\left\lfloor\frac{n^2}{4}\right\rfloor = k^2+k$$

It also follows that: $$\begin{align} \frac{(n-1)(n+1)}{4} &= \frac{n^2-1}{4}\\ &= \frac{(2n+1)^2-1}{4}\\ &= \frac{(4k^2+4k+1)-1}{4}\\ &= \frac{4k^2+4k}{4}\\ &= k^2+k\\ \end{align}$$

Therefore: $$\left\lfloor\frac{n^2}{4}\right\rfloor=\frac{(n-1)(n+1)}{4}$$

Q.E.D.

Related Question