Exercise 4. A number appears on a computer screen. It is known that if $x$ appears on the screen, the number $x^{2}-2 x+1$ appears right after. If the first number to appear is 2, what is the 2020th number to appear?
Solution to Exercise 4 Let's start by looking at the first values displayed by the computer:

$\triangleright$ The first number is 2.

$\triangleright$ The second number is $2^{2}-2 \times 2+1=1$

$\triangleright$ The third number is $1^{2}-2 \times 1+1=1-2+1=0$

$\triangleright$ The fourth number is $0^{2}-2 \times 0+1=1$

$\triangleright$ The fifth number is $1^{2}-2 \times 1+1=1-2+1=0$

$\triangleright$ The sixth number is $0^{2}-2 \times 0+1=1$

$\triangleright$ The seventh number is $1^{2}-2 \times 1+1=1-2+1=0$

We see that the numbers that appear are in the order $2,1,0,1,0,1,0$. Since after a 0 there is necessarily $0^{2}-2 \times 0+1=1$ and after a 1 there is necessarily $1^{2}-2 \times 1+1=1-2+1=0$, we will have an alternation of 0 and 1. Since 1 appears in second place, all the numbers appearing at an even rank will be 1s, so the 2020th number is 1.

Comment from the graders We congratulate the students who have largely succeeded in this exercise. The few errors observed are mainly calculation errors or rank shifts in the numbers displayed. For example, some students considered that the rank of the first number to appear on the screen was rank 0, while it is rank 1. To avoid this mistake, some students used a table, which was greatly appreciated. We invite students to be vigilant about this kind of error, which has sometimes caused a lot of damage, and not to rush through the exercises, always checking the reasoning used.