The situation describes an exponential growth, which can be expressed using the general formula:

Where
a is the initial value
r is the growth rate, expressed as a decimal value
x is the number of times intervals
y is the final value after x time intervals
For the studied population, the growth rate is 2.5%, to express this number as a decimal value you have to divide it by 100:

The initial value is the current population of the town: a=50000
You can express the equation of exponential growth for this population as follows:

We know that after x years the population will be y=100000, to determine how many years it will take to reach this value you have to equal the equation to 100000 and solve for x:

-Divide both sides of the expression by 50000

-Apply logarithm to both sides of the equal sign:

-Divide both sides by the logarithm of 1.025

After approximately 28 years the population of the town will be 100,000.