Suppose a town has a population of 5,000 residents but that the population is decreasing by 200 people each year. Write a linear function to represent the population of the town in terms of the numbers of years. After how many years will the town have a population of 1,800? When will the town have only 400 residents?