#61 - Cyclical figurate numbers

Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:

TypeFormulaSeries
Triangle$P_{3,n}=\frac{1}{2}n(n+1)$1, 3, 6, 10, 15, …
Square$P_{4,n}=n^2$1, 4, 9, 16, 25, …
Pentagonal$P_{5,n}=\frac{1}{2}n(3n-1)$1, 5, 12, 22, 35, …
Hexagonal$P_{6,n}=n(2n-1)$1, 6, 15, 28, 45, …
Heptagonal$P_{7,n}=\frac{1}{2}n(5n-3)$1, 7, 18, 34, 55, …
Octagonal$P_{8,n}=n(3n-2)$1, 8, 21, 40, 65

The ordered set of three 4-digit numbers: 8128, 2882, 8281, has three interesting properties.

  1. The set is cyclic, in that the last two digits of each number is the first two digits of the next number (including the last number with first).
  2. Each polygonal type: triangle ($P_{3,127}=8128$), square ($P_{4,91}=8281$), and pentagonal ($P_{5,44}=2882$), is represented by a different number in the set.
  3. This is the only set of 4-digit numbers with this property.

Find the sum of the only ordered set of six cyclic 4-digit numbers for which each polygonal type: triangle, square, pentagonal, hexagonal, heptagonal, and octagonal, is represented by a different number in the set.


#113 - Non-bouncy numbers

Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.

Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.

We shall call a positive integer that is neither increasing nor decreasing a “bouncy” number; for example, 155349.

As $n$ increases, the proportion of bouncy numbers below $n$ increases such that there are only 12951 numbers below one-million that are not bouncy and only 277032 non-bouncy numbers below $10^{10}$.

How many numbers below a googol ($10^{100}$) are not bouncy?


#112 - Bouncy numbers

Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.

Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.

We shall call a positive integer that is neither increasing nor decreasing a “bouncy” number; for example, 155349.

Clearly there cannot be any bouncy numbers below one-hundred, but just over half of the numbers below one-thousand (525) are bouncy. In fact, the least number for which the proportion of bouncy numbers first reaches 50% is 538.

Surprisingly, bouncy numbers become more and more common and by the time we reach 21780 the proportion of bouncy numbers is equal to 90%.

Find the least number for which the proportion of bouncy numbers is exactly 99%.


#83 - Path sum: four ways

In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by moving left, right, up, and down, is indicated in bold red and is equal to 2297. \[\begin{pmatrix} \color{red}{\mathbf{131}} & 673 & \color{red}{\mathbf{234}} & \color{red}{\mathbf{103}} & \color{red}{\mathbf{18}} \\ \color{red}{\mathbf{201}} & \color{red}{\mathbf{96}} & \color{red}{\mathbf{342}} & 965 & \color{red}{\mathbf{150}} \\ 630 & 803 & 746 & \color{red}{\mathbf{422}} & \color{red}{\mathbf{111}} \\ 537 & 699 & 497 & \color{red}{\mathbf{121}} & 956 \\ 805 & 732 & 524 & \color{red}{\mathbf{37}} & \color{red}{\mathbf{331}} \end{pmatrix}\]

Find the minimal path sum from the top left to the bottom right by moving left, right, up, and down in matrix.txt (right click and “Save Link/Target As…”), a 31K text file containing an 80 by 80 matrix.


#77 - Prime summations

It is possible to write ten as the sum of primes in exactly five different ways: \[\begin{aligned} &7+3 \\ &5+5 \\ &5+3+2 \\ &3+3+2+2 \\ &2+2+2+2+2 \end{aligned}\]

What is the first value which can be written as the sum of primes in over five thousand different ways?


#75 - 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 right angle triangle in exactly one way, but there are many more examples. \[\mathbf{12}\textbf{ cm}: (3,4,5) \\ \mathbf{24}\textbf{ cm}: (6,8,10) \\ \mathbf{30}\textbf{ cm}: (5,12,13) \\ \mathbf{36}\textbf{ cm}: (9,12,15) \\ \mathbf{40}\textbf{ cm}: (8,15,17) \\ \mathbf{48}\textbf{ cm}: (12,16,20)\]

In contrast, some lengths of wire, like 20 cm, cannot be bent to form an integer sided right angle triangle, and other lengths allow more than one solution to be found; for example, using 120 cm it is possible to form exactly three different integer sided right angle triangles. \[\mathbf{120}\textbf{ cm}: (30,40,50), (20,48,52), (24,45,51)\]

Given that $L$ is the length of the wire, for how many values of $L\leq 1\,500\,000$ can exactly one integer sided right angle triangle be formed?


#125 - Palindromic sums

The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: $6^2+7^2+8^2+9^2+10^2+11^2+12^2$.

There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums, and the sum of these palindromes is 4164. Note that $1^2=0^2+1^2$ has not been included as this problem is concerned with the squares of positive integers.

Find the sum of all the numbers less than $10^8$ that are both palindromic and can be written as the sum of consecutive squares.


#66 - Diophantine equation

Consider quadratic Diophantine equations of the form: $x^2-Dy^2=1$.

For example, when $D=13$, the minimal solution in $x$ is $649^2-13\times 180^2 = 1$.

It can be assumed that there are no solutions in positive integers when $D$ is square.

By finding minimal solutions in $x$ for $D = {2,3,5,6,7}$, we obtain the following: \[\begin{aligned} 3^2-2\times2^2 &= 1 \cr 2^2-3\times1^2 &= 1 \cr \color{red}{9}^2-5\times4^2 &= 1 \cr 5^2-6\times2^2 &= 1 \cr 8^2-7\times3^2 &= 1 \end{aligned}\]

Hence, by considering minimal solutions in $x$ for $D\leq 7$, the largest $x$ is obtained when $D=5$.

Find the value of $D\leq 1000$ in minimal solutions of $x$ for which the largest value of $x$ is obtained.


#62 - Cubic permutations

The cube, $41063625 \left(345^3\right)$, can be permuted to produce two other cubes: $56623104 \left(384^3\right)$ and $66430125 \left(405^3\right)$. In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube.

Find the smallest cube for which exactly five permutations of its digits are cube.


Pagination