From f1f4da4e8f66e279d740ec635d837630ae3bd293 Mon Sep 17 00:00:00 2001 From: julien Lengrand-Lambert Date: Tue, 16 Oct 2012 22:20:53 +0300 Subject: [PATCH] Update README.markdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds information about how I solve problem.  Puts too long solutions in bold.  --- README.markdown | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/README.markdown b/README.markdown index e632189..a0acba6 100644 --- a/README.markdown +++ b/README.markdown @@ -1,18 +1,23 @@ - #My solutions to Project Euler 's website +# My solutions to Project Euler 's website -[Project Euler](http://projecteuler.net/) is a website containing lots of problems aiming at being solved. -I play around with them in order to sharpen my algorithm skills. +**[Project Euler](http://projecteuler.net/)** is a website containing lots of problems aiming at being solved. -This is always challenging to solve problems on paper and fantastic to come up with an algorithmic solution. +This is always challenging to solve problems on paper, and fantastic to come up with an algorithmic solution. I use Python for its simplicity. Simple Python code is very similar to paper solution, and fast to implement. -Each script runs by itself and contains one of several functions that directly solve the function. Thus, running a script should give you the answer directly. +Each script runs by itself and will directly pop the solution out. -The script are named as e_problemnumber_inc. The higher the inc, the finer my solution. +The scripts are named as e_problemnumber_inc. The higher the inc, the finer the solution. Here is a list of all already solved problems, with a one line explanation. Should be used in order to help future reuse of code :) +**Note :** I try to get my solutions within a one minute timeframe. What I want here is to solve problems, not get them running as fast as possible. +So you may find some of the code here quite ugly. And this is the case :). Why optimize something that completely fits its purpose ? ;) + + +## Problems solved + 1 - Add all the natural numbers below one thousand that are multiples of 3 or 5. - 0.011
2 - By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. - 0.011
3 - Find the largest prime factor of a composite number. - < 1 sec
@@ -22,11 +27,11 @@ Should be used in order to help future reuse of code :) 7 - Find the 10001st prime. - too long
8 - Discover the largest product of five consecutive digits in the 1000-digit number. - 0.045
9 - Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000. (a^2 + b^2 = c^2) - 1.500
-10 - Calculate the sum of all the primes below two million. - too long
+10 - Calculate the sum of all the primes below two million. - **too long**
11 - What is the greatest product of four adjacent numbers on the same straight line in the 20 by 20 grid? - 0.048
-12 - What is the value of the first triangle number to have over five hundred divisors? - too long
+12 - What is the value of the first triangle number to have over five hundred divisors? - **too long**
13 - Find the first ten digits of the sum of one-hundred 50-digit numbers. - 0.012
-14 - Find the longest sequence using a starting number under one million. - too long
+14 - Find the longest sequence using a starting number under one million. - **too long**
15 - Starting in the top left corner in a 20 by 20 grid, how many routes are there to the bottom right corner? - 0.012
16 - What is the sum of the digits of the number 2^1000? - 0.012
17 - How many letters would be needed to write all the numbers in words from 1 to 1000? - 0.012
@@ -35,18 +40,18 @@ Should be used in order to help future reuse of code :) 20 - Find the sum of digits in 100! - 0.031
21 - Evaluate the sum of all amicable pairs under 10000. (d(a) = b, d(b) = a) - 9.100
22 - What is the total of all the name scores in the file of first names? - 0.082
-23 - Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers. - _too long_
-24 - What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9? - too long
+23 - Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers. - **too long**
+24 - What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9? - **too long**
25 - What is the first term in the Fibonacci sequence to contain 1000 digits? - 0.741
26 - Find the value of d < 1000 for which 1/d contains the longest recurring cycle. < 5 sec
-27 - Find a quadratic formula that produces the maximum number of primes for consecutive values of n. - too long
+27 - Find a quadratic formula that produces the maximum number of primes for consecutive values of n. - **too long**
28 - What is the sum of both diagonals in a 1001 by 1001 spiral? - < 1 sec
29 - How many distinct terms are in the sequence generated by ab for 2 a 100 and 2 b 100? - < 1 sec
30 - Find the sum of all the numbers that can be written as the sum of fifth powers of their digits. - < 3 sec
31 - Investigating combinations of English currency denominations. - < 1 sec
33 - Discover all the fractions with an unorthodox cancelling method. < 1 sec
34 - Find the sum of all numbers which are equal to the sum of the factorial of their digits. - 30 sec - 16 sec
-35 - How many circular primes are there below one million?
+35 - How many circular primes are there below one million? - **too long**
36 - Find the sum of all numbers less than one million, which are palindromic in base 10 and base 2. - 0.933
37 - Find the sum of all eleven primes that are both truncatable from left to right and right to left. < 1 min
38 - What is the largest 1 to 9 pandigital that can be formed by multiplying a fixed number by 1, 2, 3, ... ? < 1 sec
@@ -60,13 +65,11 @@ Should be used in order to help future reuse of code :) 53 - How many values of C(n,r), for 1 <= n <= 100, exceed one-million? - < 1 sec
67 - Using an efficient algorithm find the maximal sum in the triangle? - 0.027
-**In progress: ** +## In progress: 43 - Find the sum of all pandigital numbers with an unusual sub-string divisibility property.
47 - Find the first four consecutive integers to have four distinct primes factors.
-97 - Find the last ten digits of the non-Mersenne prime: 28433 × 2^7830457 + 1.
- -**WARNING : Spoil inside for those who want to solve problems by themselves :)** +97 - Find the last ten digits of the non-Mersenne prime: 28433 � 2^7830457 + 1.
## Contact @@ -75,4 +78,4 @@ Feel free to mail me for any comment or request. You can contact me at julien at lengrand dot fr, or on my [current website](http://www.lengrand.fr) -Last update : 5/6/2012 +Last update : 16/10/2012