MathCastle
OlympiadSuperchallengeOlympiad Number Theory

Olympiad Number Theory · Superchallenge problem

The numbers 1,2,…,20261, 2, \ldots, 2026 are written on a board. Repeatedly, two numbers are erased and their (nonnegative) difference is written. What is the SMALLEST possible value of the last number remaining?