Example solution for Project Euler problem #1