Frogs in the marsh

Report a typo

In the very first year, there are 120120 frogs in the marsh. Once a year, 5050 frogs move to a nearby pond, while the remaining frogs breed so that their number doubles. Thus, for year kk, you can calculate the number of frogs in the marsh based on the formula:

Fk=2(Fk150)F_k = 2(F_{k-1} - 50)

Write a function number_of_frogs that returns this number for a given year.

Just implement the function, you don't have to handle input or print anything.

Sample Input 1:

1

Sample Output 1:

120

Sample Input 2:

5

Sample Output 2:

420
Write a program in Python 3
def number_of_frogs(year):
pass
___

Create a free account to access the full topic