Problem 31 done the ugly way
Recursive solution for 31
Add problem 32