Let $k$ be a positive integer. How many non-negative integer solutions does the equation

$$
\left[\frac{x}{k}\right]=\left[\frac{x}{k+1}\right]
$$

have?
Solution. First, we examine how many (non-negative integer) solutions the equation $\left[\frac{x}{k}\right]=\left[\frac{x}{k+1}\right]=n$ has for a given non-negative integer $n$. $\frac{x}{k}$ and $\frac{x}{k+1}$ will have an integer part of $n$ if both are at least $n$ and both are less than $(n+1)$. Since we are dealing with non-negative numbers, $\frac{x}{k+1} \leq \frac{x}{k}$, so $\left[\frac{x}{k}\right]=\left[\frac{x}{k+1}\right]=n$ will hold exactly when $n \leq \frac{x}{k+1}$ and $\frac{x}{k}<n+1$.

$n \leq \frac{x}{k+1}$ holds exactly when $n(k+1) \leq x$. Similarly, $\frac{x}{k}<n+1$ holds when $x<k(n+1)$, or, since $x$ is an integer, $k(n+1)-1 \geq x$.

Thus, the necessary and sufficient condition for $\left[\frac{x}{k}\right]=\left[\frac{x}{k+1}\right]=n$ is

$$
n(k+1) \leq x \leq k(n+1)-1
$$

The solutions to this are the integers from $n(k+1)$ to $k(n+1)-1$, so there are

$$
(k(n+1)-1)-n(k+1)+1=k-n
$$

solutions.

Finally, let's calculate the total number of solutions. $n$ is at least 0 and less than $k$. For $n=0$, there are $k$ solutions, for $n=1$, there are $k-1$, ..., for $n=(k-2)$, there are 2, and for $n=(k-1)$, there is 1 solution; thus, the total number of solutions is the sum of integers from 1 to $k$, which is $\frac{k(k+1)}{2}$.