Problems 3 & 4 for project Euler