Personal solutions and attempts to the problems listed on Project Euler Archives benchmarked on memory footprint and processing wall time against ChatGPT, Claude, and Gemini.
Run create_solution.py
and omit the project number from the archives. It will fetch the assignment automatically and create the bare bone files with runtime tracking.
Automatically added assignments come with runtime tracking. To enable the @euler
decorator, run the following command first in the main directory to add it to the euler project to the sys.path
.
python setup.py develop
Running the solver will automatically fetch an initial zero shot attempt at a solution from ChatGPT, Claude, and Gemini on passing the problem statement. The code is executed in a containerized environment. If the executed code does not run or does not finish within 2 standard deviations of the wall time of the personal solution, a revised prompt including the error message is passed back to the LLM API with up to N_RETRIES.
PID | Problem | My Solution | Time | Mem. | ChatGPT | Time | Mem. | |
---|---|---|---|---|---|---|---|---|
001 | Multiples of 3 and 5 | Python | 131µs | ✅ | ||||
002 | Even Fibonacci numbers | Python | 10µs | ✅ | ||||
003 | Largest prime factor | Python | 69ms | ✅ | ||||
004 | Largest palindrome product | Python | 2ms | ✅ | ||||
005 | Smallest multiple | Python | 3.9s | ✅ | ||||
006 | Sum Square Difference | Python | 8µs | ✅ | ||||
007 | 10001st Prime | Python | ||||||
008 | Largest Product in a Series | Python | ||||||
009 | Special Pythagorean Triplet | Python | ||||||
185 | Number Mind | Python | 524µs | ✅ |