This is a list of codes and solutions to Project Euler.
I consider internet resources such as Wikipedia, MathWorld, and OEIS fair game as long as it doesn't reference the Project Euler problem in particular. It is up to the problemsetter, and not the contestant, to set non-trivial problems that are not just a standard application of a theorem. Currently, I have tags disabled.
My code is written in Julia, Python, Mathematica, and C++. You can find a (deprecated) list of my templates on my blog or my code library. I have a list of commonly used templates and sequences specific to Project Euler in this repository, which I import as necessary in my solutions. Finally, you can find codes for similar problems on my CodeForces or AtCoder profiles.
In my C++ codes I will sometimes import files from the AtCoder Library. This is a library of templates for commonly used algorithm, the most useful of which is the modular int.
I use a 2019 16-inch MacBook with a 2.6 GHz 6-Core Intel Core i7. Python codes are run using python3. C++ files are compiled using g++-12 m.cpp -std=c++20 -O2 -DLOCAL -I ${LIBRARY_PATH} -o m.out, where ${LIBRARY_PATH} is a local file path to a directory with the Atcoder Library and local utility files (including a debug template). On slower codes I will compile using -O3 or -Ofast optimizations instead. I will generally try to abide by the "one-minute rule", in which a program to solve any given problem will take at most 60 seconds to run on a decent CPU.
Problems Solved: 206
Problems Attempted: 210
List of Solved Problems
- 1: Multiples of 3 or 5
- 2: Even fibonacci numbers
- 3: Largest prime factor
- 4: Largest palindrome product
- 5: Smallest multiple
- 6: Sum square difference
- 7: 10001st prime
- 8: Largest product in a series
- 9: Special pythagorean triple
- 10: Summation of primes
- 11: Largest product in a grid
- 12: Highly divisible triangular number
- 13: Large sum
- 14: Longest collatz sequence
- 15: Lattice paths
- 16: Power digit sum
- 17: Number letter counts
- 18: Maximum path sum I
- 19: Counting sundays
- 20: Factorial digit sum
- 21: Amicable numbers
- 22: Names score
- 23: Non abundant sums
- 24: Lexicographic permutations
- 25: 1000 digit fibonacci number
- 26: Reciprocal cycles
- 27: Quadratic primes
- 28: Number spiral diagonals
- 29: Distinct powers
- 30: Digit fifth powers
- 31: Coin sums
- 32: Pandigital products
- 33: Digit cancelling fractions
- 34: Digit factorials
- 35: Circular primes
- 36: Double base polindrome
- 37: Truncatable primes
- 38: Pandigital multiples
- 39: Integer right triangles
- 40: Champernownes constant
- 41: Pandigital prime
- 42: Coded triangle numbers
- 43: Sub string divisibility
- 44: Pentagon numbers
- 45: Triangular pentagonal and hexagonal
- 46: Goldbacks other conjecture
- 47: Distinct prime factors
- 48: Self powers
- 49: Prime permutations
- 50: Consecutive prime sum
- 51: Prime digit replacements
- 52: Permuted multiples
- 53: Combinatoric selections
- 54: Poker hands
- 55: Lychrel numbers
- 56: Powerful digit sum
- 57: Square roots convergents
- 58: Spiral primes
- 59: Xor decryption
- 60: Prime pair sets
- 61: Cyclical figurate numbers
- 62: Cubic permutations
- 63: Powerful digits count
- 64: Odd period square roots
- 65: Convergents of e
- 66: Diophantine equation
- 67: Maximum path sum II
- 68: Magic 5 gon ring
- 69: Totient maximum
- 70: Totient permutation
- 71: Ordered fractions
- 72: Counting fractions
- 73: Counting fractions in a range
- 74: Digit factorial chains
- 75: Singular integer right triangles
- 76: Counting summations
- 77: Prime summations
- 78: Coin partitions
- 79: Password derivation
- 80: Square root digital expansion
- 81: Path sum two ways
- 82: Path sum three ways
- 83: Path sum four ways
- 85: Counting rectangles
- 86: Cuboid route
- 87: Prime power triples
- 89: Roman numerals
- 90: Cube digit pairs
- 91: Right triangles with integer coordinates
- 92: Square digit chains
- 93: Arithmetic expressions
- 94: Almost equilateral triangles
- 95: Amicable chains
- 96: Su doku
- 97: Large non mersenne prime
- 99: Largest exponential
- 100: Arranged probability
- 101: Optimum polynomial
- 102: Triangle containment
- 103: Special subset sums optimum
- 104: Pandigital fibonacci ends
- 105: Special subset sum testing
- 107: Minimal network
- 108: Diophantine reciprocals I
- 110: Diophantine reciprocals II
- 112: Bouncy numbers
- 113: Non bouncy numbers
- 114: Counting block combinations I
- 115: Counting block combinations II
- 116: Red green or blue tiles
- 117: Red green and blue tiles
- 119: Digit power sum
- 120: Square remainders
- 121: Disc game prize fund
- 122: Efficient exponentiation
- 123: Prime square remainders
- 124: Ordered radicals
- 125: Palindromic sums
- 131: Prime cube partnership
- 132: Large repunit factors
- 133: Repunit nonfactors
- 134: Prime pair connection
- 135: Same differences
- 136: Singleton difference
- 142: Perfect square collection
- 145: How many reversible numbers are there below one billion
- 146: Investigating a prime pattern
- 148: Exploring pascals triangle
- 149: Searching for a maximum sum subsequence
- 150: Searching a triangular array for a sub triangle having minimum sum
- 152: Writing 1 2 as a sum of inverse squares
- 158: Exploring strings for which only one character comes lexicographically after its neighbor to the left
- 164: Numbers for which no three consecutive digits have a sum greater than a given value
- 172: Investigating numbers with few repeated digits
- 173: Using up to one million tiles how many different hollow square laminae can be formed
- 174: Counting the number of hollow square laminae that can form one two three distinct arrangements
- 178: Step numbers
- 179: Consecutive positive divisors
- 181: Investigating in how many ways objects of two different colors can be grouped
- 183: Maximum product of parts
- 185: Number mind
- 186: Connectedness of a network
- 187: Semiprimes
- 188: The hyperexponentiation of a number
- 189: Tri colouring a triangular grid
- 190: Maximising a weighted product
- 191: Prize strings
- 193: Squarefree numbers
- 197: Investigating the behavior of a recursively defined sequence
- 201: Subsets with a unique sum
- 203: Squarefree binomial coefficients
- 204: Generalised hamming numbers
- 205: Dice game
- 206: Concealed square
- 211: Divisor square sum
- 214: Totient chains
- 218: Perfect right angled triangles
- 230: Fibonacci words
- 235: An arithmetic geometric sequence
- 243: Resilience
- 249: Prime subset sums
- 258: A lagged fibonacci sequence
- 259: Reachable numbers
- 260: Stone game
- 266: Pseudo square root
- 267: Billionaire
- 291: Panaitopol primes
- 293: Pseudo fortunate numbers
- 294: Sum of digits experience 23
- 301: Nim
- 303: Multiples with small digits
- 304: Primonacci
- 317: Firecracker
- 323: Bitwise or operations on random integers
- 324: Building a tower
- 329: Prime frog
- 337: Totient squarestep sequence
- 345: Matrix sum
- 351: Hexagonal orchards
- 357: Prime generating integers
- 375: Minimum of subsequences
- 378: Triangle triples
- 381: Prime k factorial
- 387: Harshad numbers
- 401: Sum of squares of divisors
- 408: Admissible paths through a grid
- 411: Uphill paths
- 429: Sum of squares of unitary divisors
- 457: A polynomial modulo the square of a prime
- 493: Under the rainbow
- 497: Drunken tower of hanoi
- 500: Problem 500
- 504: Square on the inside
- 577: Counting hexigons
- 587: Concave triangle
- 657: Incomplete words
- 686: Powers of two
- 700: Eulercoin
- 710: One million members
- 733: Ascending subsequences
- 743: Window into a matrix
- 800: Hybrid integers
- 808: Reversible prime squares
- 816: Shortest distance among points
- 828: Numbers challenge
- 836: A bold proposition
Table of Solved Problems
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
| 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 |
| 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
| 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
| 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
| 81 | 82 | 83 | 85 | 86 | 87 | 89 | 90 | ||
| 91 | 92 | 93 | 94 | 95 | 96 | 97 | 99 | 100 | |
| 101 | 102 | 103 | 104 | 105 | 107 | 108 | 110 | ||
| 112 | 113 | 114 | 115 | 116 | 117 | 119 | 120 | ||
| 121 | 122 | 123 | 124 | 125 | |||||
| 131 | 132 | 133 | 134 | 135 | 136 | ||||
| 142 | 145 | 146 | 148 | 149 | 150 | ||||
| 152 | 158 | ||||||||
| 164 | |||||||||
| 172 | 173 | 174 | 178 | 179 | |||||
| 181 | 183 | 185 | 186 | 187 | 188 | 189 | 190 | ||
| 191 | 193 | 197 | |||||||
| 201 | 203 | 204 | 205 | 206 | |||||
| 211 | 214 | 218 | |||||||
| 230 | |||||||||
| 235 | |||||||||
| 243 | 249 | ||||||||
| 258 | 259 | 260 | |||||||
| 266 | 267 | ||||||||
| 291 | 293 | 294 | |||||||
| 301 | 303 | 304 | |||||||
| 317 | |||||||||
| 323 | 324 | 329 | |||||||
| 337 | |||||||||
| 345 | |||||||||
| 351 | 357 | ||||||||
| 375 | 378 | ||||||||
| 381 | 387 | ||||||||
| 401 | 408 | ||||||||
| 411 | |||||||||
| 429 | |||||||||
| 457 | |||||||||
| 493 | 497 | 500 | |||||||
| 504 | |||||||||
| 577 | |||||||||
| 587 | |||||||||
| 657 | |||||||||
| 686 | |||||||||
| 700 | |||||||||
| 710 | |||||||||
| 733 | |||||||||
| 743 | |||||||||
| 800 | |||||||||
| 808 | |||||||||
| 816 | |||||||||
| 828 | |||||||||
| 836 | |||||||||
Generated automatically using stats-generator.py.
