On a blackboard, the numbers 1, 2, 3, 4, 5, and 6 are written. In each move, João can replace two numbers $a$ and $b$ with $a \cdot b + a + b$. Find all the possibilities for the last number on the blackboard.
Solution

Let's perform a sequence of moves to analyze the behavior of the list of numbers over the moves:

$$
\begin{aligned}
1,2,3,4,5,6 & \rightarrow \\
1,11,4,5,6 & \rightarrow \\
1,11,5,34 & \rightarrow \\
\mathbf{6 9}, 11,5 & \rightarrow \\
\mathbf{1 1 , 4 1 9} & \rightarrow \\
5039 . &
\end{aligned}
$$

The expression $a \cdot b+a+b$ is very similar to the expression $(a+1) \cdot(b+1)$. Notice that if we add 1 to all the numbers before a move, multiply them, and do the same to the numbers after a move, we will get the same result $S$, because

$$
(a+1) \cdot(b+1)=[(a \cdot b+a+b)+1]
$$

In the initial example, we have

$$
\begin{array}{rl}
1, \mathbf{2 , 3}, 4,5,6 & S=(1+1)(2+1)(3+1)(4+1)(5+1)(6+1)=5040 \\
1,11, \mathbf{4}, 5, \mathbf{6} & S=(1+1)(11+1)(4+1)(5+1)(6+1)=5040 \\
\mathbf{1 , 1 1 , 5 , 3 4} & S=(1+1)(11+1)(5+1)(34+1)=5040 \\
\mathbf{6 9}, 11, \mathbf{5} & S=(69+1)(11+1)(5+1)=5040 \\
\mathbf{1 1 , 4 1 9} & S=(11+1)(419+1)=5040 \\
5039 & S=(5039+1)=5040
\end{array}
$$

Therefore, regardless of how the operations are performed, the quantity $S$ will not change, and the final number will always be

$$
\begin{aligned}
S & =(1+1)(2+1)(3+1)(4+1)(5+1)(6+1)-1 \\
& =5039
\end{aligned}
$$