a. The population of Graks doubles every 5 years, so after 22 years, the population would have doubled 4 times (22/5 = 4.4, but we only count full periods of 5 years). So the number of Graks after 22 years would be 500 * 2^4 = 8000.
b. Let's find out when the number of Sprogs and Graks will be equal. Let n be the number of years it takes for the populations to be equal. Then we can write the equation:
4000 * 2^(n/10) = 500 * 2^(n/5)
Dividing both sides by 500, we get:
8 * 2^(n/10) = 2^(n/5)
Taking the logarithm base 2 of both sides, we get:
log2(8) + n/10 = n/5
Solving for n, we get:
n = (10 * log2(8)) / (1/5 - 1/10) = (30 * log2(2)) / (1/10) = 300
So there will be as many Sprogs as Graks after **300 years**.