Problem 16, F#
Problem 16, Python