Helper functions for Project Euler.