MathDB
Traveling through the country

Source: Serbian Mathematical Olympiad 2021, P2

May 14, 2021
graph theorycombinatoricsSerbia

Problem Statement

In the country of Graphia there are 100100 towns, each numbered from 11 to 100100. Some pairs of towns may be connected by a (direct) road and we call such pairs of towns adjacent. No two roads connect the same pair of towns.
Peter, a foreign tourist, plans to visit Graphia 100100 times. For each ii, i=1,2,,100i=1,2,\dots, 100, Peter starts his ii-th trip by arriving in the town numbered ii and then each following day Peter travels from the town he is currently in to an adjacent town with the lowest assigned number, assuming such that a town exists and that he hasn't visited it already on the ii-th trip. Otherwise, Peter deems his ii-th trip to be complete and returns home.
It turns out that after all 100100 trips, Peter has visited each town in Graphia the same number of times. Find the largest possible number of roads in Graphia.