Functions commonly used for project Euler challenges