C# solution to ProjectEuler Problem 4