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 ...
Even Fibonacci Numbers
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting w...
Largest Prime Factor
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 6008...
Largest Palindrome Product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2...
Smallest Multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any rema...
Sum Square Difference
The sum of the squares of the first ten natural numbers is, $$1^2 + 2^2 + ... + 10^2 = 385.$$ The s...
10001st Prime
By listing the first six prime numbers: $2, 3, 5, 7, 11$, and $13$, we can see that the $6$th prime ...
Largest Product in a Series
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 =...
Special Pythagorean Triplet
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, $$a^2 + b^2 = c^2.$$...
Summation of Primes
The sum of the primes below $10$ is $2 + 3 + 5 + 7 = 17$. Find the sum of all the primes below two ...
Largest Product in a Grid
In the 20x20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38...
Highly Divisible Triangular Number
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle num...
Large Sum
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. (The 100 nu...
Longest Collatz Sequence
The following iterative sequence is defined for the set of positive integers: - $n \rightarrow n/2$...
Lattice Paths
Starting in the top left corner of a $2 \times 2$ grid, and only being able to move to the right and...
Power Digit Sum
$2^{15} = 32768$ and the sum of its digits is $3 + 2 + 7 + 6 + 8 = 26$. What is the sum of the digi...
Number Letter Counts
If the numbers $1$ to $5$ are written out in words: one, two, three, four, five, then there are $3 +...
Maximum Path Sum I
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the ma...
Counting Sundays
You are given the following information, but you may prefer to do some research for yourself. - 1 J...
Factorial Digit Sum
$n!$ means $n \times (n - 1) \times \cdots \times 3 \times 2 \times 1$. For example, $10! = 10 \tim...
Amicable Numbers
Let $d(n)$ be defined as the sum of proper divisors of $n$ (numbers less than $n$ which divide evenl...
Names Scores
Using [names.txt](https://projecteuler.net/resources/documents/0022_names.txt), a 46K text file cont...
Non-Abundant Sums
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number...
Lexicographic Permutations
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of...
1000-digit Fibonacci Number
The Fibonacci sequence is defined by the recurrence relation: $F_n = F_{n - 1} + F_{n - 2}$, where ...
Reciprocal Cycles
A unit fraction contains $1$ in the numerator. The decimal representation of the unit fractions with...
Quadratic Primes
Euler discovered the remarkable quadratic formula: $n^2 + n + 41$ It turns out that the formula wi...
Number Spiral Diagonals
Starting with the number $1$ and moving to the right in a clockwise direction a $5$ by $5$ spiral is...
Distinct Powers
Consider all integer combinations of $a^b$ for $2 \le a \le 5$ and $2 \le b \le 5$: $$ \begin{array...
Digit Fifth Powers
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their d...
Problem 31
In the United Kingdom the currency is made up of pound (£) and pence (p). There are eight coins in g...
Problem 32
Pandigital Products We shall say that an n-digit number is pandigital if it makes use of all the dig...
Problem 33
Digit Cancelling Fractions The fraction 49/98 is a curious fraction, as an inexperienced mathematici...
Digit Factorials
$145$ is a curious number, as $1! + 4! + 5! = 1 + 24 + 120 = 145$. Find the sum of all numbers whic...
Circular Primes
The number, $197$, is called a circular prime because all rotations of the digits: $197$, $971$, and...
Double-base Palindromes
The decimal number, $585 = 1001001001_2$ (binary), is palindromic in both bases. Find the sum of al...
Truncatable Primes
The number $3797$ has an interesting property. Being prime itself, it is possible to continuously re...
Pandigital Multiples
Take the number $192$ and multiply it by each of $1$, $2$, and $3$: $$\begin{align} 192 \times 1 &=...
Integer Right Triangles
If $p$ is the perimeter of a right angle triangle with integral length sides, $\{a, b, c\}$, there a...
Champernowne's Constant
An irrational decimal fraction is created by concatenating the positive integers: $$0.12345678910{\c...
Pandigital Prime
We shall say that an $n$-digit number is pandigital if it makes use of all the digits $1$ to $n$ exa...
Coded Triangle Numbers
The $n$<sup>th</sup> term of the sequence of triangle numbers is given by, $t_n = \frac12n(n+1)$; so...
Sub-string Divisibility
The number, $1406357289$, is a $0$ to $9$ pandigital number because it is made up of each of the dig...
Pentagon Numbers
Pentagonal numbers are generated by the formula, $P_n=n(3n-1)/2$. The first ten pentagonal numbers a...
Triangular, Pentagonal, and Hexagonal
Triangle, pentagonal, and hexagonal numbers are generated by the following formulae: Triangle: T_n ...
Goldbach's Other Conjecture
It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a...
Distinct Primes Factors
The first two consecutive numbers to have two distinct prime factors are: - 14 = 2 × 7 - 15 = 3 × 5...
Self Powers
The series, $1^1 + 2^2 + 3^3 + \cdots + 10^{10} = 10405071317$. Find the last ten digits of the ser...
Prime Permutations
The arithmetic sequence, $1487, 4817, 8147$, in which each of the terms increases by $3330$, is unus...
Consecutive Prime Sum
The prime $41$, can be written as the sum of six consecutive primes: $$41 = 2 + 3 + 5 + 7 + 11 + 13...
Prime digit replacements
By replacing the 1st digit of the 2-digit number *3, it turns out that six of the nine possible valu...
Permuted multiples
It can be seen that the number, $125874$, and its double, $251748$, contain exactly the same digits,...
Combinatoric selections
There are exactly ten ways of selecting three from five, 12345: 123, 124, 125, 134, 135, 145, 234, ...
Poker hands
In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the...
Lychrel numbers
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic. Not all numbers produce palind...
Powerful digit sum
A googol (10^100) is a massive number: one followed by one-hundred zeros; 100^100 is almost unimagin...
Square root convergents
It is possible to show that the square root of two can be expressed as an infinite continued fractio...
Spiral primes
Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length ...
XOR Decryption
Each character on a computer is assigned a unique code and the preferred standard is ASCII (American...
Prime pair sets
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two primes and concatenating them...
Cyclical Figurate Numbers
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygon...
Cubic Permutations
The cube, $41063625$ ($345^3$), can be permuted to produce two other cubes: $56623104$ ($384^3$) and...
Powerful Digit Counts
The $5$-digit number, $16807=7^5$, is also a fifth power. Similarly, the $9$-digit number, $13421772...
Odd Period Square Roots
All square roots are periodic when written as continued fractions and can be written in the form: $...
Convergents of e
The square root of 2 can be written as an infinite continued fraction. $$\sqrt{2} = 1 + \dfrac{1}{2...
Diophantine Equation
Consider quadratic Diophantine equations of the form: $$x^2 - Dy^2 = 1$$ For example, when $D=13$,...
Maximum Path Sum II
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the ma...
Magic 5-gon Ring
Consider the following "magic" 3-gon ring, filled with the numbers 1 to 6, and each line adding to n...
Totient Maximum
Euler's totient function, φ(n) [sometimes called the phi function], is defined as the number of posi...
Totient Permutation
Euler's totient function, $\phi(n)$ [sometimes called the phi function], is used to determine the nu...
Ordered Fractions
Consider the fraction, $\dfrac n d$, where $n$ and $d$ are positive integers. If $n \lt d$ and $\ope...
Counting Fractions
Consider the fraction, $\dfrac n d$, where $n$ and $d$ are positive integers. If $n \lt d$ and $\ope...
Counting Fractions in a Range
Consider the fraction, $\dfrac n d$, where $n$ and $d$ are positive integers. If $n \lt d$ and $\ope...
Digit Factorial Chains
The number $145$ is well known for the property that the sum of the factorial of its digits is equal...
Singular Integer Right Triangles
It turns out that **12 cm** is the smallest length of wire that can be bent to form an integer sided...