When does $\left\lfloor\sqrt{2015(n-1)}\right\rfloor = \left\lfloor\sqrt{2015n}\right\rfloor$ hold?

Solution 1:

Edit: Directly solving OP's question (using the same idea as below):

$$\sqrt{2015n}-\sqrt{2015(n-1)}\le 1$$ is true for $n\ge 504$ and false for $n\le503$

So when $n=1,2,\ldots,503$ we have $\sqrt{2015n}$ takes only distinct values (as the difference between two consecutive values is greater than $1$), for a total of $503$ values.

For $n=504,505,\ldots,2015$, we have $\sqrt{2015n}$ does not skip any values (as the difference between two consecutive values is less than $1$), so $\sqrt{2015n}$ takes all the values between $\lfloor \sqrt{2015\cdot 504}\rfloor=1007$ and $\lfloor\sqrt{2015\cdot 2015}\rfloor=2015$, a total of $2015-1007+1=1009$ values.

So when $1\le n\le 2015$, we have that $\sqrt{2015n}$ takes $1512$ distinct values; the non-distinct values duplicating the previous values, since they are increasing with $n$.

So the number of solutions of the equation is $2015-1512=503$


The original problem in the link asks to determine the number of different values of $\big\lfloor\frac{n^2}{2015}\big\rfloor$, for $1\le n\le 2015$. I think that your equation is equivalent to the number of duplicates (I will verify when I get a chance)

The solution is to take the difference of two consecutive terms and compare it with $1$:

$$\frac{n^2}{2015}-\frac{(n-1)^2}{2015}=\frac{2n-1}{2015}\le1\iff n\le1008$$

As long as $n\le 1008$, no value will be skipped, so all values between $0$ and $\big\lfloor\frac{1008^2}{2015}\big\rfloor=504$ will be taken ($505$ values).

When $n>1008$ each term will generate a new value, So we have $2015-1008+1=1008$ new values.

The total is $505+1008=1513$ distinct values

The number of duplicates is $2016-1513=503$. So for $502$ values your equation holds.