Project Euler #3 done in python