3. A student wrote a program for recoloring a pixel into one of 128 different colors. These colors he numbered with natural numbers from 1 to 128, and the primary colors received the following numbers: white color - number 1, red - 5, orange - 13, yellow - 21, green - 45, blue - 75, indigo - 87, violet - 91, black - 128. If the initial color of the pixel has a number \( n \leq 19 \), then the student's program recolors it to the color with the number \( n+4 \), and if the initial color of the pixel has a number \( n \geq 20 \), then the pixel is recolored to the color with the number \( |129-2n| \). Initially, the pixel was red. The student applied his program 2019 times sequentially. What color did the pixel end up as a result?
Solution. The final pixel color number is equal to $f^{[2019]}(5)$ where $f^{[k]}(n)=\underbrace{f(f(f(\ldots(f}_{k \text { times }}(n) \ldots)-k$-fold composition of the function $f(n)$, which is equal to $n+4$ when $n \leq 19$, and equal to $|129-2 n|$ when $n \geq 20$. Let's compute and write down the first few values: $f(5)=9, \quad f^{[2]}(5)=13, f^{[3]}(5)=17, \quad f^{[4]}(5)=21, f^{[5]}(5)=87, \quad f^{[6]}(5)=45, \quad f^{[7]}(5)=39$, $f^{[8]}(5)=51, \quad f^{[9]}(5)=27, \quad f^{[10]}(5)=75, f^{[11]}(5)=21=f^{[4]}(5) . \quad$ We have obtained a cycle of length 7 operations. Therefore, for any natural value of $k$ and any $r=0,1, \ldots, 6$, we have $f^{[4+7 k+r]}(5)=f^{[r]}(21)$. Since $2019=4+287 \cdot 7+6$, then $r=6$, and $f^{[2019]}(5)=f^{[6]}(21)=75$. The pixel will be blue. Answer: blue.