Useful functions, originally written as helpers functions for Project Euler problems.