Select Page

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,...

Project Euler 13: Large sum – SOLVED

Project Euler 16 Problem Statement Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 3710728753390210279879799822083759024651013574025046376937677490009712648124896970078050417018260538 … {data continues} Solution Summing a...

Project Euler 23: Non-abundant sums – SOLVED

Project Euler 23 Problem Statement A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. A...

Project Euler 35: Circular primes – SOLVED

Project Euler 35 Problem Statement The number 197 is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime. There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97. How many circular...

Project Euler 18: Maximum path sum I – SOLVED

Project Euler 18 Problem Statement By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 5 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom of...

Project Euler 19: Counting Sundays – SOLVED

Project Euler 19 Problem Statement You are given the following information, but you may prefer to do some research for yourself. A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400. How many Sundays fell on the...

Project Euler 20: Factorial digit sum – SOLVED

Project Euler 20 Problem Statement n! means n × (n − 1) × … × 3 × 2 × 1 Find the digit sum in the number 100! Solution Python natively supports arbitrary-precision integers and arithmetic with as many digits as necessary to perform a calculation.  For example,...