Select Page

Project Euler 7: 10001st prime – SOLVED

Project Euler 7 Problem Statement By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10001st prime number? Solution This solution will solve both this problem and the HackerRank version of Project Euler 7....

Project Euler 8: Largest product in a series – SOLVED

Project Euler 8 Problem Statement The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. 73167176531330624919225119674426574742355349194934699893520312774506326239578318016984… Find the greatest product of 13...

Project Euler 9: Special Pythagorean triplet – SOLVED

Project Euler 9 Problem Statement A Pythagorean triplet is a set of three natural numbers, a ≤ b < c, for which, For example, . There exists exactly one Pythagorean triplet for which a + b + c = 1000.Find the product abc. Solution A Pythagorean triple consists of...

Project Euler 10: Summation of primes – SOLVED

Project Euler 10 Problem Statement The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. Solution Using our prime number sieve introduced in problem 7 this is easy to solve in less than 100ms with a couple lines of...

Project Euler 11: Largest product in a grid – SOLVED

Project Euler 11 Problem Statement Project Euler 11: In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31...

Project Euler 12: Highly divisible triangular number

Project Euler 12 Problem Statement Project Euler 12: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55,...