euler

My solutions to Project Euler problems

View on GitHub

Euler

A list of the Project Euler problems I’ve solved with best solution times on a 2013 MacBook Pro.

The GitHub repo is private as Project Euler request solutions aren’t shared. But I enjoy thinking about these problems so if you want to tell me there’s a way faster solution I’ve missed or to ask about a problem, my contact details are on this page.

Timings

  Problem Python
001 Multiples of 3 and 5 1.74 µs
002 Even Fibonacci Numbers 14.8 µs
003 Largest prime factor 134 ms
004 Largest palindrome product 951 ms
005 Smallest multiple 37.5 µs
006 Sum Square Difference 1.11 µs
007 10001st prime 5.99 s
008 Largest product in a series 4.12 ms
009 Special Pythagorean Triplet 22.1 s
010 Summation of primes 3.18 s
011 Largest product in a grid 832 µs
012 Highly Divisible Triangular Number 5.48 s
013 Large Sum 5.61 µs
014 Longest Collatz sequence 54.1 s
015 Lattice paths 16.3 µs
016 Power Digit Sum 37.1 ms
017 Number letter counts 1.01 ms
018 Maximum path sum I 34 ms
019 Counting Sundays 930 µs
020 Factorial digit sums 172 ms
021 Amicable Numbers 4.95 s
022 Names scores 24 ms
023    
024 Lexicographic permutations 29.3 µs
025 1000-digit Fibonacci number 1.99 s
026    
027    
028    
029    
030    
031 Coin Sums 2.9 s
032    
033    
034 Digit factorials 13 s
035 Circular Primes 13.3 s
036 Double-base palindrome 1.01 s
037    
038    
039 Integer right triangles 828 ms
040 Champernowne’s constant 854 ms
041    
042 Coded Triangle Numbers 4.86 ms
043    
044 Pentagonal numbers 17 s
045 Triangular, pentagonal, and hexagonal 55.9 ms
046 Goldbach’s other conjecture 411 ms
047 Distinct Prime Factors 60 s
048    
049    
050    
051    
052    
053    
054    
055    
056    
057    
058    
059    
060    
061    
062    
063    
064    
065    
066    
067 Maximum path sum II 9.23ms