I found an interesting problem on https://www.codewars.com/kata/58311536e77f7d08de000085:
Consider having a cow that gives a child every year from her fourth year of life on and all her subsequent children do the same.

After n years how many cows will you have?
Return null if n is not an integer.

Note: Assume all the cows are alive after n years.

I tried it in Python, but could not do it. Can you solve it?
def count_cows(n):
    if not isinstance(n, int):
        return None
    cows = [1]
    old_cows = 0
    for _ in range(n):
        cows = [old_cows] + cows
        if len(cows) >= 3:
            old_cows += cows.pop()
    return sum(cows) + old_cows