Archive of stories published by Project Euler

Project Euler : 86–90

This problem does not have something new, just like most other problems on ProjectEuler. I wrote a brute force algorithm and I don’t think there is any other way except checking every possibility. Pre-calculate all primes below 50…


Project Euler : 91–95

This is an easy problem but a naive method would be very slow. So a little optimization is needed. A catch that will reduce your work almost ten-thousand fold is the fact that the sum of square of digits below ten million can never…


Project Euler : 81–85

No doubt this is an interesting problem. To solve this I have populated all the cells of matrix from top to bottom, column-wise in each row. To reach any cell there are only two ways either from top or from left. Since I am populating…


Project Euler : 46–50

Don’t think much, go straight to the simple brute force algorithm. Since I had no idea about upper bound so instead of taking huge memory in code I stored primes below 1 million in file test2.txt and for each number from 2 to 1 million…


Project Euler : 61–65

The first thought in your mind would be to write a brute force algorithm, but I wrote a clever one. Let me explain it without further boasting. Find nth root of smallest and largest ’n’ digit numbers (say a and b). Now we are sure that…


Project Euler : 56–60

For a language like Python, its a child play. So I used that and implemented my brute force algorithm which checks every number, raise its power and finds sum of digits in it. Gives answer in 1 second


Project Euler : 41–45

I now seem to be in love with pandigital numbers. I love solving problems of it. Pandigital numbers of 9-digit, 8-digit, 6-digit, 5-digit are all divisible by 3 and this has reduced our search space by huge amount. We now just have to…


Project Euler : 76–80

This is called Partition problem in number theory. Read the generating method here on Wikipedia and you can easily write code for this.


Project Euler : 71–75

I had already seen a problem of such kind on SPOJ here. So I knew this is called ‘Farey Sequence’. You can easily find neighbor of any fraction in Farey sequence, read this Wikipedia page.

These were the top 10 stories published by Project Euler; you can also dive into yearly archives: 2009, 2010, and 2011.