Bill Blogs in C#

Bill Wagner discusses C#, LINQ, and other items of interest

Browse by Tags

All Tags » Euler » C# General » C# (RSS)
Euler Problem 10
Patrick posted his solution earlier this week. I figure it was time to add mine. Also, Octavio Hernandez pointed out in the comments to problem 8 that he had discussed similar code constructs in his blog a while back. Problem 10 asks for the sum of all...

Posted by wwagner | 2 comment(s)

Euler Problem 9
I was going to wait a bit to post this, but Patrick Steele posted his solution , so I figured I should post mine. Patrick took the straight out brute force approach. I decided to think a bit differently and use the some LINQ code to generate my answer...

Posted by wwagner | 3 comment(s)

Filed under: , , ,

Euler Problem 7
Yes, it's true that I've been very lax in working on these problems. It's been a combination of the day job, finishing all the editing tasks on "More Effective C#", and actually trying to keep the personal life intact. The 7th problem...

Posted by wwagner | 7 comment(s)

Project Euler problem 6
Euler Problem six asks you to find the difference between the sum of squares and the square of the sum for the natural numbers 1 through 100. I took the easy route, and made a brute force implementation in C#. There are a couple new bits of LINQ syntax...

Posted by wwagner | 1 comment(s)

Filed under: , , ,

Euler Problem 5
Well, it's time to post another solution and look at how LINQ and C# 3.0 can create elegant code for these problems. The fifth problem asks you to find the smallest number that is divisible by all the natural numbers from 1 through 20. You can trivially...

Posted by wwagner | 1 comment(s)

Filed under: , ,

Discussion on Project Euler Problem 2
The second Euler problem asks you to find the sum of all even valued terms in the Fibonacci sequence which do not exceed 4,000,000. Let's look at the solution from the outside in. Here's the query that finds the answer: var EvenFibNumbers = (from...

Posted by wwagner | with no comments