def population_size(n: int, k: int) -> int:
    """
    Returns the population at time 'n' given 'k' generation size.
    Fn = Fn−1 + (Fn−2 * k)
    """
    if n <= 2:
        # F1 = F2 = 1
        return 1
    return population_size(n - 1, k) + (population_size(n - 2, k) * k)