HOME

TheInfoList



OR:

Project Euler (named after
Leonhard Euler Leonhard Euler ( ; ; ; 15 April 170718 September 1783) was a Swiss polymath who was active as a mathematician, physicist, astronomer, logician, geographer, and engineer. He founded the studies of graph theory and topology and made influential ...
) is a
website A website (also written as a web site) is any web page whose content is identified by a common domain name and is published on at least one web server. Websites are typically dedicated to a particular topic or purpose, such as news, educatio ...
dedicated to a series of
computational problem In theoretical computer science, a computational problem is one that asks for a solution in terms of an algorithm. For example, the problem of factoring :"Given a positive integer ''n'', find a nontrivial prime factor of ''n''." is a computati ...
s intended to be solved with
computer program A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
s. The project attracts graduates and students interested in
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
computer programming Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...
. Since its creation in 2001 by Colin Hughes, Project Euler has gained notability and popularity worldwide. It includes 929 problems as of March 31 2025, with a new one added approximately every week. Problems are of varying difficulty, but each is solvable in less than a minute of
CPU time CPU time (or process time) is the amount of time that a central processing unit (CPU) was used for processing instructions of a computer program or operating system. CPU time is measured in clock ticks or seconds. Sometimes it is useful to con ...
using an efficient algorithm on a modestly powered computer.


Features of the site

A forum specific to each question may be viewed after the user has correctly answered the given question. Problems can be sorted on ID, number solved and difficulty. Participants can track their progress through achievement levels based on the number of problems solved. A new level is reached for every 25 problems solved. Special awards exist for solving special combinations of problems. For instance, there is an award for solving fifty prime numbered problems. A special "Eulerians" level exists to track achievement based on the fastest fifty solvers of recent problems so that newer members can compete without solving older problems.


Example problem and solutions

The first Project Euler problem is '
Multiples of 3 and 5
''
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
It is a 5% rated problem, indicating it is one of the easiest on the site. The initial approach a beginner can come up with is a bruteforce attempt. Given the upper bound of 1000 in this case, a bruteforce is easily achievable for most current home computers. A Python code that solves it is presented below. def solve(limit): total = 0 for i in range(limit): if i % 3

0 or i % 5

0: total += i return total print(solve(1000))
This solution has a
Big O Notation Big ''O'' notation is a mathematical notation that describes the asymptotic analysis, limiting behavior of a function (mathematics), function when the Argument of a function, argument tends towards a particular value or infinity. Big O is a memb ...
of O(n). A user could keep refining their solution for any given problem further. In this case, there exists a constant time solution for the problem. The inclusion-exclusion principle claims that if there are two finite sets A, B, the number of elements in their union can be expressed as , A \cup B, = , A, + , B, - , A \cap B, . This is a pretty popular combinatorics result. One can extend this result and express a relation for the sum of their elements, namely \sum_ x = \sum_ x + \sum_ x - \sum_ x Applying this to the problem, have A denote the multiples of 3 up to n and B the multiples of 5 up to n , the problem can be reduced to summing the multiples of 3, adding the sum of the multiples of 5, and subtracting the sum of the multiples of 15. For an arbitrarily selected k , one can compute the multiples of k up to n via k + 2k + 3k + \ldots + \lfloor n/k \rfloor k = k (1 + 2 + 3 + \ldots + \lfloor n/k \rfloor) = k \frac2 Later problems progress (non-linearly) in difficulty, requiring more creative methodology and higher understanding of the mathematical principles behind the problems.


Project Euler Community

Project Euler fosters a community on its official website where members engage in discussion after entering the correct solution. Many also share their detailed approaches on external platforms such as
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
and personal websites, promoting collaborative learning and the development of even more creative solutions.


See also

* List of computer science awards *
List of things named after Leonhard Euler In mathematics and physics, many topics are named in honor of Swiss mathematician Leonhard Euler (1707–1783), who made many important discoveries and innovations. Many of these items named after Euler include their own unique function, equation ...


References


External links

* {{Official website
Project Euler forum

Project Euler translations into several other languages
Mathematics websites Programming contests Problem solving Puzzles British educational websites Mathematics education in the United Kingdom