3. (7p) Consider the sequence of real numbers $\left(x_{n}\right)_{n \circledast 1}$ with $x_{1}=1, x_{2}=2, x_{3}=3$ and $x_{n+3}=x_{n}, \forall n \in \mathbb{N}^{*}$. Calculate $\lim _{n \rightarrow \infty} \frac{x_{1}+x_{2}+\ldots+x_{n}}{n}$.
Solution. Since $x_{n+3}=x_{n}, \forall n \in \mathbb{N}^{*}$, we deduce that the sequence $\left(x_{n}\right)_{n \geqslant 1}$ is periodic with a period of 3. More precisely, we have $x_{3 n-2}=1, x_{3 n-1}=2$ and $x_{3 n}=3, \forall n \in \mathbb{N}^{*}$.

Let $y_{n}=\frac{x_{1}+x_{2}+\ldots+x_{n}}{n}$. Grouping the terms in sets of three (in the numerator!), we have:

$y_{3 n}=\frac{x_{1}+x_{2}+x_{3}+\ldots+x_{3 n}}{3 n}=\frac{(1+2+3) \cdot n}{3 n}=2, \forall n \in \mathbb{N}^{*} \Rightarrow \lim _{n \rightarrow \infty} y_{3 n}=2$

$y_{3 n+1}=\frac{x_{1}+x_{2}+x_{3}+\ldots+x_{3 n}+x_{3 n+1}}{3 n+1}=\frac{(1+2+3) \cdot n+x_{3 n+1}}{3 n+1}=\frac{6 n+1}{3 n+1}, \forall n \in \mathbb{N}^{*} \Rightarrow \lim _{n \rightarrow \infty} y_{3 n+1}=2$

$y_{3 n+2}=\frac{x_{1}+x_{2}+x_{3}+\ldots+x_{3 n+2}}{3 n+2}=\frac{(1+2+3) \cdot n+x_{3 n+1}+x_{3 n+2}}{3 n+2}=\frac{6 n+3}{3 n+2}, \forall n \in \mathbb{N}^{*} \Rightarrow \lim _{n \rightarrow \infty} y_{3 n+2}=2$

Since the sequence $\left(y_{n}\right)_{n \geqslant 1}$ has three complementary subsequences with the limit 2, it follows that $\lim _{n \rightarrow \infty} y_{n}=2$.

## Grading.

| $x_{3 n-2}=1, x_{3 n-1}=2$ and $x_{3 n}=3, \forall n \in \mathbb{N}^{*}$ | $2 \mathrm{p}$ |
| :--- | :--- |
| $\lim _{n \rightarrow \infty} y_{3 n}=2$ | $1 \mathrm{p}$ |
| $\lim _{n \rightarrow \infty} y_{3 n+1}=2$ | $1 \mathrm{p}$ |
| $\lim _{n \rightarrow \infty} y_{3 n+2}=2$ | $1 \mathrm{p}$ |
| Finalization | $2 \mathrm{p}$ |