So now we are at Problem 100 at Project Euler, you could call this an anniversary and I would have expected something extra difficult. It took a while for me to crack the following problemIf a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs, P(BB) = (15/21)(14/20) = 1/2. By finding the first arrangement to contain over 1012 = 1,000,000,000,000 discs in total, determine the number of blue discs that the box would contain.

Continue reading...Saturday, April 28, 2012

I can realy feel that the problems become harder and harder. Problem 94 of Project Euler took me a good while to figure out. The problem is easy to understand and readsWe shall define an almost equilateral triangle to be a triangle for which two sides are equal and the third differs by no more than one unit.Find the sum of the perimeters of all almost equilateral triangles with integral side lengths and area and whose perimeters do not exceed one billion (1,000,000,000).We are dealing with a triangle with two sides of length a and one side of length b = a-1 or b = a+1. I will treat these as two different cases for the next paragraf or two.

Continue reading...Saturday, April 7, 2012

In Problem 91 of Project Euler we are dealing with a geometry problem which readsGiven that 0 ≤ x1, y1, x2, y2 **≤ ** 50, how many right triangles can be formed?The brute force solution for solving this would be to test all combinations of P and Q which is along the lines of 514 which is approximately 7.000.000 solutions to check. So we will take another approach here.There are three possibilities to make a right angled triangle. Either the right angle is at O, P and Q. O is fixed but P and Q can be interchanged so we will start by treating the regular case of the right angle being at P and 0 < x1, y1. You will see later on that the other cases are special cases which we can solve rather easily.

Saturday, March 17, 2012

Based on the number of people who have solved Problem 88 of Project Euler it seems to be a rather difficult problem. At the time of writing 2661 people have solved this problem. This post should show you that in reality the problem is not that difficult. That being said I spent the majority of a week before I got the right insights to solve it. The problem reads What is the sum of all the minimal product-sum numbers for 2≤k≤12000? Okay, that doesn’t sound too easy does it? Well I guess you wouldn’t be here if it was too easy. If you don’t want the full solution but just some insights into the maths you need to solve it, just read the first part.

Continue reading...Saturday, December 17, 2011

Assuming we have solved the problems from one end, we are now at Problem 75 of Project Euler which should unlock the 75 problem achievement as well as the Pythagorean Triplet achievement. The problem description readsGiven that L is the length of the wire, for how many values of L ≤ 1,500,000 can exactly one integer sided right angle triangle be formed?I have already noted that we should unlock the Pythagorean triplet achievement, and that is for a reason. In order to get a good solution we need to revisit the theory we used in Problem 9 about Pythagorean triples.

Continue reading...Saturday, November 19, 2011

We now have more than 70 problems under our belt and ready to attack the next one. Not that I really care about the number of problems, but this one is really really fun I think. It is easy to understand and have a really beautiful solution based on simple algebra. But lets get on with it, the problem readsBy listing the set of reduced proper fractions for d ≤ 1,000,000 in ascending order of size, find the numerator of the fraction immediately to the left of 3/7.If we just wanted to search all the proper fractions in the search space we would have to search in the ball park of 5e11 not something I am dying to do. Of course we could stop once we get about 3/7 and that would about half the search space, but still. So let's look at another method.

Continue reading...Saturday, October 1, 2011

In project Euler's problem 63 we are again crawling up above 10.000 solutions, which suggests that this problem is a bit easier than the previous ones. So let's take a look at itHow many n-digit positive integers exist which are also an nth power?If nothing else at least the description is short. I can ensure you that the coding we will do for this is short as well, but let us first do a bit of analysis on the problem.

Continue reading...Saturday, August 20, 2011

I found Problem 57 of Project Euler to be a rather interesting problem, with more than one solution. The problem description readsIn the first one-thousand expansions, how many fractions contain a numerator with more digits than denominator?First thing I will present is a brute force solution, which for all practical purposes are fast enough. The second solution is a closed form approximation to the problem, so it can be solved as fast as you can punch the calculator.

Continue reading...Tuesday, July 19, 2011

I have just finished reading Prime Obsession by John Derbyshire. A casual mathematics book which I will pass my thoughts and recommendations about this book in this post.Prime Obsession is a book about the history surrounding Bernhard Riemann and the Riemann Hypothesis. A hypothesis, which is more than 150 years, and still haven't been neither proved nor falsified. The Riemann Hypothesis tells us a lot about the Riemann zeta function and how it is linked to the distribution of primes. This link is the turning point for the whole book.The book covers two aspects of the Riemann hypothesis...

Continue reading...Sunday, May 15, 2011

Problem 42 of Project Euler presents us with a new string manipulation problem. The problem asks us the following The nth term of the sequence of triangle numbers is given by, tn = ½n(n+1); so the first ten triangle numbers are:1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...By converting each letter in a word to a number corresponding to its alphabetical position and adding these values we form a word value. For example, the word value for SKY is 19 + 11 + 25 = 55 = t10. If the word value is a triangle number then we shall call the word a triangle word.Most of the code is already written in an earlier problem, so the solution for this problem is about finding an inverse function for the triangle function and apply that to the word sum to see if the word is a triangle number.

Continue reading...This site uses cookies.

Saturday, June 9, 2012

23 Comments