Do problem 21 in Python. Attempts to vectorize are much, much slower
than a naive usage of lists...