Skip to content
Solutions to Project Euler problems
Python Mathematica C++ TeX Haskell Clojure Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
1
10
11
113
12
122
14
146
173
2
218
3
4
5
512
540
542
543
545
546
547
548
549
550
551
552
553
6
7
8
84
86
88
9
90
91
93
94
98
98_arvind
R
haskell
js
rust
test/.idea
).py
.gitignore
100_ArrangedProbability.py
101_OptimumPolynomial.py
102_TriangleContainment.py
102_data.txt
103_SpecialSubsetSumsOptimum.py
104_PandigitalFibonacciEnds.py
107_MinimalNetwork.py
107_MinimalNetwork_nx.py
107_data.txt
108_DiophantineReciprocals.py
112_BouncyNumbers.py
114_CountingBlockCombinations.py
115_CountingBlockCombinationsII.py
116_RedGreenBlueTiles.py
117_RedGreenBlueTilesII.py
119_DigitPowerSum.py
120_SquareRemainders_(MakeFaster).py
121_DiscGamePrize.py
123_PrimeSquareRemainders.py
124_OrderedRadicals.py
125_PalindromicSums.py
126_Cuboid.py
127_abc-hits.py
128_HexagonalTileDiff.py
13_LargeSum.py
13_data.txt
142_PerfectSquareCollection.py
144_LaserBeam.py
145_ReversibleNumbers.py
148_ExploringPascal.py
154_ExploringPascalsPyramid.py
155_CapacitorCircuits.py
160_FactorialTrailingDigits.py
16_PowerDigitSum.py
173_HollowLaminaeAttempt.py
179_ConsecutivePositiveDivisors(naive_brute_force).py
17_NumLetterCounts.py
183_MaxProductOfParts.py
185_NumberMind.py
187_Semiprimes.py
187_Semiprimes2.py
188_HyperExponentiation.py
189_TriColoring.py
18_MaximumPathSum.py
18_data.txt
190_MaximizingWeightedProduct.py
191_PrizeStrings.py
197_RecursiveSequence.py
19_CountingSundays.py
203_SquareFreeBinomial.py
204_GeneralizedHamming.py
205_DiceGame.py
206_ConcealedSquare.py
20_FactorialDigitSum.py
214_TotientChains.py
216_Primality2n^2-1.py
21_AmicableNumbers.py
225_Tribonacci.py
22_NamesScores.py
22_data.txt
231_PrimeFactBinom.py
235_ArithmeticGeometricSeq(online_sol).py
235_ArithmeticGeometricSeq.py
23_NonAbundantSums.py
23_NonAbundantSums.py.lprof
243_Resilience.py
243_Resilience_brute_force.py
24_LexicographicPermutations.py
24_b.py
251_Cardano.py
25_1KDigitFib.py
26(Understand_Why_This_Works)_ReciprocalCycles.py
269_PolynomialsWithIntegerRoot.py
27_QuadraticPrimes.py
288_EnormousFactorial.py
28_NumberSpiralDiagonals.py
29_DistinctPowers.py
301_Nim.py
30_DigitFifthPowers.py
31_CoinSums.py
32_PandigitalProducts.py
33_DigitCancellingFractions.py
347_LargestIntegerDivisible.py
34_DigitFactorials.py
357_PrimeGeneratingIntegers.py
35_CircularPrimes.py
36_DoubleBasePalindromes.py
37_TruncatablePrimes.py
38_PandigitalMultiples.py
39_IntegerRightTriangles.py
401_Alex.py
401_DivisorSquares.py
401_DivisorSquares2.py
407_Alex1.py
407_Alex2.py
407_Idempotents.py
407_Idempotents_experimentation.py
407_example_sol.py
40_ChampernowneConstant.py
41_PandigitalPrime.py
42_CodedTriangleNumbers.py
42_data.txt
43_SubStringDivisibility.py
44(Prove_Upper_Bounds)_PentagonNumbers.py
455_PowersTrailingDigits.py
45_TriPentHex.py
46_GoldbachOtherConjecture.py
47(Get_Better_Time)_DistinctPrimesFactors.py
47_DistinctPrimesFactors.py
485_MaxDivisors.py
48_SelfPowers.py
493_Rainbow.py
49_PrimePermutations.py
500_MinimalNumberWithNDivisors.py
501_EightDivisors.py
504_Square_Inside.py
504_Square_Inside_(make_faster).py
50_ConsecutivePrimeSum.hs
50_ConsecutivePrimeSum.py
513_IntegralMedian.py
513_IntegralMedian.py.lprof
51_PrimeDigitReplacements.py
52_Alex.py
52_PermutedMultiples.py
53_CombinatoricSelections.py
53_CombinatoricSelections.pyc
544_Chromatic.py
545_Faulhaber.py.lprof
545_Faulhaber.py.prof
546_FloorsRevenge.py.lprof
54_PokerHands.py
54_data.txt
54_example_sol.py
54_test_data.py
54_test_data.txt
55_LychrelNumbers.py
56_PowerfulDigitSum.py
57_SquareRootConvergents.py
58_SpiralPrimes.py
59_XORDecryption.py
59_data.txt
59_log.txt
60_PrimePairSets.py
60_PrimePairSets2.py
60_PrimePairSets3.py
60_PrimePairSets4.py
61_CyclicalFigurateNumbers.py
61_CyclicalFigurateNumbers2.py
61_CyclicalFigurateNumbers3.py
62_CubicPermutations.py
62_example_sol.py
63(Prove_Upper_Bounds)_PowerfulDigitCounts.py
64_OddPeriodSquareRoots.py
65_Convergents_of_e.py
66_PellDiophantine.py
67_MaximumPathSum.py
67_data.txt
69_TotientMaximum.py
70_TotientPermutation.py
70_example_sol.py
71_OrderedFractions.py
72_CountingFractions.py
73_CountingFractionsInRange.py
74_DigitFactorialChains.py
75_SingularIntegerRightTri.py
75_SingularIntegerRightTri2.py
76_CountingSummations.py
77_PrimePartitions.py
77_PrimePartitions.py.lprof
78_CoinPartitions.py
79_PasscodeDerivation.py
79_data.txt
80_SquareRootDigitalExpansion.py
81_PathSum.py
81_data.txt
82_PathSum.py
82_PathSumThreeWays.py
82_data.txt
83_PathSumFourWays.py
83_data.txt
85_CountingRectangles.py
87_PrimePowerTriples.py
89_RomanNumerals.py
89_data.txt
92_SquareDigitChain(Solution_From_CodeReview).py
92_SquareDigitChain.py
92_SquareDigitChain_old.py
94_AlmostEquilateral.py
95_AmicableChains.py
96_Sudoku.py
96_Sudoku.py.lprof
96_Sudoku2.py
96_data.txt
97_LargeMersennePrime.py
98_AnagramicSquares.py
99_LargestExponential.py
99_data.txt
Euler.py
Euler.pyc
Problem26.class
Problem26.java
Problems.pdf
README.md
decorators.py
isPrime.hs
kernprof.py
log_test.py
progress.py
python.prof
sieve.py
sieves.py
time_tests.py
trace.py

README.md

project-euler

Solutions to various Project Euler problems. Code is primarily in Python, but there are a few solutions in various other languages (Haskell, Clojure, Rust, C++, etc.)

The code is relatively old, (dating as far back as 2014), and not always the nicest, but many of the problems have nice mathematical and algorithmic ideas.

My solution to problem 543 was documented in this blog post: Efficient prime counting with the Meissel-Lehmer algorithm.

You can’t perform that action at this time.