Project Euler C# Implementation