Artificial intelligent assistant

Number of hairs of inhabitants and the population of a city There is a town T where the population is greater than the number of hairs of each inhabitant. That is, if we count the number of hairs on the head of any inhabitant of the town, the amount will be smaller than the population of the city. There are no two inhabitants with the same number of hairs on their heads, and there is no one with exactly 618 hairs on their head. What is the greatest possible number of inhabitants of this town?

If we are told there are $n$ inhabitants then the number of hairs each inhabitant can have is an element of the set $\\{0,1,2\dots n-1\\}$ because there are more inhabitants than hairs in the head of each inhabitant.

But if we want to reach the population of $n$ we must have exactly one inhabitant that has $0$ hairs, $1$ hair ... and so on until $n-1$ hairs.

When $n=618$ we can achieve this because $n-1$ is $617$ so the inhabitants can in fact have every possible hair quantity.

However when $n$ is $619$ or larger it is impossible to have inhabitants with each hair quantity between $0$ and $n-1$ because $618$ is forbidden.

Hence the maximum is $618$ inhabitants.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 41b2370cf38801a41ae7f4a2e317cb87