Changed range to xrange in tools to reduce memory usage for large upper bound.
Added solution to Problem 37