Awesome! I knew about this, I was introduced to it in computer science. I didn't know it was called a non-arithmetic sequence, I just generally called this kind of problems recursive. Here's how the mosquito solution would look using python: def mosquitoPop(a, x): if (x== 1): return a else: return mosquitoPop(a*0.15+100, x-1) #once defined, we call the function like this to find the population on the fifth day with a start of 500: mosquitoPop(500, 5) We basically start from the end (because we make explicit the nth day we want to find) and make the computer go backwards from there to the beginning. If x is not at the beginning, the function is called again and again until it reaches the first day and returns the initial amount, calculates, returns that result to the previous function that got stacked, calculates, returns that, and so on and so on.