How many positive integer solutions exist for $[\frac{x}{19}]=[\frac{x}{20}]$, where $[x]$ denotes the Greatest integer function

algebra-precalculusceiling-and-floor-functions

Question

How many positive integer solutions exist for $[\frac{x}{19}]=[\frac{x}{20}]$, where $[x]$ denotes the Greatest integer function

What I tried

I took the following cases one by one,

CASE $1$
$$[\frac{x}{19}]=[\frac{x}{20}]=1$$
All numbers from $20$ till $37$ should work for this, thus a total of 18 solution in this case.

CASE $2$
$$[\frac{x}{19}]=[\frac{x}{20}]=2$$
All numbers from $40$ to $56$ should work for this, thus a total of $17$ solutions in this case.

Upon continuing this process, we reach the case where there is only one possible solution.

Thus the number of cases is $18+17+16+…+2+1$ which is equal to $171$

There is also the case of $$[\frac{x}{19}]=[\frac{x}{20}]=0$$
This case will have $18$ solutions, from $1$ till $18$.
Thus the total number of solutions is $171+18$ which is $189$

I am not sure if my answer is correct (maybe I am missing a few cases).

What I am looking for is a verfication of my method and answer, and maybe a more concrete solution which will work in cases where $[\frac{x}{m}]=[\frac{x}{n}]$ where m and n are not consecutive natural numbers.

Thank you so much in advance!

Regards

Best Answer

For $x >0$, the two are equal if and only if there exists $n$ such that $n \leq \frac x{20} < \frac x{19} < n+1$. This translates to $20n \leq x < 19n+19$.

Now for a given $n$, we have $(19n+19)-20n = 19-n$. Therefore we have $19-n$ values between $20n$ and $19n+19$ for $n < 19$ which $x$ can take (note : for $n=0$ we actually can't have $x=0$ so we must subtract $1$), and none for $n \geq 19$. Thus, the answer is : $$ \sum_{n=0}^{18} (19-n) - 1 = 361 - 171 - 1 = 190-1 = 189 $$


In general case of $\lfloor x/n \rfloor = \lfloor x/m \rfloor$ with $n > m$, we get that for $x>0$ equality works if and only if for some $N$ we have $N \leq \frac xn < \frac xm < N+1$. This translates to $nN \leq x < mN + m$.

Therefore for all $N$ such that $N \geq 0$ and $N < \frac{m}{n-m}$, we get $(mN - nN + m)$ values of $x$. So the answer would be (again accounting that $x=0$ will be counted in the $N=0$ case so we must remove it by subtracting $1$): $$ \sum_{N=0}^{\lfloor \frac{m}{n-m} - 1\rfloor} (mN - nN + m) - 1 $$

in our case, $m=19$, $n= 20$, so $\frac{m}{n-m} - 1 = 18$ ,with $mN - nN + m = 19-n$, so we are back. You can of course evaluate the above sum better ,this I leave to you.