Cascade Of Insights

Personal Site of Adam Gordon Bell - Software Engineer

Project Euler #6

Ok, this one is stupidly simple:

var squaredsum = Math.Pow(1.To(100).Sum(), 2);
var sumedsquare = 1.To(100).Select(x => x * x).Sum();
Console.WriteLine(squaredsum - sumedsquare);