Skip to content

Personal solutions and attempts to the problems listed on Project Euler Archives

Notifications You must be signed in to change notification settings

enzoblindow/project-euler

Repository files navigation

Project Euler

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.

Add problem to repository

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.

Runtime tracker

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

Benchmarking

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.

Archive

Solutions (stale, refer to problems folder)

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

About

Personal solutions and attempts to the problems listed on Project Euler Archives

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages