Project Euler – Problem 2

The problem description of Problem 2 of Project Euler reads

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 four million.

Before heading on with a solution, I will make a small comment on the problem formulation. Usually the first two numbers in the Fibonacci sequence is defined as F1 = F2 = 1. But that is just nitpicking and wont change anything in the solution.

Continue reading →

Posted by Kristian in Project Euler, 28 comments

Project Euler – Problem 1

Now that the fluff around the coding is covered, we are ready to solve the first problem.

The description of problem 1 on Project Euler reads

Find the sum of all the multiples of 3 or 5 below 1000.

There are multiple methods for finding the solution for this problem…
Continue reading →

Posted by Kristian in Project Euler, 48 comments

Project Euler – Prolog

Recently I found a website called Project Euler. It is a website, which has a series of problems which can be solved using a mix of math and programming. I like both math and programming, so I really do enjoys the problems. I have only solved a fraction of the problems, but I have already touched many branches of mathematics I usually don’t dabble much in.

It is stated that the problems should be solvable in under one minute once a program has been written. Writing the programs might takes several hours though, and this is the fun challenge is.

In this series of posts, I will gives a run through, and a solution methodology for solving some of the problems (the ones I have solved…), but I will in each case elaborate a bit more on it, than just finding a solution.

The code for these problems will be written in C#, and I wont provide the full code, only the useful snippets. I will use this first blog post on the subject to give you a bit of the structure around the interesting code.

Continue reading →

Posted by Kristian in Project Euler, 0 comments
This site uses cookies.