Fix typo in math comment.
Simpler recursive implementation.
Simplify the iterative implementation.
Add fibonacci-like solution to the special problem.