My functional approach to answering Project Euler questions