Bill Blogs in C#

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

Browse by Tags

All Tags » Euler » C# General (RSS)
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: , ,

Euler Problem 4: Finding Palindrome numbers
The fourth Euler problem asks you to find the largest palindrome number that is the product of two three digit numbers. For example, the number 919 is a palindrome: it's the same forward and backwards. To solve this problem, we need to find the product...

Posted by wwagner | 6 comment(s)

Filed under: , ,

Notes on Euler Problem 3
Here are my notes on the third Project Euler problem. The problem is "What is the largest prime factor of the number 600,851,475,143?" Once again, this is a problem that is best solved creating some simple LINQ queries. From the outside, this...

Posted by wwagner | 5 comment(s)

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