Infinite Function Sequence Python