Python implementations (mostly brute force) for problems 2 through 8.