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


#82 - Path sum: three ways

This problem is a more challenging version of #81 - Path sum: two ways

The minimal path sum in the 5 by 5 matrix below, by starting in any cell in the left column and finishing in any cell in the right column, and only moving up, down, and right, is indicated in red and bold; the sum is equal to 994. \[\begin{pmatrix} 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 & 150 \\ 630 & 803 & 746 & 422 & 111 \\ 537 & 699 & 497 & 121 & 956 \\ 805 & 732 & 524 & 37 & 331 \end{pmatrix}\]

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


104 - Pandigital Fibonacci ends

The Fibonacci sequence is defined by the recurrence relation: \[F_n=F_{n-1}+F_{n-2} \\ F_1=1 \\ F_2=1\]

It turns out that $F_{541}$, which contains 113 digits, is the first Fibonacci number for which the last nine digits are 1-9 pandigital (contain all the digits 1 to 9, but not necessarily in order). And $F_{2749}$, which contains 575 digits, is the first Fibonacci number for which the first nine digits are 1-9 pandigital.

Given the $F_k$ is the first Fibonacci number for which the first nine digits AND the last nine digits are 1-9 pandigital, find $k$.


#205 - Dice Game

Peter has nine four-sided (pyramidal) dice, each with faces numbered 1, 2, 3, 4. Colin has six six-sided (cubic) dice, each with faces numbered 1, 2, 3, 4, 5, 6.

Peter and Colin roll the dice and compare totals: the highest total wins. The result is a draw if the totals are equal.

What is the probability that Pyramidal Peter beats Cubic Colin? Give your answer rounded to seven decimal places in the form 0.abcdefg


#99 - Largest exponential

Comparing the two numbres written in index form like $2^{11}$ and $3^7$ is not difficult, as any calculator would confirm that $2^{11}=2048<3^7=2187$.

However, confirming that $632382^{518061}>519432^{525806}$ would be much more difficult, as both numbers contain over three million digits.

Using base_exp.txt (right click and ‘Save Link/Target As…’), a 22K text file containing one thousand lines with a base/exponent pair on each line, determine which line number has the greatest numerical value.

The first two lines in the file represent the numbers in the example given above.


#97 - Large non-Mersenne prime

The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form $2^{6972593}-1$; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form $2^p-1$, have been found which contain more digits.

However, in 2004 there was found a massive non-Mersenne prime which contains 2,357,207 digits: $28433\times2^{7830457}+1$.

Find the last ten digits of this prime number.


#100 - Arranged probability

If a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs $P(BB)=(15/21)\times(14/20)=1/2$.

The next such arrangement, for which there is exactly 50% chance of taking two blue discs at random, is a box containing eighty-five blue discs and thirty-five red discs.

By finding the first arrangement to contain over $10^{12}=1\,000\,000\,000\,000$ discs in total, determine the number of blue discs that the box would contain.


Pagination