start. Each round goes like this: for every number x already on the board, find all numbers i from 1 to start with x % i == 1, and write them on the board. Numbers are never erased, and a number already present is not written again.
A billion rounds pass. How many distinct numbers are on the board at the end?start=6 → 5
6 leaves remainder 1 when divided by 5, so 5 is written. 5 leaves remainder 1 for 2 and 4. 4 leaves remainder 1 for 3. The board holds 6, 5, 4, 3, 2: five numbers.
start=2 → 1
No divisor works for 2 (2 % 1 = 0, 2 % 2 = 0), so the board keeps a single number.
start ≤ 100start=6
5
Run checks the first 3 tests in your browser. Submit checks all 52 tests on the server, hidden ones included.