Project Euler Solutions

Source Code

Project Euler is a massive collection of cool problems that combine math and coding. They're pretty fun to solve and I enjoy writing up my solutions and benchmarking them, especially on much larger inputs. Sometimes I also like to tackle more general problems than the ones presented. I solve the problems using Julia. The code is available on GitHub in ProjectEulerSolutions.jl along with tests and benchmarks.

Project Euler strongly discourages the sharing or publishing of any solutions beyond the first 100 problems. I disagree with this stance though. I think nobody should be sharing or publishing the numerical answers so that others can just copy paste without putting in any effort or learning anything. But I also think we should be encouraging high-quality explanations and derivations, good quality code, and explorations beyond the original problems. I do learn a lot by getting stuck and struggling through problems (some of which I keep revisiting for years) but I also learn a ton from others who share their solutions.

Benchmarks

I benchmark code using the BenchmarkTools.jl package. It produces beautiful and insightful unicode plots which I embed here. You can click on any timing to see more information about each benchmark and compare benchmarks across CPUs.

Right now I benchmark on a bunch of different AMD and Intel CPUs. For AMD we have the Ryzen Threadripper 7960X workstation, the Ryzen 9 5900X desktop, a dual EPYC 7402 server, a dual EPYC 9374F server, and an ancient Phenom II X4 970 desktop server. For Intel we have the Core Ultra 5 238V from a Microsoft Surface Pro, the Core i7-7700HQ from an older Dell XPS laptop, the Core i7-4810MQ from an older Dell Precision laptop, and the ancient Core 2 Duo E7400 desktop server.

Problems

Bonus problems