Euler

Tag: Euler

Project Euler #19 in haskell and by hand

How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?

http://projecteuler.net/problem=19

Read more...

Project Euler #11 in haskell

What is the greatest product of four adjacent numbers in any direction (up, down, left, right, or diagonally) in the 20×20 grid?

http://projecteuler.net/problem=11

Read more...

Project Euler #24 in c#

A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:

012   021   102   120   201   210

What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?

Read more...

Project Euler 8 in C#

Discover the largest product of five consecutive digits in the 1000-digit number.

http://projecteuler.net/index.php?section=problems&id=8

Read more...

Project Euler 3 in c#

Problem 3: What is the largest prime factor of the number 600851475143 ?

http://projecteuler.net/index.php?section=problems&id=3

With enough extension methods we can make 3 really simple:

600851475143.LargestPrimeFactor()

Where:

Read more...

Project Euler #9

Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

Read more...

Project Euler #5

Here is my solution to the following project Euler Problem:

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

Read more...

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);