# Find all $n$ $\in$ $\Bbb Z^+$ such that: $\lfloor\frac{n}{2}\rfloor \cdot \lfloor \frac{n}{3} \rfloor \cdot \lfloor \frac{n}{4} \rfloor = n^2$

Find all the numbers $$n$$ $$\in$$ $$\Bbb Z^+$$ such that:

$$\left\lfloor\frac{n}{2}\right\rfloor \cdot \left\lfloor \frac{n}{3} \right\rfloor \cdot \left\lfloor \frac{n}{4} \right\rfloor = n^2$$

I never worked before with floor function so i'm not completely sure how to solve this. I think (only because $$n$$ $$\in$$ $$\Bbb Z^+$$), i can just multiply (skipping the floor function) and get the answer of $$n=24$$, but this is floor function so i don't know if there are more solutions.

Any hints?

• It seems to me that the solution of $(\frac {n}{2} -1)(\frac {n}{3}-1)(\frac {n}{4} -1) = n^2$ should provide an upper bound for possible solutions, and this should give a manageable number of cases to check. Feb 19, 2019 at 16:29
• Yep, that's a good starting point. For all $n \ge 33$, we have $(\tfrac{n}{2}-1)(\tfrac{n}{3}-1)(\tfrac{n}{4}-1) > n^2$. Thus, we only need to check $1 \le n \le 32$. Feb 19, 2019 at 16:31
• Using the fact that $x-1\leq [x]<x$, we have $$\frac{(n-2)(n-3)(n-4)}{24}\leq n^2<\frac{n^3}{24}$$ which implies $24\leq n$. Feb 19, 2019 at 16:33
• And for $n \le 23$ we have $(n/2)(n/3)(n/4) < n^2$. So we don't need to check $n \le 23$. It suffices to check $24 \le n \le 32$. Feb 19, 2019 at 16:33

You already ofund a solution $$n=24$$. For $$n<24$$, we have $$\left\lfloor\frac n2\right\rfloor \left\lfloor\frac n3\right\rfloor\left\lfloor\frac n4\right\rfloor\le \frac n{24}\cdot n^2 For $$n\ge 30$$, we have \begin{align}\left\lfloor\frac n2\right\rfloor \left\lfloor\frac n3\right\rfloor\left\lfloor\frac n4\right\rfloor -n^2&\ge\frac{n-1}2\frac{n-2}3\frac{n-3}4-n^2\\&=\frac{n^3-30n^2+11n-6}{24}\\&\ge\frac{11n-6}{24}\\&>0.\end{align} Hence we need at most check $$25\le n\le 29$$.

To simplify checks for these cases, note that $$\left\lfloor\frac n2\right\rfloor$$, $$\left\lfloor\frac n3\right\rfloor$$, $$\left\lfloor\frac n4\right\rfloor$$ are three distinct integers $$\ge 6$$. As $$29^2$$ and $$5^4$$ cannot be written as product of three distinct integers $$\>1$$, we can exclude $$n=29$$ and $$n=25$$. For $$3^6$$, the only way to write it as product of three distinct integers is as $$3\cdot 9\cdot 27$$, but $$3<6$$, so we can exclude $$n=27$$ as well. For $$n=26$$, we see that only one of the three factors is a multiple of $$13$$, so this can be ruled out as well. Fially, for $$n=28$$, $$\lfloor \frac n3\rfloor=9$$, but $$28^2$$ is not a multiple of $$3$$.

• (+1) I took too long working on my answer, that I did not see yours, which is essentially the same.
– robjohn
Feb 19, 2019 at 19:36

We have

$$\left\lfloor\frac{n}{2}\right\rfloor \cdot \left\lfloor \frac{n}{3} \right\rfloor \cdot \left\lfloor \frac{n}{4} \right\rfloor - n^2 =0$$

Note that: $$x > \left\lfloor x \right\rfloor$$

Thus: $$\frac{n}{2}\cdot \frac{n}{3}\cdot \frac{n}{4} - n^2 >\left\lfloor\frac{n}{2}\right\rfloor \cdot \left\lfloor \frac{n}{3} \right\rfloor \cdot \left\lfloor \frac{n}{4} \right\rfloor - n^2 = 0$$

Thus:

$$\frac{n^3}{24}-n^2= n^2\left( \frac{n}{24}-1\right) >0$$

Hence we are looking for a number larger than 24.

At the same time: $$\left\lfloor\frac{n}{2}\right\rfloor \cdot \left\lfloor \frac{n}{3} \right\rfloor \cdot \left\lfloor \frac{n}{4} \right\rfloor - n^2 > \left( \frac{n}{2}-1\right) \cdot\left( \frac{n}{3}-1\right) \cdot\left( \frac{n}{4}-1\right) -n^2$$ Therefore: $$0>\left( \frac{n}{2}-1\right) \cdot\left( \frac{n}{3}-1\right) \cdot\left( \frac{n}{4}-1\right) -n^2$$

This function has only one real root around 32.216 I'm lazy, sorry about that.

Hence we are looking for $$n$$ in the interval $$[24,32]$$. I'll check it in Python:

from math import floor
for n in range(24, 33):
if (floor(n/2)*floor(n/3)*floor(n/4)-n*n) == 0:
print(n)


And the only answer is 24.

A lengthy approach

As $$[2,3,4]=12,$$ let us try with all $$12$$ in-congruent residues $$\pmod{12}$$

If $$n=12k$$

$$6k(4k)(3k)=(12k)^2\iff k=2$$

If $$n=12k+1,$$

$$6k(4k)(3k)=(12k+1)^2$$ which is untenable as LHS is divisible by $$6$$

If $$n=12k+2,(6k+1)(4k)(2k)=(12k+2)^2\iff6k+1=2k^2$$ which is even

If \$n=12k+3,(6k+1)(4k+1)2k=(12k+3)^2 which is odd unlike the LHS

If $$n=12k+4,(12k+4)^2=(6k+2)(4k+1)2k\iff4(3k+1)=4k+1$$ which is odd unlike LHS

and so on