Here is the code I used to resolve some of the project Euler enigma.