On a blackboard, the 2014 positive integers from 1 to 2014 are written. The allowed operation is to choose two numbers $a$ and $b$, erase them, and write in their place the numbers $gcd(a, b)$ (Greatest Common Divisor) and $lcm(a, b)$ (Least Common Multiple). This operation can be performed on any two numbers on the blackboard, including numbers that resulted from previous operations. Determine the maximum number of 1s that can be left on the blackboard.
Solution

The maximum number of 1s we can leave is 1007. First, we will show how to obtain them. For this, it is enough to take the pairs of consecutive numbers, $(1,2),(3,4),(5,6)$, ..., $(2013,2014)$ and perform the operation on each pair. Knowing that consecutive numbers do not have a common factor, each of the greatest common divisors will be 1.

It is not possible to obtain more than this because the number of even numbers does not change throughout the operations. This happens because, if we operate with two even numbers, we will get two even numbers as a result, if we operate with two odd numbers we will get two odd numbers as a result, and if we operate with an even number and an odd number we will also get an even number and an odd number. We start with 1007 even numbers and will always have 1007 even numbers.