Browse by Tags

Related Posts

  • Project Euler and infinite sequences in C#

    The second problem at Project Euler proposes: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... Find the sum of all the even-valued terms in the sequence which do not exceed...
    Posted to .NET at 9.400 ft above sea level (Weblog) by Edgar Sánchez on 04-17-2008, 12:00 AM
    Filed under: C# 3.0, LINQ, Functional Programming
  • Finding the largest prime factor of a number

    This is another classic problem at Project Euler that can be solved with the old trick of top down programming, like so: PrimeFactors(number).DefaultIfEmpty(number).Max(); It's a nice solution, supposing PrimeFactors() actually returns all prime factors of any given number. But before getting there,...
    Posted to .NET at 9.400 ft above sea level (Weblog) by Edgar Sánchez on 04-19-2008, 12:00 AM
    Filed under: Functional Programming, LINQ, Math, C# 3.0
  • Which is the ten thousand first prime?

    Prime numbers have a good deal of practical applications (for example in cryptography) but let's face it, even if they would have none, they would still be the favorite toy of mathematicians . In Problem 7 of Project Euler , we are asked to find the 10001st element of the famous list, my approach was...
    Posted to .NET at 9.400 ft above sea level (Weblog) by Edgar Sánchez on 05-02-2008, 12:00 AM
    Filed under: C#, Functional Programming, LINQ, Math, C# 3.0, Project Euler
Page 1 of 1 (3 items)