add Python solution for Project Euler problem 31