Learning python: various approaches to solving Problem 2 at Project Euler