Each new citizen adds 10,000 more than the last citizen, and the first adds 10,000. So, the second adds 20,000, the third citizen adds 30,000 and the fourth adds 40,000. This means that a size 5 city has 10,000 +20,000 +30,000 +40,000 +50,000=150,000 citizens.
The formula is AritmethicSum(n)=n *(a1 + an)/2 =
n * (10,000 + 10,000*n) / 2
where n is the size of the city.
E.g. a size 40 city will have
40 * (10,000 + 40 *10,000) / 2 = 40 * 410,000 / 2 = 8,200,000 inhabitants