Using Lean or other programmable proof assistants to solve Project Euler is the inevitable collision of two autisms. In particular, using Lean to prove that you have the correct solution, just making a Lean program that prints out the correct solution is likely now trivial as of 2025 by asking an LLM to port a Python solution to the new language.
Some efforts:
Mentions:
In other proof assistants, therefore with similar beauty:
Repositories of code solutions:
Repositories with hints but no solutions:
Basically no one has ever had the patience to create a single source that solves them all, all the above were done by individuals and stopped at some point. What we need is either a collaborative solution, or... LLMs.
Project Euler problems typically involve finding or proving and then using a lemma that makes computation of the solution feasible without brute force. There is often an obvious brute force approach, but the pick problem sizes large enough such that it is just not fast enough, but the non-brute-force is.
As such, they live in the intersection of mathematics and computer science.
news.ycombinator.com/item?id=7057408 which is mega high on Google says:
I love project euler, but I've come to the realization that its purpose is to beat programmers soundly about the head and neck with a big math stick. At work last week, we were working on project euler at lunch, and had the one CS PhD in our midst not jumped up and explained the chinese remainder theorem to us, we wouldn't have had a chance.
In many cases, the efficient solution involves dynamic programming.
There are also a set of problems which are very numerical analysis in nature and require the approximation of some real number to a given precision. These are often very fiddly as I doubt most people can prove that their chosen hyperparameters guarantee the required precision.
Many problems ask for solution modulo some number. In general, this is only so that C/C++ users won't have to resort to using an arbitrary-precision arithmetic library and be able to fit everything into uint64 instead. Maybe it also helps the judge system slightly having smaller strings to compare. The final modulos usually don't add any insight to the problems.
SPOJ by Ciro Santilli 40 2026-01-30
Submission type: code.
License: problem setter dependant.
AtCoder by Ciro Santilli 40 2026-01-30
Saw this one mentioned on some Project Euler forum threads.
Nice motto, knowledge olympiads:
Serious mathematics for serious high-school students: There is more to mathematics than competitions.

Unlisted articles are being shown, click here to show only listed articles.