In Python, it can be expressed as follows. Using the recursive function type, we find the sum of the previous term and the sum of the two previous terms.
Python:
x=int(input("Initial size: "))
y=int(input("Enter days: "))
mod=int(y/5)-1
def calc(n):
gen_term = [x,2*x]
for i in range(2, n+1):
gen_term.append(gen_term[i-1] + gen_term[i-2])
return gen_term[n]
if(mod==0):
print("After",y,"days, the population is",x)
else:
print("After",y,"days, the population is",calc(mod))