We define a sequence by $u_{0}=M+\frac{1}{2}$ and $u_{n+1}=u_{n}\left\lfloor u_{n}\right\rfloor$. Determine all integers $M \geqslant 1$ for which the sequence takes an integer value.
Let's try to determine under what condition $u_{1}$ is an integer, and if $u_{1}$ is not an integer, under what condition $u_{2}$ is an integer to understand what is happening. We have $u_{1}=\left(M+\frac{1}{2}\right) M$ which is an integer if and only if $M$ is even.

If $M$ is odd, let $M=2 k+1$, then $u_{1}=M^{2}+k+\frac{1}{2}$. We then have $u_{2}=\left(M^{2}+k\right)\left(M^{2}+k+\frac{1}{2}\right)$ which is an integer if and only if $M^{2}+k$ is even. Since $M^{2}+k=4 k^{2}+4 k+1$, this is true if and only if $k$ is odd. Thus, if $M$ is congruent to 3 modulo 4, $u_{2}$ is an integer; otherwise, $u_{2}$ is not an integer.

It seems that the problematic case is always $M \equiv 1\left(\bmod 2^{k}\right)$. Recalling many similar exercises (P2 French test November 2020, BMO 2021, etc.), we set for $M>1, M=1+2^{k} \alpha$ with $\alpha$ odd. Note that if an integer $x$ is of the form $1+2^{\ell} \beta$ with $\beta$ odd and $\ell \geqslant 1$, we have:

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

By setting $\beta^{\prime}=\beta+4 \beta+2^{\ell+1} \beta^{2}$ which is odd, we have $\left(x+\frac{1}{2}\right)\left\lfloor\left(x+\frac{1}{2}\right)\right\rfloor=\frac{1}{2}+1+2^{\ell-1} \beta^{\prime}$

Thus, since $u_{0}=\frac{1}{2}+1+2^{k} \alpha$, the previous observation shows by immediate induction that for all $k \leqslant n$, there exists an odd integer $\alpha_{k}$ such that $u_{k}=\frac{1}{2}+1+2^{n-k} \alpha_{k}$. For $k=n$, we get $u_{n}=\frac{1}{2}+1+\alpha_{n}$, so $u_{n+1}=\left(1+\alpha_{n}\right)\left(\frac{1}{2}+1+\alpha_{n}\right)$ is an integer because $1+\alpha_{n}$ is even. Thus, if $M>1$, the sequence takes an integer value.

If $M=1$, we have $u_{0}=\frac{3}{2}$, and calculating $u_{1}=\frac{3}{2}$. By immediate induction for all integers $n \geqslant 0, u_{n}=\frac{3}{2}$, so the sequence never takes an integer value.

Thus, the sequence takes an integer value if and only if $M>1$.