Working through project Euler problems using PHP