Let f(a,b)=gcd(2024ab,a2+254ab+b2) then for 2 numbers a,b on the board, the new number generated will be f(a,b). We consider some cases:
* If a,b are same parity then f(a,b) is even.
* If a,b are different from parity then f(a,b) is odd.
This means that the number of odd numbers either remains the same or decreases by 2 units; but initially, there are odd numbers, so the final number x must be odd. Suppose that x>1, let p be some prime divisor of x.
Note that
254=11⋅23+1 and 2024=23⋅11⋅23.
If p=11, since 11∣gcd(2024ab,a2+254ab+b2) then 11∣a2+ab+b2. Similarly, if p=23 then there is also 23∣a2+ab+b2. We have the following familiar lemma derived from Fermat's little theorem or quadratic residue:
Lemma. If p is a prime of form 3k+2 and p∣a2+ab+b2 then p∣a,b.
Since 11 has the form 3k+2, according to the above lemma, one can get 11∣a,b. Continuing like that, the previous numbers on the board that generated a,b also be divisible by 11, making all the original numbers divisible by 11, contradiction. Similarly for the case p=23.
Finally, if p=11,23 then p∣ab,p∣a2+506ab+b2 entails p∣ab,p∣a2+b2. Obviously from p∣ab, we get that p is a divisor of one of a or b, but p∣a2+b2 then p∣a,b. We get the similar contradiction as the above argument.
Therefore x is odd and has no odd prime divisors, proving that x=1. ☐