Project Euler problems 7&8