wip - Problem 164.

Need to switch from recursion to iteration to avoid
stackoverflow errors and handle infinite sequences...