Carla wrote on the blackboard the integers from 1 to 21. Diana wants to erase some of them so that the product of the remaining numbers is a perfect square.

a) Show that Diana must necessarily erase the numbers 11, 13, 17, and 19 to achieve her goal.

b) What is the minimum number of numbers that Diana must erase to achieve her goal?

#
Solution

a) If Diana decides not to erase the number 11, then the product of the remaining numbers will be of the form $P=11 \times A$. Since 11 is the only multiple of 11 among the numbers written by Carla, $A$ is the product of numbers not divisible by 11, and thus $A$ is not a multiple of 11. Therefore, $P$ would be a multiple of 11 but not a multiple of $11^{2}$, so $P$ would not be a perfect square. Similarly, we can see that Diana must also erase the numbers 13, 17, and 19.

b) If Diana erases only the numbers 11, 13, 17, and 19, the product of the remaining 17 numbers would be

$$
1 \times 2 \times 3 \times \cdots \times 10 \times 12 \times 14 \times 15 \times 16 \times 18 \times 20 \times 21=\left(2^{9} \times 3^{4} \times 5^{2} \times 7\right)^{2} \times 21
$$

This number is not a perfect square, so she needs to erase at least one more number. From the factorization above, it is easy to see that if Diana also erases the number 21, she will achieve her goal. Therefore, the smallest number of numbers that Diana must erase is 5.