Awesome Open Source
Awesome Open Source

Project Euler solutions

A collection of Nayuki's program code to solve over 200 Project Euler math problems.

Every solved problem has a program written in Java and usually Python. Some solutions also have Mathematica and Haskell programs. Some solution programs include a detailed mathematical explanation/proof in the comments to justify the code's logic.

All problems from #1 to #100 have a Java and Python program, and problems #1 to #50 have a Mathematica program. This package contains at least 205 solutions in Java, at least 200 in Python, at least 125 in Mathematica, and at least 95 in Haskell.

Java solutions require JDK 8+. Python solutions are tested to work on CPython 3.4.3. Mathematica solutions are tested to work on Mathematica 5.1.

Home page with background info, table of solutions, benchmark timings, and more:

Copyright 2022 Project Nayuki. All rights reserved. No warranty.

This code is provided for reference only. You may republish any of this code verbatim with author and URL info intact.

You need written permission from the author to make modifications to the code, include parts into your own work, etc.

Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (838,789
Java (396,881
Algorithms (37,603
Haskell (20,637
Mathematics (10,051
Mathematica (1,937
Competitive Programming (1,542
Recursion (1,478
Dynamic Programming (745
Project Euler (161
Number Theory (141
Proofs (27