They don't have an actual online judge system, all problems simply have a single small string solution, almost always integer or fixed precision floating point, and they just check that you've found the value.
The only metric that matters is who solved the problem first after publication. This is visible e.g. at: projecteuler.net/fastest=454 but only for logged in users... Lol it is ridiculous. The "language" in which problems were solved is just whatever the user put in their profile, they can't actually confirm that.
Problems are under CC BY-NC-SA: projecteuler.net/copyright
Once you solve a problem, you can then access its "private" forum thread: projecteuler.net/thread=950 and people will post a bunch of code solutions in there.
How problems are chosen:
projecteuler.net says it started as a subsection in mathschallenge.net, and in 2006 moved to its own domain. WhoisXMLAPI WHOIS history says it was registered by domainmonster.com but details are anonymous. TODO: sample problem on mathschallenge.net on Wayback Machine? Likely wouldn't reveal much anyways though as there is no attribution to problem authors on that site.
www.hackerrank.com/contests/projecteuler/challenges holds challenges with an actual judge and sometimes multiple test cases so just printing the final solution number is not enough.
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.
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.Bibliography:
Repositories of numerical solutions:
Repositories of code solutions:
- euler.stephan-brumme.com/ large number of solutions in C++, stopped around 600. Informal permissive license, e.g. at: euler.stephan-brumme.com/243/Asked for a more formal open license at: github.com/stbrumme/euler/issues/7All of my solutions can be used for any purpose and I am in no way liable for any damages caused.
- www.ivl-projecteuler.com/home 330+ solutions in Python as of 2025. Random looking problem selection. On GitHub: github.com/igorvanloo/Project-Euler-Explained under Unlicense license, a public domain license.
- www.nayuki.io/page/project-euler-solutions. Large number of solutions, mostly in Java and Python primarily but also Mathematica and Haskell sometimes. Proprietary license.
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.
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:
- github.com/mfornet/project-euler-lean Attempts proofs, but only did Project Euler problem 1 :-)
- github.com/pcpthm/pe solved the first 50, but as stated on the README itself, no proofs, so boring
- unreasonableeffectiveness.com/learning-lean-4-as-a-programming-language-project-euler/ solves 4, but no proofs
Mentions:
- Alex J. Best (Jun 29 2022 at 14:20) on the Lean Zulip mentions:That dude was actually working at harmonic.fun as of 2025, bastard.
It would also be very interesting to collect verified fast Project Euler solutions for Lean 4 at some point, this would simultaneously work out the compiled speed and the mathematics libraries which would be fun.
- codeforces.com/blog/entry/124615
In other proof assistants, therefore with similar beauty:
- Coq
- github.com/airobo/Project-Euler-in-Coq: 1 and 2 with proofs
The beauty of Project Euler is that it would serve both as a AI code generation benchmark and as an AI Math benchmark!
Bibliography:
Claude says he's from the UK and has a background in mathematics. Oxbridge feels likely. How I Failed, Failed, and Finally Succeeded at Learning How to Code says he started off on the ORIC computer, which is British-made, so he is likely British.
This was a registration CAPTCHA problem as of 2025:Python solution:At: euler/0.py
Among the first 510 thousand square numbers, what is the sum of all the odd squares?
s = 0
for i in range(1, 510001, 2):
s += i*i
print(s)Solution:
233168Solutions to the ProjectEuler+ version:
The original can be found with:
printf '1\n1000\n' | euler/1.pyNumerical solution from github.com/lucky-bai/projecteuler-solutions/issues/102:
547480666A(x) = x + 1
Z(u)(v) = v
S(u)(v)(w) = v(u(v)(w))S
(S)
(S(S))
(S(Z))
(A)
(0)
S
(S)
(
S
(S(S))
(S(Z))
)
(A)
(0)
S
(S(S))
(S(Z))
(
S
(
S
(S(S))
(S(Z))
)
(A)
)
(0)
S
(Z)
(
S(S)
(S(Z))
(
S
(
S
(S(S))
(S(Z))
)
(A)
)
)
(0)
S(S)
(S(Z))
(
S
(
S
(S(S))
(S(Z))
)
(A)
)
(
Z
(
S(S)
(S(Z))
(
S
(
S
(S(S))
(S(Z))
)
(A)
)
)
(0)
)
S
(S)
(S(Z))
(
S
(
S
(S(S))
(S(Z))
)
(A)
)
(0)So we see that all of these rules resolve quite quickly and do not go into each other.
S however offers some problems, in that:C_0 = Z
C_i = S(C_{i-1})
D_i = C_i(S)(S)Calculate the nine first digits of:
D_a(D_b)(D_c)(C_d)(A)(e)Removing
D_a:S^i(Z)S)(S)(D_b)(D_c)(C_d)(A)(e)Numerical solution:
1038733707Programs:
A naive
T in Python is:from collections import deque
def T(a: int, b: int, N: int) -> int:
total = a
q = deque([a] * (a - 1))
is_a = False
for i in range(N - 1):
cur = q.popleft()
total += cur
q.extend([a if is_a else b] * cur)
is_a = not is_a
return total
assert T(2, 3, 10) == 25
assert T(4, 2, 10**4) == 30004
assert T(5, 8, 10**6) == 649987122332223332233 which has 14 digits.Maybe if
T is optimized enough, then we can just bruteforce over the ~40k possible sum ranges 2 to 223. 1 second would mean 14 hours to do them all, so bruteforce but doable. Otherwise another optimization step may be needed at that level as well: one wonders if multiple sums can be factored out, or if the modularity can of the answer can help in a meaningful way. The first solver was ecnerwala using C/C++ in 1 hour, so there must be another insight missing, unless they have access to a supercomputer.The first idea that comes to mind to try and optimize
T is that this is a dynamic programming, but then the question is what is the recurrence relation.The sequence appears to be a generalization of the Kolakoski sequence but to numbers other than 1 and 2, also known as the Generalized Kolakoski sequence.
maths-people.anu.edu.au/~brent/pd/Kolakoski-ACCMCC.pdf "A fast algorithm for the Kolakoski sequence" might provide the solution, the paper says:and provides exactly a recurrence relation and a dynamic programming approach.
www.reddit.com/r/dailyprogrammer/comments/8df7sm/20180419_challenge_357_intermediate_kolakoski/ might offer some reference implementations. It references a longer slide by Brent: maths-people.anu.edu.au/~brent/pd/Kolakoski-UNSW.pdf
www.reddit.com/r/algorithms/comments/8cv3se/kolakoski_sequence/ asks for an implementation but no one gave anything. Dupe question: math.stackexchange.com/questions/2740997/kolakoski-sequence contains an answer with Python and Rust code but just for the original 1,2 case.
github.com/runbobby/Kolakoski has some C++ code but it is not well documented so it's not immediately easy to understand what it actually does. It does appear to consider the m n case however.
Bibligraphy:
- pubs.sciepub.com/tjant/5/4/4/index.html Some Formulas for the Generalized Kolakoski Sequence Kol(a, b) by Abdallah Hammam. Maybe these identities could be useful.
Announcements:
Numerical solution:
1033654680825334184Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/issues/87
Numerical solution:
726010935Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/issues/105
This problem took several months to get publicly leaked, one of the longest by far on github.com/lucky-bai/projecteuler-solutions
Numerical solution:
176907658Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/pull/88
Numerical solution:
736463823Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/pull/88
Numerical solution:
6795261671274Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/pull/89
Numerical solution:
882086212Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/commit/a6ff5a562e32d17b044638b72f831d7bcba96ef2
Numerical solution:
367554579311Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/commit/f7d538c7fa68d4a502da6705fd7ec3afc89e0cf9#diff-37cf8442cb9ce8d4c7401df424ea9362634a8a8733caa930c07346ea624be24fR961
Programs: TODO!
Numerical solution:
367554579311Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/issues/93
Numerical solution:
243559751Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/issues/93
Numerical solution:
166666666689036288Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/pull/94
Numerical solution:
7259046Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/pull/95
Numerical solution:
55129975871328418Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/issues/98
Numerical solution:
29337152.09Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/pull/97
Programs:
Numerical solution:
357591131712034236Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/pull/97
Numerical solution:
885362394Earliest known public leak: github.com/lucky-bai/projecteuler-solutions/issues/98
Numerical solution:
44754029Earliest known public leak: x.com/cirosantilli/status/1990363555309490585
Numerical solution:
33626723890930Earliest known public leak:
Numerical solution:
3575508Earliest known public leak:
Numerical solution:
427278142Earliest known public leak:
Notes:
- matharena.ai/?comp=euler--euler from MathArena claims Gemini 3 solved it
- x.com/roanoke_gal/status/1997322744594125081 claims GPT-5.1 Pro solved it.
Numerical solution:
13313751171933973557517973175Earliest known public leak:
As mentioned at euler.stephan-brumme.com these tend to be harder, as they have their own judge system that actually runs programs, and therefore can test input multiple test cases against their reference implementation rather than just hard testing the result for a single input.
Goes only up to Project Euler problem 254 as of 2025, which had been published much much earlier, in 2009, so presumably they've stopped there.
Articles by others on the same topic
Project Euler is a collection of challenging mathematical and computational problems that require creative problem-solving and programming skills to solve. It was started by Colin Hughes in 2001 and is named after the famous mathematician Leonhard Euler. The problems range in difficulty, and they often require a combination of mathematical insight and coding proficiency to derive efficient solutions. The problems typically involve numerical computations, algorithms, and sometimes require knowledge of number theory, combinatorics, or other mathematical areas.