Dataset Viewer
id
int32 | title
string | problem
string | question_latex
string | question_html
string | numerical_answer
string | pub_date
string | solved_by
string | diff_rate
string | difficulty
string |
---|---|---|---|---|---|---|---|---|---|
768 | Chandelier | A certain type of chandelier contains a circular ring of $n$ evenly spaced candleholders.
If only one candle is fitted, then the chandelier will be imbalanced. However, if a second identical candle is placed in the opposite candleholder (assuming $n$ is even) then perfect balance will be achieved and the chandelier will hang level.
Let $f(n,m)$ be the number of ways of arranging $m$ identical candles in distinct sockets of a chandelier with $n$ candleholders such that the chandelier is perfectly balanced.
For example, $f(4, 2) = 2$: assuming the chandelier's four candleholders are aligned with the compass points, the two valid arrangements are "North & South" and "East & West". Note that these are considered to be different arrangements even though they are related by rotation.
You are given that $f(12,4) = 15$ and $f(36, 6) = 876$.
Find $f(360, 20)$. | A certain type of chandelier contains a circular ring of $n$ evenly spaced candleholders.
If only one candle is fitted, then the chandelier will be imbalanced. However, if a second identical candle is placed in the opposite candleholder (assuming $n$ is even) then perfect balance will be achieved and the chandelier will hang level.
Let $f(n,m)$ be the number of ways of arranging $m$ identical candles in distinct sockets of a chandelier with $n$ candleholders such that the chandelier is perfectly balanced.
For example, $f(4, 2) = 2$: assuming the chandelier's four candleholders are aligned with the compass points, the two valid arrangements are "North & South" and "East & West". Note that these are considered to be different arrangements even though they are related by rotation.
You are given that $f(12,4) = 15$ and $f(36, 6) = 876$.
Find $f(360, 20)$. | <p>A certain type of chandelier contains a circular ring of $n$ evenly spaced candleholders.<br>
If only one candle is fitted, then the chandelier will be imbalanced. However, if a second identical candle is placed in the opposite candleholder (assuming $n$ is even) then perfect balance will be achieved and the chandelier will hang level.</br></p>
<p>Let $f(n,m)$ be the number of ways of arranging $m$ identical candles in distinct sockets of a chandelier with $n$ candleholders such that the chandelier is perfectly balanced.</p>
<p>For example, $f(4, 2) = 2$: assuming the chandelier's four candleholders are aligned with the compass points, the two valid arrangements are "North & South" and "East & West". Note that these are considered to be different arrangements even though they are related by rotation.</p>
<p>You are given that $f(12,4) = 15$ and $f(36, 6) = 876$.</p>
<p>Find $f(360, 20)$.</p> | 14655308696436060 | Sunday, 17th October 2021, 05:00 am | 202 | 95% | hard |
36 | Double-base Palindromes | The decimal number, $585 = 1001001001_2$ (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base $10$ and base $2$.
(Please note that the palindromic number, in either base, may not include leading zeros.) | The decimal number, $585 = 1001001001_2$ (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base $10$ and base $2$.
(Please note that the palindromic number, in either base, may not include leading zeros.) | <p>The decimal number, $585 = 1001001001_2$ (binary), is palindromic in both bases.</p>
<p>Find the sum of all numbers, less than one million, which are palindromic in base $10$ and base $2$.</p>
<p class="smaller">(Please note that the palindromic number, in either base, may not include leading zeros.)</p> | 872187 | Friday, 31st January 2003, 06:00 pm | 96478 | 5% | easy |
846 | Magic Bracelets | A bracelet is made by connecting at least three numbered beads in a circle. Each bead can only display $1$, $2$, or any number of the form $p^k$ or $2p^k$ for odd prime $p$.
In addition a magic bracelet must satisfy the following two conditions:
no two beads display the same number
the product of the numbers of any two adjacent beads is of the form $x^2+1$
Define the potency of a magic bracelet to be the sum of numbers on its beads.
The example is a magic bracelet with five beads which has a potency of 155.
Let $F(N)$ be the sum of the potency of each magic bracelet which can be formed using positive integers not exceeding $N$, where rotations and reflections of an arrangement are considered equivalent. You are given $F(20)=258$ and $F(10^2)=538768$.
Find $F(10^6)$. | A bracelet is made by connecting at least three numbered beads in a circle. Each bead can only display $1$, $2$, or any number of the form $p^k$ or $2p^k$ for odd prime $p$.
In addition a magic bracelet must satisfy the following two conditions:
no two beads display the same number
the product of the numbers of any two adjacent beads is of the form $x^2+1$
Define the potency of a magic bracelet to be the sum of numbers on its beads.
The example is a magic bracelet with five beads which has a potency of 155.
Let $F(N)$ be the sum of the potency of each magic bracelet which can be formed using positive integers not exceeding $N$, where rotations and reflections of an arrangement are considered equivalent. You are given $F(20)=258$ and $F(10^2)=538768$.
Find $F(10^6)$. | <p>
A <i>bracelet</i> is made by connecting at least three numbered beads in a circle. Each bead can only display $1$, $2$, or any number of the form $p^k$ or $2p^k$ for odd prime $p$.</p>
<p>
In addition a <i>magic bracelet</i> must satisfy the following two conditions:</p>
<ul>
<li> no two beads display the same number</li>
<li> the product of the numbers of any two adjacent beads is of the form $x^2+1$</li>
</ul>
<div style="text-align:center;">
<img alt="0846_diagram.jpg" height="225" src="resources/images/0846_diagram.jpg?1684224225" width="640"/>
</div>
<p>
Define the <i>potency</i> of a magic bracelet to be the sum of numbers on its beads. </p>
<p>
The example is a magic bracelet with five beads which has a potency of 155. </p>
<p>
Let $F(N)$ be the sum of the potency of each magic bracelet which can be formed using positive integers not exceeding $N$, where rotations and reflections of an arrangement are considered equivalent. You are given $F(20)=258$ and $F(10^2)=538768$.</p>
<p>
Find $F(10^6)$.</p> | 9851175623 | Saturday, 3rd June 2023, 08:00 pm | 224 | 50% | medium |
926 | Total Roundness | A round number is a number that ends with one or more zeros in a given base.
Let us define the roundness of a number $n$ in base $b$ as the number of zeros at the end of the base $b$ representation of $n$.
For example, $20$ has roundness $2$ in base $2$, because the base $2$ representation of $20$ is $10100$, which ends with $2$ zeros.
Also define $R(n)$, the total roundness of a number $n$, as the sum of the roundness of $n$ in base $b$ for all $b > 1$.
For example, $20$ has roundness $2$ in base $2$ and roundness $1$ in base $4$, $5$, $10$, $20$, hence we get $R(20)=6$.
You are also given $R(10!) = 312$.
Find $R(10\,000\,000!)$. Give your answer modulo $10^9 + 7$. | A round number is a number that ends with one or more zeros in a given base.
Let us define the roundness of a number $n$ in base $b$ as the number of zeros at the end of the base $b$ representation of $n$.
For example, $20$ has roundness $2$ in base $2$, because the base $2$ representation of $20$ is $10100$, which ends with $2$ zeros.
Also define $R(n)$, the total roundness of a number $n$, as the sum of the roundness of $n$ in base $b$ for all $b > 1$.
For example, $20$ has roundness $2$ in base $2$ and roundness $1$ in base $4$, $5$, $10$, $20$, hence we get $R(20)=6$.
You are also given $R(10!) = 312$.
Find $R(10\,000\,000!)$. Give your answer modulo $10^9 + 7$. | <p>
A <strong>round number</strong> is a number that ends with one or more zeros in a given base.</p>
<p>
Let us define the <dfn>roundness</dfn> of a number $n$ in base $b$ as the number of zeros at the end of the base $b$ representation of $n$.<br/>
For example, $20$ has roundness $2$ in base $2$, because the base $2$ representation of $20$ is $10100$, which ends with $2$ zeros.</p>
<p>
Also define $R(n)$, the <dfn>total roundness</dfn> of a number $n$, as the sum of the roundness of $n$ in base $b$ for all $b > 1$.<br/>
For example, $20$ has roundness $2$ in base $2$ and roundness $1$ in base $4$, $5$, $10$, $20$, hence we get $R(20)=6$.<br/>
You are also given $R(10!) = 312$.</p>
<p>
Find $R(10\,000\,000!)$. Give your answer modulo $10^9 + 7$.</p> | 40410219 | Saturday, 4th January 2025, 10:00 pm | 533 | 10% | easy |
46 | Goldbach's Other Conjecture | It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.
\begin{align}
9 = 7 + 2 \times 1^2\\
15 = 7 + 2 \times 2^2\\
21 = 3 + 2 \times 3^2\\
25 = 7 + 2 \times 3^2\\
27 = 19 + 2 \times 2^2\\
33 = 31 + 2 \times 1^2
\end{align}
It turns out that the conjecture was false.
What is the smallest odd composite that cannot be written as the sum of a prime and twice a square? | It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.
\begin{align}
9 = 7 + 2 \times 1^2\\
15 = 7 + 2 \times 2^2\\
21 = 3 + 2 \times 3^2\\
25 = 7 + 2 \times 3^2\\
27 = 19 + 2 \times 2^2\\
33 = 31 + 2 \times 1^2
\end{align}
It turns out that the conjecture was false.
What is the smallest odd composite that cannot be written as the sum of a prime and twice a square? | <p>It was proposed by Christian Goldbach that every odd composite number can be written as the sum of a prime and twice a square.</p>
\begin{align}
9 = 7 + 2 \times 1^2\\
15 = 7 + 2 \times 2^2\\
21 = 3 + 2 \times 3^2\\
25 = 7 + 2 \times 3^2\\
27 = 19 + 2 \times 2^2\\
33 = 31 + 2 \times 1^2
\end{align}
<p>It turns out that the conjecture was false.</p>
<p>What is the smallest odd composite that cannot be written as the sum of a prime and twice a square?</p> | 5777 | Friday, 20th June 2003, 06:00 pm | 67702 | 5% | easy |
580 | Squarefree Hilbert Numbers | A Hilbert number is any positive integer of the form $4k+1$ for integer $k\geq 0$. We shall define a squarefree Hilbert number as a Hilbert number which is not divisible by the square of any Hilbert number other than one. For example, $117$ is a squarefree Hilbert number, equaling $9\times13$. However $6237$ is a Hilbert number that is not squarefree in this sense, as it is divisible by $9^2$. The number $3969$ is also not squarefree, as it is divisible by both $9^2$ and $21^2$.
There are $2327192$ squarefree Hilbert numbers below $10^7$.
How many squarefree Hilbert numbers are there below $10^{16}$? | A Hilbert number is any positive integer of the form $4k+1$ for integer $k\geq 0$. We shall define a squarefree Hilbert number as a Hilbert number which is not divisible by the square of any Hilbert number other than one. For example, $117$ is a squarefree Hilbert number, equaling $9\times13$. However $6237$ is a Hilbert number that is not squarefree in this sense, as it is divisible by $9^2$. The number $3969$ is also not squarefree, as it is divisible by both $9^2$ and $21^2$.
There are $2327192$ squarefree Hilbert numbers below $10^7$.
How many squarefree Hilbert numbers are there below $10^{16}$? | <p>
A <strong>Hilbert number</strong> is any positive integer of the form $4k+1$ for integer $k\geq 0$. We shall define a <i>squarefree Hilbert number</i> as a Hilbert number which is not divisible by the square of any Hilbert number other than one. For example, $117$ is a squarefree Hilbert number, equaling $9\times13$. However $6237$ is a Hilbert number that is not squarefree in this sense, as it is divisible by $9^2$. The number $3969$ is also not squarefree, as it is divisible by both $9^2$ and $21^2$.
</p>
<p>
There are $2327192$ squarefree Hilbert numbers below $10^7$. <br/>
How many squarefree Hilbert numbers are there below $10^{16}$?
</p> | 2327213148095366 | Sunday, 4th December 2016, 04:00 am | 282 | 75% | hard |
449 | Chocolate Covered Candy | Phil the confectioner is making a new batch of chocolate covered candy. Each candy centre is shaped like an ellipsoid of revolution defined by the equation:
$b^2 x^2 + b^2 y^2 + a^2 z^2 = a^2 b^2$.
Phil wants to know how much chocolate is needed to cover one candy centre with a uniform coat of chocolate one millimeter thick.
If $a = 1$ mm and $b = 1$ mm, the amount of chocolate required is $\dfrac{28}{3} \pi$ mm3
If $a = 2$ mm and $b = 1$ mm, the amount of chocolate required is approximately 60.35475635 mm3.
Find the amount of chocolate in mm3 required if $a = 3$ mm and $b =1$ mm. Give your answer as the number rounded to 8 decimal places behind the decimal point. | Phil the confectioner is making a new batch of chocolate covered candy. Each candy centre is shaped like an ellipsoid of revolution defined by the equation:
$b^2 x^2 + b^2 y^2 + a^2 z^2 = a^2 b^2$.
Phil wants to know how much chocolate is needed to cover one candy centre with a uniform coat of chocolate one millimeter thick.
If $a = 1$ mm and $b = 1$ mm, the amount of chocolate required is $\dfrac{28}{3} \pi$ mm3
If $a = 2$ mm and $b = 1$ mm, the amount of chocolate required is approximately 60.35475635 mm3.
Find the amount of chocolate in mm3 required if $a = 3$ mm and $b =1$ mm. Give your answer as the number rounded to 8 decimal places behind the decimal point. | <p>Phil the confectioner is making a new batch of chocolate covered candy. Each candy centre is shaped like an ellipsoid of revolution defined by the equation:
$b^2 x^2 + b^2 y^2 + a^2 z^2 = a^2 b^2$.</p>
<p>Phil wants to know how much chocolate is needed to cover one candy centre with a uniform coat of chocolate one millimeter thick.
</p>
<p>If $a = 1$ mm and $b = 1$ mm, the amount of chocolate required is $\dfrac{28}{3} \pi$ mm<sup>3</sup></p>
<p>If $a = 2$ mm and $b = 1$ mm, the amount of chocolate required is approximately 60.35475635 mm<sup>3</sup>.</p>
<p>Find the amount of chocolate in mm<sup>3</sup> required if $a = 3$ mm and $b =1$ mm. Give your answer as the number rounded to 8 decimal places behind the decimal point.</p> | 103.37870096 | Sunday, 8th December 2013, 04:00 am | 1004 | 40% | medium |
254 | Sums of Digit Factorials | Define $f(n)$ as the sum of the factorials of the digits of $n$. For example, $f(342) = 3! + 4! + 2! = 32$.
Define $sf(n)$ as the sum of the digits of $f(n)$. So $sf(342) = 3 + 2 = 5$.
Define $g(i)$ to be the smallest positive integer $n$ such that $sf(n) = i$. Though $sf(342)$ is $5$, $sf(25)$ is also $5$, and it can be verified that $g(5)$ is $25$.
Define $sg(i)$ as the sum of the digits of $g(i)$. So $sg(5) = 2 + 5 = 7$.
Further, it can be verified that $g(20)$ is $267$ and $\sum sg(i)$ for $1 \le i \le 20$ is $156$.
What is $\sum sg(i)$ for $1 \le i \le 150$? | Define $f(n)$ as the sum of the factorials of the digits of $n$. For example, $f(342) = 3! + 4! + 2! = 32$.
Define $sf(n)$ as the sum of the digits of $f(n)$. So $sf(342) = 3 + 2 = 5$.
Define $g(i)$ to be the smallest positive integer $n$ such that $sf(n) = i$. Though $sf(342)$ is $5$, $sf(25)$ is also $5$, and it can be verified that $g(5)$ is $25$.
Define $sg(i)$ as the sum of the digits of $g(i)$. So $sg(5) = 2 + 5 = 7$.
Further, it can be verified that $g(20)$ is $267$ and $\sum sg(i)$ for $1 \le i \le 20$ is $156$.
What is $\sum sg(i)$ for $1 \le i \le 150$? | <p>Define $f(n)$ as the sum of the factorials of the digits of $n$. For example, $f(342) = 3! + 4! + 2! = 32$.</p>
<p>Define $sf(n)$ as the sum of the digits of $f(n)$. So $sf(342) = 3 + 2 = 5$.</p>
<p>Define $g(i)$ to be the smallest positive integer $n$ such that $sf(n) = i$. Though $sf(342)$ is $5$, $sf(25)$ is also $5$, and it can be verified that $g(5)$ is $25$.</p>
<p>Define $sg(i)$ as the sum of the digits of $g(i)$. So $sg(5) = 2 + 5 = 7$.</p>
<p>Further, it can be verified that $g(20)$ is $267$ and $\sum sg(i)$ for $1 \le i \le 20$ is $156$.</p>
<p>What is $\sum sg(i)$ for $1 \le i \le 150$?</p> | 8184523820510 | Friday, 4th September 2009, 05:00 pm | 1088 | 75% | hard |
746 | A Messy Dinner | $n$ families, each with four members, a father, a mother, a son and a daughter, were invited to a restaurant. They were all seated at a large circular table with $4n$ seats such that men and women alternate.
Let $M(n)$ be the number of ways the families can be seated such that none of the families were seated together. A family is considered to be seated together only when all the members of a family sit next to each other.
For example, $M(1)=0$, $M(2)=896$, $M(3)=890880$ and $M(10) \equiv 170717180 \pmod {1\,000\,000\,007}$.
Let $S(n)=\displaystyle \sum_{k=2}^nM(k)$.
For example, $S(10) \equiv 399291975 \pmod {1\,000\,000\,007}$.
Find $S(2021)$. Give your answer modulo $1\,000\,000\,007$. | $n$ families, each with four members, a father, a mother, a son and a daughter, were invited to a restaurant. They were all seated at a large circular table with $4n$ seats such that men and women alternate.
Let $M(n)$ be the number of ways the families can be seated such that none of the families were seated together. A family is considered to be seated together only when all the members of a family sit next to each other.
For example, $M(1)=0$, $M(2)=896$, $M(3)=890880$ and $M(10) \equiv 170717180 \pmod {1\,000\,000\,007}$.
Let $S(n)=\displaystyle \sum_{k=2}^nM(k)$.
For example, $S(10) \equiv 399291975 \pmod {1\,000\,000\,007}$.
Find $S(2021)$. Give your answer modulo $1\,000\,000\,007$. | <p>$n$ families, each with four members, a father, a mother, a son and a daughter, were invited to a restaurant. They were all seated at a large circular table with $4n$ seats such that men and women alternate.</p>
<p>Let $M(n)$ be the number of ways the families can be seated such that none of the families were seated together. A family is considered to be seated together only when all the members of a family sit next to each other.</p>
<p>For example, $M(1)=0$, $M(2)=896$, $M(3)=890880$ and $M(10) \equiv 170717180 \pmod {1\,000\,000\,007}$.</p>
<p>Let $S(n)=\displaystyle \sum_{k=2}^nM(k)$.</p>
<p>For example, $S(10) \equiv 399291975 \pmod {1\,000\,000\,007}$.</p>
<p>Find $S(2021)$. Give your answer modulo $1\,000\,000\,007$.</p> | 867150922 | Sunday, 7th February 2021, 07:00 am | 309 | 40% | medium |
729 | Range of Periodic Sequence | Consider the sequence of real numbers $a_n$ defined by the starting value $a_0$ and the recurrence
$\displaystyle a_{n+1}=a_n-\frac 1 {a_n}$ for any $n \ge 0$.
For some starting values $a_0$ the sequence will be periodic. For example, $a_0=\sqrt{\frac 1 2}$ yields the sequence:
$\sqrt{\frac 1 2},-\sqrt{\frac 1 2},\sqrt{\frac 1 2}, \dots$
We are interested in the range of such a periodic sequence which is the difference between the maximum and minimum of the sequence. For example, the range of the sequence above would be $\sqrt{\frac 1 2}-(-\sqrt{\frac 1 2})=\sqrt{ 2}$.
Let $S(P)$ be the sum of the ranges of all such periodic sequences with a period not exceeding $P$.
For example, $S(2)=2\sqrt{2} \approx 2.8284$, being the sum of the ranges of the two sequences starting with $a_0=\sqrt{\frac 1 2}$ and $a_0=-\sqrt{\frac 1 2}$.
You are given $S(3) \approx 14.6461$ and $S(5) \approx 124.1056$.
Find $S(25)$, rounded to $4$ decimal places. | Consider the sequence of real numbers $a_n$ defined by the starting value $a_0$ and the recurrence
$\displaystyle a_{n+1}=a_n-\frac 1 {a_n}$ for any $n \ge 0$.
For some starting values $a_0$ the sequence will be periodic. For example, $a_0=\sqrt{\frac 1 2}$ yields the sequence:
$\sqrt{\frac 1 2},-\sqrt{\frac 1 2},\sqrt{\frac 1 2}, \dots$
We are interested in the range of such a periodic sequence which is the difference between the maximum and minimum of the sequence. For example, the range of the sequence above would be $\sqrt{\frac 1 2}-(-\sqrt{\frac 1 2})=\sqrt{ 2}$.
Let $S(P)$ be the sum of the ranges of all such periodic sequences with a period not exceeding $P$.
For example, $S(2)=2\sqrt{2} \approx 2.8284$, being the sum of the ranges of the two sequences starting with $a_0=\sqrt{\frac 1 2}$ and $a_0=-\sqrt{\frac 1 2}$.
You are given $S(3) \approx 14.6461$ and $S(5) \approx 124.1056$.
Find $S(25)$, rounded to $4$ decimal places. | <p>Consider the sequence of real numbers $a_n$ defined by the starting value $a_0$ and the recurrence
$\displaystyle a_{n+1}=a_n-\frac 1 {a_n}$ for any $n \ge 0$.</p>
<p>
For some starting values $a_0$ the sequence will be periodic. For example, $a_0=\sqrt{\frac 1 2}$ yields the sequence:
$\sqrt{\frac 1 2},-\sqrt{\frac 1 2},\sqrt{\frac 1 2}, \dots$</p>
<p>
We are interested in the range of such a periodic sequence which is the difference between the maximum and minimum of the sequence. For example, the range of the sequence above would be $\sqrt{\frac 1 2}-(-\sqrt{\frac 1 2})=\sqrt{ 2}$.</p>
<p>
Let $S(P)$ be the sum of the ranges of all such periodic sequences with a period not exceeding $P$.<br/>
For example, $S(2)=2\sqrt{2} \approx 2.8284$, being the sum of the ranges of the two sequences starting with $a_0=\sqrt{\frac 1 2}$ and $a_0=-\sqrt{\frac 1 2}$. <br/>
You are given $S(3) \approx 14.6461$ and $S(5) \approx 124.1056$.
</p><p>
Find $S(25)$, rounded to $4$ decimal places.</p> | 308896374.2502 | Sunday, 11th October 2020, 05:00 am | 242 | 65% | hard |
353 | Risky Moon | A moon could be described by the sphere $C(r)$ with centre $(0,0,0)$ and radius $r$.
There are stations on the moon at the points on the surface of $C(r)$ with integer coordinates. The station at $(0,0,r)$ is called North Pole station, the station at $(0,0,-r)$ is called South Pole station.
All stations are connected with each other via the shortest road on the great arc through the stations. A journey between two stations is risky. If d is the length of the road between two stations, $\left(\frac{d}{\pi r}\right)^2$ is a measure for the risk of the journey (let us call it the risk of the road). If the journey includes more than two stations, the risk of the journey is the sum of risks of the used roads.
A direct journey from the North Pole station to the South Pole station has the length $\pi r$ and risk $1$. The journey from the North Pole station to the South Pole station via $(0,r,0)$ has the same length, but a smaller risk:
\[
\left(\frac{\frac{1}{2}\pi r}{\pi r}\right)^2+\left(\frac{\frac{1}{2}\pi r}{\pi r}\right)^2=0.5
\]
The minimal risk of a journey from the North Pole station to the South Pole station on $C(r)$ is $M(r)$.
You are given that $M(7)=0.1784943998$ rounded to $10$ digits behind the decimal point.
Find $\displaystyle{\sum_{n=1}^{15}M(2^n-1)}$.
Give your answer rounded to $10$ digits behind the decimal point in the form a.bcdefghijk. | A moon could be described by the sphere $C(r)$ with centre $(0,0,0)$ and radius $r$.
There are stations on the moon at the points on the surface of $C(r)$ with integer coordinates. The station at $(0,0,r)$ is called North Pole station, the station at $(0,0,-r)$ is called South Pole station.
All stations are connected with each other via the shortest road on the great arc through the stations. A journey between two stations is risky. If d is the length of the road between two stations, $\left(\frac{d}{\pi r}\right)^2$ is a measure for the risk of the journey (let us call it the risk of the road). If the journey includes more than two stations, the risk of the journey is the sum of risks of the used roads.
A direct journey from the North Pole station to the South Pole station has the length $\pi r$ and risk $1$. The journey from the North Pole station to the South Pole station via $(0,r,0)$ has the same length, but a smaller risk:
\[
\left(\frac{\frac{1}{2}\pi r}{\pi r}\right)^2+\left(\frac{\frac{1}{2}\pi r}{\pi r}\right)^2=0.5
\]
The minimal risk of a journey from the North Pole station to the South Pole station on $C(r)$ is $M(r)$.
You are given that $M(7)=0.1784943998$ rounded to $10$ digits behind the decimal point.
Find $\displaystyle{\sum_{n=1}^{15}M(2^n-1)}$.
Give your answer rounded to $10$ digits behind the decimal point in the form a.bcdefghijk. | <p>
A moon could be described by the sphere $C(r)$ with centre $(0,0,0)$ and radius $r$.
</p>
<p>
There are stations on the moon at the points on the surface of $C(r)$ with integer coordinates. The station at $(0,0,r)$ is called North Pole station, the station at $(0,0,-r)$ is called South Pole station.
</p>
<p>
All stations are connected with each other via the shortest road on the great arc through the stations. A journey between two stations is risky. If <var>d</var> is the length of the road between two stations, $\left(\frac{d}{\pi r}\right)^2$ is a measure for the risk of the journey (let us call it the risk of the road). If the journey includes more than two stations, the risk of the journey is the sum of risks of the used roads.
</p>
<p>
A direct journey from the North Pole station to the South Pole station has the length $\pi r$ and risk $1$. The journey from the North Pole station to the South Pole station via $(0,r,0)$ has the same length, but a smaller risk:</p>
\[
\left(\frac{\frac{1}{2}\pi r}{\pi r}\right)^2+\left(\frac{\frac{1}{2}\pi r}{\pi r}\right)^2=0.5
\]
<p>
The minimal risk of a journey from the North Pole station to the South Pole station on $C(r)$ is $M(r)$.
</p>
<p>
You are given that $M(7)=0.1784943998$ rounded to $10$ digits behind the decimal point.
</p>
<p>
Find $\displaystyle{\sum_{n=1}^{15}M(2^n-1)}$.
</p>
<p>
Give your answer rounded to $10$ digits behind the decimal point in the form a.bcdefghijk.
</p> | 1.2759860331 | Sunday, 9th October 2011, 04:00 am | 554 | 50% | medium |
562 | Maximal Perimeter | Construct triangle $ABC$ such that:
Vertices $A$, $B$ and $C$ are lattice points inside or on the circle of radius $r$ centered at the origin;
the triangle contains no other lattice point inside or on its edges;
the perimeter is maximum.
Let $R$ be the circumradius of triangle $ABC$ and $T(r) = R/r$.
For $r = 5$, one possible triangle has vertices $(-4,-3)$, $(4,2)$ and $(1,0)$ with perimeter $\sqrt{13}+\sqrt{34}+\sqrt{89}$ and circumradius $R = \sqrt {\frac {19669} 2 }$, so $T(5) = \sqrt {\frac {19669} {50} }$.
You are given $T(10) \approx 97.26729$ and $T(100) \approx 9157.64707$.
Find $T(10^7)$. Give your answer rounded to the nearest integer. | Construct triangle $ABC$ such that:
Vertices $A$, $B$ and $C$ are lattice points inside or on the circle of radius $r$ centered at the origin;
the triangle contains no other lattice point inside or on its edges;
the perimeter is maximum.
Let $R$ be the circumradius of triangle $ABC$ and $T(r) = R/r$.
For $r = 5$, one possible triangle has vertices $(-4,-3)$, $(4,2)$ and $(1,0)$ with perimeter $\sqrt{13}+\sqrt{34}+\sqrt{89}$ and circumradius $R = \sqrt {\frac {19669} 2 }$, so $T(5) = \sqrt {\frac {19669} {50} }$.
You are given $T(10) \approx 97.26729$ and $T(100) \approx 9157.64707$.
Find $T(10^7)$. Give your answer rounded to the nearest integer. | <p>Construct triangle $ABC$ such that:</p>
<ul><li>Vertices $A$, $B$ and $C$ are lattice points inside or on the circle of radius $r$ centered at the origin;</li>
<li>the triangle contains no other lattice point inside or on its edges;</li>
<li>the perimeter is maximum.</li></ul>
<p>Let $R$ be the circumradius of triangle $ABC$ and $T(r) = R/r$.<br/>
For $r = 5$, one possible triangle has vertices $(-4,-3)$, $(4,2)$ and $(1,0)$ with perimeter $\sqrt{13}+\sqrt{34}+\sqrt{89}$ and circumradius $R = \sqrt {\frac {19669} 2 }$, so $T(5) = \sqrt {\frac {19669} {50} }$.<br/>
You are given $T(10) \approx 97.26729$ and $T(100) \approx 9157.64707$.</p>
<p>Find $T(10^7)$. Give your answer rounded to the nearest integer.</p> | 51208732914368 | Sunday, 29th May 2016, 01:00 am | 209 | 75% | hard |
232 | The Race | Two players share an unbiased coin and take it in turns to play The Race.
On Player 1's turn, the coin is tossed once. If it comes up Heads, then Player 1 scores one point; if it comes up Tails, then no points are scored.
On Player 2's turn, a positive integer, $T$, is chosen by Player 2 and the coin is tossed $T$ times. If it comes up all Heads, then Player 2 scores $2^{T-1}$ points; otherwise, no points are scored.
Player 1 goes first and the winner is the first to 100 or more points.
Player 2 will always select the number, $T$, of coin tosses that maximises the probability of winning.
What is the probability that Player 2 wins?
Give your answer rounded to eight decimal places in the form 0.abcdefgh. | Two players share an unbiased coin and take it in turns to play The Race.
On Player 1's turn, the coin is tossed once. If it comes up Heads, then Player 1 scores one point; if it comes up Tails, then no points are scored.
On Player 2's turn, a positive integer, $T$, is chosen by Player 2 and the coin is tossed $T$ times. If it comes up all Heads, then Player 2 scores $2^{T-1}$ points; otherwise, no points are scored.
Player 1 goes first and the winner is the first to 100 or more points.
Player 2 will always select the number, $T$, of coin tosses that maximises the probability of winning.
What is the probability that Player 2 wins?
Give your answer rounded to eight decimal places in the form 0.abcdefgh. | <p>Two players share an unbiased coin and take it in turns to play <dfn>The Race</dfn>.</p>
<p>On Player 1's turn, the coin is tossed once. If it comes up Heads, then Player 1 scores one point; if it comes up Tails, then no points are scored.</p>
<p>On Player 2's turn, a positive integer, $T$, is chosen by Player 2 and the coin is tossed $T$ times. If it comes up all Heads, then Player 2 scores $2^{T-1}$ points; otherwise, no points are scored.</p>
<p>Player 1 goes first and the winner is the first to 100 or more points.</p>
<p>Player 2 will always select the number, $T$, of coin tosses that maximises the probability of winning.</p>
<p>What is the probability that Player 2 wins?</p>
<p>Give your answer rounded to eight decimal places in the form 0.abcdefgh.</p> | 0.83648556 | Friday, 13th February 2009, 05:00 pm | 1991 | 65% | hard |
435 | Polynomials of Fibonacci Numbers | The Fibonacci numbers $\{f_n, n \ge 0\}$ are defined recursively as $f_n = f_{n-1} + f_{n-2}$ with base cases $f_0 = 0$ and $f_1 = 1$.
Define the polynomials $\{F_n, n \ge 0\}$ as $F_n(x) = \displaystyle{\sum_{i=0}^n f_i x^i}$.
For example, $F_7(x) = x + x^2 + 2x^3 + 3x^4 + 5x^5 + 8x^6 + 13x^7$, and $F_7(11) = 268\,357\,683$.
Let $n = 10^{15}$. Find the sum $\displaystyle{\sum_{x=0}^{100} F_n(x)}$ and give your answer modulo $1\,307\,674\,368\,000 \ (= 15!)$. | The Fibonacci numbers $\{f_n, n \ge 0\}$ are defined recursively as $f_n = f_{n-1} + f_{n-2}$ with base cases $f_0 = 0$ and $f_1 = 1$.
Define the polynomials $\{F_n, n \ge 0\}$ as $F_n(x) = \displaystyle{\sum_{i=0}^n f_i x^i}$.
For example, $F_7(x) = x + x^2 + 2x^3 + 3x^4 + 5x^5 + 8x^6 + 13x^7$, and $F_7(11) = 268\,357\,683$.
Let $n = 10^{15}$. Find the sum $\displaystyle{\sum_{x=0}^{100} F_n(x)}$ and give your answer modulo $1\,307\,674\,368\,000 \ (= 15!)$. | <p>The <strong>Fibonacci numbers</strong> $\{f_n, n \ge 0\}$ are defined recursively as $f_n = f_{n-1} + f_{n-2}$ with base cases $f_0 = 0$ and $f_1 = 1$.</p>
<p>Define the polynomials $\{F_n, n \ge 0\}$ as $F_n(x) = \displaystyle{\sum_{i=0}^n f_i x^i}$.</p>
<p>For example, $F_7(x) = x + x^2 + 2x^3 + 3x^4 + 5x^5 + 8x^6 + 13x^7$, and $F_7(11) = 268\,357\,683$.</p>
<p>Let $n = 10^{15}$. Find the sum $\displaystyle{\sum_{x=0}^{100} F_n(x)}$ and give your answer modulo $1\,307\,674\,368\,000 \ (= 15!)$.</p> | 252541322550 | Saturday, 7th September 2013, 04:00 pm | 1266 | 30% | easy |
633 | Square Prime Factors II | For an integer $n$, we define the square prime factors of $n$ to be the primes whose square divides $n$. For example, the square prime factors of $1500=2^2 \times 3 \times 5^3$ are $2$ and $5$.
Let $C_k(N)$ be the number of integers between $1$ and $N$ inclusive with exactly $k$ square prime factors. It can be shown that with growing $N$ the ratio $\frac{C_k(N)}{N}$ gets arbitrarily close to a constant $c_{k}^{\infty}$, as suggested by the table below.
\[\begin{array}{|c|c|c|c|c|c|}
\hline
& k = 0 & k = 1 & k = 2 & k = 3 & k = 4 \\
\hline
C_k(10) & 7 & 3 & 0 & 0 & 0 \\
\hline
C_k(10^2) & 61 & 36 & 3 & 0 & 0 \\
\hline
C_k(10^3) & 608 & 343 & 48 & 1 & 0 \\
\hline
C_k(10^4) & 6083 & 3363 & 533 & 21 & 0 \\
\hline
C_k(10^5) & 60794 & 33562 & 5345 & 297 & 2 \\
\hline
C_k(10^6) & 607926 & 335438 & 53358 & 3218 & 60 \\
\hline
C_k(10^7) & 6079291 & 3353956 & 533140 & 32777 & 834 \\
\hline
C_k(10^8) & 60792694 & 33539196 & 5329747 & 329028 & 9257 \\
\hline
C_k(10^9) & 607927124 & 335389706 & 53294365 & 3291791 & 95821 \\
\hline
c_k^{\infty} & \frac{6}{\pi^2} & 3.3539\times 10^{-1} & 5.3293\times 10^{-2} & 3.2921\times 10^{-3} & 9.7046\times 10^{-5}\\
\hline
\end{array}\]
Find $c_{7}^{\infty}$. Give the result in scientific notation rounded to $5$ significant digits, using a $e$ to separate mantissa and exponent. E.g. if the answer were $0.000123456789$, then the answer format would be $1.2346\mathrm e{-4}$. | For an integer $n$, we define the square prime factors of $n$ to be the primes whose square divides $n$. For example, the square prime factors of $1500=2^2 \times 3 \times 5^3$ are $2$ and $5$.
Let $C_k(N)$ be the number of integers between $1$ and $N$ inclusive with exactly $k$ square prime factors. It can be shown that with growing $N$ the ratio $\frac{C_k(N)}{N}$ gets arbitrarily close to a constant $c_{k}^{\infty}$, as suggested by the table below.
\[\begin{array}{|c|c|c|c|c|c|}
\hline
& k = 0 & k = 1 & k = 2 & k = 3 & k = 4 \\
\hline
C_k(10) & 7 & 3 & 0 & 0 & 0 \\
\hline
C_k(10^2) & 61 & 36 & 3 & 0 & 0 \\
\hline
C_k(10^3) & 608 & 343 & 48 & 1 & 0 \\
\hline
C_k(10^4) & 6083 & 3363 & 533 & 21 & 0 \\
\hline
C_k(10^5) & 60794 & 33562 & 5345 & 297 & 2 \\
\hline
C_k(10^6) & 607926 & 335438 & 53358 & 3218 & 60 \\
\hline
C_k(10^7) & 6079291 & 3353956 & 533140 & 32777 & 834 \\
\hline
C_k(10^8) & 60792694 & 33539196 & 5329747 & 329028 & 9257 \\
\hline
C_k(10^9) & 607927124 & 335389706 & 53294365 & 3291791 & 95821 \\
\hline
c_k^{\infty} & \frac{6}{\pi^2} & 3.3539\times 10^{-1} & 5.3293\times 10^{-2} & 3.2921\times 10^{-3} & 9.7046\times 10^{-5}\\
\hline
\end{array}\]
Find $c_{7}^{\infty}$. Give the result in scientific notation rounded to $5$ significant digits, using a $e$ to separate mantissa and exponent. E.g. if the answer were $0.000123456789$, then the answer format would be $1.2346\mathrm e{-4}$. | <p>For an integer $n$, we define the <dfn>square prime factors</dfn> of $n$ to be the primes whose square divides $n$. For example, the square prime factors of $1500=2^2 \times 3 \times 5^3$ are $2$ and $5$.</p>
<p>Let $C_k(N)$ be the number of integers between $1$ and $N$ inclusive with exactly $k$ square prime factors. It can be shown that with growing $N$ the ratio $\frac{C_k(N)}{N}$ gets arbitrarily close to a constant $c_{k}^{\infty}$, as suggested by the table below.</p>
\[\begin{array}{|c|c|c|c|c|c|}
\hline
& k = 0 & k = 1 & k = 2 & k = 3 & k = 4 \\
\hline
C_k(10) & 7 & 3 & 0 & 0 & 0 \\
\hline
C_k(10^2) & 61 & 36 & 3 & 0 & 0 \\
\hline
C_k(10^3) & 608 & 343 & 48 & 1 & 0 \\
\hline
C_k(10^4) & 6083 & 3363 & 533 & 21 & 0 \\
\hline
C_k(10^5) & 60794 & 33562 & 5345 & 297 & 2 \\
\hline
C_k(10^6) & 607926 & 335438 & 53358 & 3218 & 60 \\
\hline
C_k(10^7) & 6079291 & 3353956 & 533140 & 32777 & 834 \\
\hline
C_k(10^8) & 60792694 & 33539196 & 5329747 & 329028 & 9257 \\
\hline
C_k(10^9) & 607927124 & 335389706 & 53294365 & 3291791 & 95821 \\
\hline
c_k^{\infty} & \frac{6}{\pi^2} & 3.3539\times 10^{-1} & 5.3293\times 10^{-2} & 3.2921\times 10^{-3} & 9.7046\times 10^{-5}\\
\hline
\end{array}\]
Find $c_{7}^{\infty}$. Give the result in scientific notation rounded to $5$ significant digits, using a $e$ to separate mantissa and exponent. E.g. if the answer were $0.000123456789$, then the answer format would be $1.2346\mathrm e{-4}$. | 1.0012e-10 | Saturday, 28th July 2018, 01:00 pm | 356 | 50% | medium |
782 | Distinct Rows and Columns | The complexity of an $n\times n$ binary matrix is the number of distinct rows and columns.
For example, consider the $3\times 3$ matrices
$$ \mathbf{A} = \begin{pmatrix} 1&0&1\\0&0&0\\1&0&1\end{pmatrix} \quad
\mathbf{B} = \begin{pmatrix} 0&0&0\\0&0&0\\1&1&1\end{pmatrix} $$
$\mathbf{A}$ has complexity $2$ because the set of rows and columns is $\{000,101\}$.
$\mathbf{B}$ has complexity $3$ because the set of rows and columns is $\{000,001,111\}$.
For $0 \le k \le n^2$, let $c(n, k)$ be the minimum complexity of an $n\times n$ binary matrix with exactly $k$ ones.
Let
$$C(n) = \sum_{k=0}^{n^2} c(n, k)$$
For example, $C(2) = c(2, 0) + c(2, 1) + c(2, 2) + c(2, 3) + c(2, 4) = 1 + 2 + 2 + 2 + 1 = 8$.
You are given $C(5) = 64$, $C(10) = 274$ and $C(20) = 1150$.
Find $C(10^4)$. | The complexity of an $n\times n$ binary matrix is the number of distinct rows and columns.
For example, consider the $3\times 3$ matrices
$$ \mathbf{A} = \begin{pmatrix} 1&0&1\\0&0&0\\1&0&1\end{pmatrix} \quad
\mathbf{B} = \begin{pmatrix} 0&0&0\\0&0&0\\1&1&1\end{pmatrix} $$
$\mathbf{A}$ has complexity $2$ because the set of rows and columns is $\{000,101\}$.
$\mathbf{B}$ has complexity $3$ because the set of rows and columns is $\{000,001,111\}$.
For $0 \le k \le n^2$, let $c(n, k)$ be the minimum complexity of an $n\times n$ binary matrix with exactly $k$ ones.
Let
$$C(n) = \sum_{k=0}^{n^2} c(n, k)$$
For example, $C(2) = c(2, 0) + c(2, 1) + c(2, 2) + c(2, 3) + c(2, 4) = 1 + 2 + 2 + 2 + 1 = 8$.
You are given $C(5) = 64$, $C(10) = 274$ and $C(20) = 1150$.
Find $C(10^4)$. | <p>The <dfn>complexity</dfn> of an $n\times n$ binary matrix is the number of distinct rows and columns.</p>
<p>
For example, consider the $3\times 3$ matrices
$$ \mathbf{A} = \begin{pmatrix} 1&0&1\\0&0&0\\1&0&1\end{pmatrix} \quad
\mathbf{B} = \begin{pmatrix} 0&0&0\\0&0&0\\1&1&1\end{pmatrix} $$
$\mathbf{A}$ has complexity $2$ because the set of rows and columns is $\{000,101\}$.
$\mathbf{B}$ has complexity $3$ because the set of rows and columns is $\{000,001,111\}$.</p>
<p>
For $0 \le k \le n^2$, let $c(n, k)$ be the <b>minimum</b> complexity of an $n\times n$ binary matrix with exactly $k$ ones.</p>
<p>
Let
$$C(n) = \sum_{k=0}^{n^2} c(n, k)$$
For example, $C(2) = c(2, 0) + c(2, 1) + c(2, 2) + c(2, 3) + c(2, 4) = 1 + 2 + 2 + 2 + 1 = 8$.<br/>
You are given $C(5) = 64$, $C(10) = 274$ and $C(20) = 1150$.</p>
<p>
Find $C(10^4)$.</p> | 318313204 | Saturday, 22nd January 2022, 10:00 pm | 164 | 70% | hard |
677 | Coloured Graphs | Let $g(n)$ be the number of undirected graphs with $n$ nodes satisfying the following properties:
The graph is connected and has no cycles or multiple edges.
Each node is either red, blue, or yellow.
A red node may have no more than 4 edges connected to it.
A blue or yellow node may have no more than 3 edges connected to it.
An edge may not directly connect a yellow node to a yellow node.
For example, $g(2)=5$, $g(3)=15$, and $g(4) = 57$.
You are also given that $g(10) = 710249$ and $g(100) \equiv 919747298 \pmod{1\,000\,000\,007}$.
Find $g(10\,000) \bmod 1\,000\,000\,007$. | Let $g(n)$ be the number of undirected graphs with $n$ nodes satisfying the following properties:
The graph is connected and has no cycles or multiple edges.
Each node is either red, blue, or yellow.
A red node may have no more than 4 edges connected to it.
A blue or yellow node may have no more than 3 edges connected to it.
An edge may not directly connect a yellow node to a yellow node.
For example, $g(2)=5$, $g(3)=15$, and $g(4) = 57$.
You are also given that $g(10) = 710249$ and $g(100) \equiv 919747298 \pmod{1\,000\,000\,007}$.
Find $g(10\,000) \bmod 1\,000\,000\,007$. | <p>Let $g(n)$ be the number of <strong>undirected graphs</strong> with $n$ nodes satisfying the following properties:</p>
<ul>
<li>The graph is connected and has no cycles or multiple edges.</li>
<li>Each node is either red, blue, or yellow.</li>
<li>A red node may have no more than 4 edges connected to it.</li>
<li>A blue or yellow node may have no more than 3 edges connected to it.</li>
<li>An edge may not directly connect a yellow node to a yellow node.</li>
</ul>
<p>For example, $g(2)=5$, $g(3)=15$, and $g(4) = 57$.<br/>
You are also given that $g(10) = 710249$ and $g(100) \equiv 919747298 \pmod{1\,000\,000\,007}$.</p>
<p>Find $g(10\,000) \bmod 1\,000\,000\,007$.</p> | 984183023 | Saturday, 29th June 2019, 07:00 pm | 202 | 90% | hard |
551 | Sum of Digits Sequence | Let $a_0, a_1, \dots$ be an integer sequence defined by:
$a_0 = 1$;
for $n \ge 1$, $a_n$ is the sum of the digits of all preceding terms.
The sequence starts with $1, 1, 2, 4, 8, 16, 23, 28, 38, 49, \dots$
You are given $a_{10^6} = 31054319$.
Find $a_{10^{15}}$. | Let $a_0, a_1, \dots$ be an integer sequence defined by:
$a_0 = 1$;
for $n \ge 1$, $a_n$ is the sum of the digits of all preceding terms.
The sequence starts with $1, 1, 2, 4, 8, 16, 23, 28, 38, 49, \dots$
You are given $a_{10^6} = 31054319$.
Find $a_{10^{15}}$. | <p>Let $a_0, a_1, \dots$ be an integer sequence defined by:</p>
<ul>
<li>$a_0 = 1$;</li>
<li>for $n \ge 1$, $a_n$ is the sum of the digits of all preceding terms.</li>
</ul>
<p>The sequence starts with $1, 1, 2, 4, 8, 16, 23, 28, 38, 49, \dots$<br/>
You are given $a_{10^6} = 31054319$.</p>
<p>Find $a_{10^{15}}$.</p> | 73597483551591773 | Saturday, 12th March 2016, 04:00 pm | 518 | 50% | medium |
694 | Cube-full Divisors | A positive integer $n$ is considered cube-full, if for every prime $p$ that divides $n$, so does $p^3$. Note that $1$ is considered cube-full.
Let $s(n)$ be the function that counts the number of cube-full divisors of $n$. For example, $1$, $8$ and $16$ are the three cube-full divisors of $16$. Therefore, $s(16)=3$.
Let $S(n)$ represent the summatory function of $s(n)$, that is $S(n)=\displaystyle\sum_{i=1}^n s(i)$.
You are given $S(16) = 19$, $S(100) = 126$ and $S(10000) = 13344$.
Find $S(10^{18})$. | A positive integer $n$ is considered cube-full, if for every prime $p$ that divides $n$, so does $p^3$. Note that $1$ is considered cube-full.
Let $s(n)$ be the function that counts the number of cube-full divisors of $n$. For example, $1$, $8$ and $16$ are the three cube-full divisors of $16$. Therefore, $s(16)=3$.
Let $S(n)$ represent the summatory function of $s(n)$, that is $S(n)=\displaystyle\sum_{i=1}^n s(i)$.
You are given $S(16) = 19$, $S(100) = 126$ and $S(10000) = 13344$.
Find $S(10^{18})$. | <p>
A positive integer $n$ is considered <dfn>cube-full</dfn>, if for every prime $p$ that divides $n$, so does $p^3$. Note that $1$ is considered cube-full.
</p>
<p>
Let $s(n)$ be the function that counts the number of cube-full divisors of $n$. For example, $1$, $8$ and $16$ are the three cube-full divisors of $16$. Therefore, $s(16)=3$.
</p>
<p>
Let $S(n)$ represent the summatory function of $s(n)$, that is $S(n)=\displaystyle\sum_{i=1}^n s(i)$.
</p>
<p>
You are given $S(16) = 19$, $S(100) = 126$ and $S(10000) = 13344$.
</p>
<p>
Find $S(10^{18})$.
</p> | 1339784153569958487 | Saturday, 21st December 2019, 07:00 pm | 1134 | 15% | easy |
157 | Base-10 Diophantine Reciprocal | Consider the diophantine equation $\frac 1 a + \frac 1 b = \frac p {10^n}$ with $a, b, p, n$ positive integers and $a \le b$.
For $n=1$ this equation has $20$ solutions that are listed below:
\begin{matrix}
\frac 1 1 + \frac 1 1 = \frac{20}{10} & \frac 1 1 + \frac 1 2 = \frac{15}{10} & \frac 1 1 + \frac 1 5 = \frac{12}{10} & \frac 1 1 + \frac 1 {10} = \frac{11}{10} & \frac 1 2 + \frac 1 2 = \frac{10}{10}\\
\frac 1 2 + \frac 1 5 = \frac 7 {10} & \frac 1 2 + \frac 1 {10} = \frac 6 {10} & \frac 1 3 + \frac 1 6 = \frac 5 {10} & \frac 1 3 + \frac 1 {15} = \frac 4 {10} & \frac 1 4 + \frac 1 4 = \frac 5 {10}\\
\frac 1 4 + \frac 1 {20} = \frac 3 {10} & \frac 1 5 + \frac 1 5 = \frac 4 {10} & \frac 1 5 + \frac 1 {10} = \frac 3 {10} & \frac 1 6 + \frac 1 {30} = \frac 2 {10} & \frac 1 {10} + \frac 1 {10} = \frac 2 {10}\\
\frac 1 {11} + \frac 1 {110} = \frac 1 {10} & \frac 1 {12} + \frac 1 {60} = \frac 1 {10} & \frac 1 {14} + \frac 1 {35} = \frac 1 {10} & \frac 1 {15} + \frac 1 {30} = \frac 1 {10} & \frac 1 {20} + \frac 1 {20} = \frac 1 {10}
\end{matrix}
How many solutions has this equation for $1 \le n \le 9$? | Consider the diophantine equation $\frac 1 a + \frac 1 b = \frac p {10^n}$ with $a, b, p, n$ positive integers and $a \le b$.
For $n=1$ this equation has $20$ solutions that are listed below:
\begin{matrix}
\frac 1 1 + \frac 1 1 = \frac{20}{10} & \frac 1 1 + \frac 1 2 = \frac{15}{10} & \frac 1 1 + \frac 1 5 = \frac{12}{10} & \frac 1 1 + \frac 1 {10} = \frac{11}{10} & \frac 1 2 + \frac 1 2 = \frac{10}{10}\\
\frac 1 2 + \frac 1 5 = \frac 7 {10} & \frac 1 2 + \frac 1 {10} = \frac 6 {10} & \frac 1 3 + \frac 1 6 = \frac 5 {10} & \frac 1 3 + \frac 1 {15} = \frac 4 {10} & \frac 1 4 + \frac 1 4 = \frac 5 {10}\\
\frac 1 4 + \frac 1 {20} = \frac 3 {10} & \frac 1 5 + \frac 1 5 = \frac 4 {10} & \frac 1 5 + \frac 1 {10} = \frac 3 {10} & \frac 1 6 + \frac 1 {30} = \frac 2 {10} & \frac 1 {10} + \frac 1 {10} = \frac 2 {10}\\
\frac 1 {11} + \frac 1 {110} = \frac 1 {10} & \frac 1 {12} + \frac 1 {60} = \frac 1 {10} & \frac 1 {14} + \frac 1 {35} = \frac 1 {10} & \frac 1 {15} + \frac 1 {30} = \frac 1 {10} & \frac 1 {20} + \frac 1 {20} = \frac 1 {10}
\end{matrix}
How many solutions has this equation for $1 \le n \le 9$? | <p>Consider the diophantine equation $\frac 1 a + \frac 1 b = \frac p {10^n}$ with $a, b, p, n$ positive integers and $a \le b$.<br/>
For $n=1$ this equation has $20$ solutions that are listed below:
\begin{matrix}
\frac 1 1 + \frac 1 1 = \frac{20}{10} & \frac 1 1 + \frac 1 2 = \frac{15}{10} & \frac 1 1 + \frac 1 5 = \frac{12}{10} & \frac 1 1 + \frac 1 {10} = \frac{11}{10} & \frac 1 2 + \frac 1 2 = \frac{10}{10}\\
\frac 1 2 + \frac 1 5 = \frac 7 {10} & \frac 1 2 + \frac 1 {10} = \frac 6 {10} & \frac 1 3 + \frac 1 6 = \frac 5 {10} & \frac 1 3 + \frac 1 {15} = \frac 4 {10} & \frac 1 4 + \frac 1 4 = \frac 5 {10}\\
\frac 1 4 + \frac 1 {20} = \frac 3 {10} & \frac 1 5 + \frac 1 5 = \frac 4 {10} & \frac 1 5 + \frac 1 {10} = \frac 3 {10} & \frac 1 6 + \frac 1 {30} = \frac 2 {10} & \frac 1 {10} + \frac 1 {10} = \frac 2 {10}\\
\frac 1 {11} + \frac 1 {110} = \frac 1 {10} & \frac 1 {12} + \frac 1 {60} = \frac 1 {10} & \frac 1 {14} + \frac 1 {35} = \frac 1 {10} & \frac 1 {15} + \frac 1 {30} = \frac 1 {10} & \frac 1 {20} + \frac 1 {20} = \frac 1 {10}
\end{matrix}
</p>
<p>How many solutions has this equation for $1 \le n \le 9$?</p> | 53490 | Friday, 1st June 2007, 06:00 pm | 3067 | 65% | hard |
29 | Distinct Powers | Consider all integer combinations of $a^b$ for $2 \le a \le 5$ and $2 \le b \le 5$:
\begin{matrix}
2^2=4, &2^3=8, &2^4=16, &2^5=32\\
3^2=9, &3^3=27, &3^4=81, &3^5=243\\
4^2=16, &4^3=64, &4^4=256, &4^5=1024\\
5^2=25, &5^3=125, &5^4=625, &5^5=3125
\end{matrix}
If they are then placed in numerical order, with any repeats removed, we get the following sequence of $15$ distinct terms:
$$4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125.$$
How many distinct terms are in the sequence generated by $a^b$ for $2 \le a \le 100$ and $2 \le b \le 100$? | Consider all integer combinations of $a^b$ for $2 \le a \le 5$ and $2 \le b \le 5$:
\begin{matrix}
2^2=4, &2^3=8, &2^4=16, &2^5=32\\
3^2=9, &3^3=27, &3^4=81, &3^5=243\\
4^2=16, &4^3=64, &4^4=256, &4^5=1024\\
5^2=25, &5^3=125, &5^4=625, &5^5=3125
\end{matrix}
If they are then placed in numerical order, with any repeats removed, we get the following sequence of $15$ distinct terms:
$$4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125.$$
How many distinct terms are in the sequence generated by $a^b$ for $2 \le a \le 100$ and $2 \le b \le 100$? | <p>Consider all integer combinations of $a^b$ for $2 \le a \le 5$ and $2 \le b \le 5$:</p>
\begin{matrix}
2^2=4, &2^3=8, &2^4=16, &2^5=32\\
3^2=9, &3^3=27, &3^4=81, &3^5=243\\
4^2=16, &4^3=64, &4^4=256, &4^5=1024\\
5^2=25, &5^3=125, &5^4=625, &5^5=3125
\end{matrix}
<p>If they are then placed in numerical order, with any repeats removed, we get the following sequence of $15$ distinct terms:
$$4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125.$$</p>
<p>How many distinct terms are in the sequence generated by $a^b$ for $2 \le a \le 100$ and $2 \le b \le 100$?</p> | 9183 | Friday, 25th October 2002, 06:00 pm | 114713 | 5% | easy |
925 | Larger Digit Permutation III | Let $B(n)$ be the smallest number larger than $n$ that can be formed by rearranging digits of $n$, or $0$ if no such number exists. For example, $B(245) = 254$ and $B(542) = 0$.
Define $\displaystyle T(N) = \sum_{n=1}^N B(n^2)$. You are given $T(10)=270$ and $T(100)=335316$.
Find $T(10^{16})$. Give your answer modulo $10^9 + 7$. | Let $B(n)$ be the smallest number larger than $n$ that can be formed by rearranging digits of $n$, or $0$ if no such number exists. For example, $B(245) = 254$ and $B(542) = 0$.
Define $\displaystyle T(N) = \sum_{n=1}^N B(n^2)$. You are given $T(10)=270$ and $T(100)=335316$.
Find $T(10^{16})$. Give your answer modulo $10^9 + 7$. | <p>Let $B(n)$ be the smallest number larger than $n$ that can be formed by rearranging digits of $n$, or $0$ if no such number exists. For example, $B(245) = 254$ and $B(542) = 0$.</p>
<p>Define $\displaystyle T(N) = \sum_{n=1}^N B(n^2)$. You are given $T(10)=270$ and $T(100)=335316$.</p>
<p>Find $T(10^{16})$. Give your answer modulo $10^9 + 7$.</p> | 400034379 | Saturday, 28th December 2024, 07:00 pm | 153 | 55% | medium |
821 | 123-Separable | A set, $S$, of integers is called 123-separable if $S$, $2S$ and $3S$ are disjoint. Here $2S$ and $3S$ are obtained by multiplying all the elements in $S$ by $2$ and $3$ respectively.
Define $F(n)$ to be the maximum number of elements of
$$(S\cup 2S \cup 3S)\cap \{1,2,3,\ldots,n\}$$
where $S$ ranges over all 123-separable sets.
For example, $F(6) = 5$ can be achieved with either $S = \{1,4,5\}$ or $S = \{1,5,6\}$.
You are also given $F(20) = 19$.
Find $F(10^{16})$. | A set, $S$, of integers is called 123-separable if $S$, $2S$ and $3S$ are disjoint. Here $2S$ and $3S$ are obtained by multiplying all the elements in $S$ by $2$ and $3$ respectively.
Define $F(n)$ to be the maximum number of elements of
$$(S\cup 2S \cup 3S)\cap \{1,2,3,\ldots,n\}$$
where $S$ ranges over all 123-separable sets.
For example, $F(6) = 5$ can be achieved with either $S = \{1,4,5\}$ or $S = \{1,5,6\}$.
You are also given $F(20) = 19$.
Find $F(10^{16})$. | <p>
A set, $S$, of integers is called <dfn>123-separable</dfn> if $S$, $2S$ and $3S$ are disjoint. Here $2S$ and $3S$ are obtained by multiplying all the elements in $S$ by $2$ and $3$ respectively.</p>
<p>
Define $F(n)$ to be the maximum number of elements of
$$(S\cup 2S \cup 3S)\cap \{1,2,3,\ldots,n\}$$
where $S$ ranges over all 123-separable sets.</p>
<p>
For example, $F(6) = 5$ can be achieved with either $S = \{1,4,5\}$ or $S = \{1,5,6\}$.<br/>
You are also given $F(20) = 19$.</p>
<p>
Find $F(10^{16})$.</p> | 9219661511328178 | Saturday, 17th December 2022, 07:00 pm | 161 | 65% | hard |
883 | Remarkable Triangles | In this problem we consider triangles drawn on a hexagonal lattice, where each lattice point in the plane has six neighbouring points equally spaced around it, all distance $1$ away.
We call a triangle remarkable if
All three vertices and its incentre lie on lattice points
At least one of its angles is $60^\circ$
Above are four examples of remarkable triangles, with $60^\circ$ angles illustrated in red. Triangles A and B have inradius $1$; C has inradius $\sqrt{3}$; D has inradius $2$.
Define $T(r)$ to be the number of remarkable triangles with inradius $\le r$. Rotations and reflections, such as triangles A and B above, are counted separately; however direct translations are not. That is, the same triangle drawn in different positions of the lattice is only counted once.
You are given $T(0.5)=2$, $T(2)=44$, and $T(10)=1302$.
Find $T(10^6)$. | In this problem we consider triangles drawn on a hexagonal lattice, where each lattice point in the plane has six neighbouring points equally spaced around it, all distance $1$ away.
We call a triangle remarkable if
All three vertices and its incentre lie on lattice points
At least one of its angles is $60^\circ$
Above are four examples of remarkable triangles, with $60^\circ$ angles illustrated in red. Triangles A and B have inradius $1$; C has inradius $\sqrt{3}$; D has inradius $2$.
Define $T(r)$ to be the number of remarkable triangles with inradius $\le r$. Rotations and reflections, such as triangles A and B above, are counted separately; however direct translations are not. That is, the same triangle drawn in different positions of the lattice is only counted once.
You are given $T(0.5)=2$, $T(2)=44$, and $T(10)=1302$.
Find $T(10^6)$. | <p>
In this problem we consider triangles drawn on a <b>hexagonal lattice</b>, where each lattice point in the plane has six neighbouring points equally spaced around it, all distance $1$ away.</p>
<p>
We call a triangle <i>remarkable</i> if</p>
<ul>
<li>All three vertices and its <b>incentre</b> lie on lattice points</li>
<li>At least one of its angles is $60^\circ$</li>
</ul>
<img alt="0883_diagram.png" src="resources/images/0883_diagram.png?1707941179"/>
<p>
Above are four examples of remarkable triangles, with $60^\circ$ angles illustrated in red. Triangles A and B have inradius $1$; C has inradius $\sqrt{3}$; D has inradius $2$.</p>
<p>
Define $T(r)$ to be the number of remarkable triangles with inradius $\le r$. Rotations and reflections, such as triangles A and B above, are counted separately; however direct translations are not. That is, the same triangle drawn in different positions of the lattice is only counted once.</p>
<p>
You are given $T(0.5)=2$, $T(2)=44$, and $T(10)=1302$.</p>
<p>
Find $T(10^6)$.</p> | 14854003484704 | Sunday, 24th March 2024, 04:00 am | 109 | 95% | hard |
873 | Words with Gaps | Let $W(p,q,r)$ be the number of words that can be formed using the letter A $p$ times, the letter B $q$ times and the letter C $r$ times with the condition that every A is separated from every B by at least two Cs. For example, CACACCBB is a valid word for $W(2,2,4)$ but ACBCACBC is not.
You are given $W(2,2,4)=32$ and $W(4,4,44)=13908607644$.
Find $W(10^6,10^7,10^8)$. Give your answer modulo $1\,000\,000\,007$. | Let $W(p,q,r)$ be the number of words that can be formed using the letter A $p$ times, the letter B $q$ times and the letter C $r$ times with the condition that every A is separated from every B by at least two Cs. For example, CACACCBB is a valid word for $W(2,2,4)$ but ACBCACBC is not.
You are given $W(2,2,4)=32$ and $W(4,4,44)=13908607644$.
Find $W(10^6,10^7,10^8)$. Give your answer modulo $1\,000\,000\,007$. | <p>
Let $W(p,q,r)$ be the number of words that can be formed using the letter A $p$ times, the letter B $q$ times and the letter C $r$ times with the condition that every A is separated from every B by at least two Cs. For example, CACACCBB is a valid word for $W(2,2,4)$ but ACBCACBC is not.</p>
<p>
You are given $W(2,2,4)=32$ and $W(4,4,44)=13908607644$.</p>
<p>
Find $W(10^6,10^7,10^8)$. Give your answer modulo $1\,000\,000\,007$.</p> | 735131856 | Sunday, 21st January 2024, 01:00 am | 328 | 25% | easy |
515 | Dissonant Numbers | Let $d(p, n, 0)$ be the multiplicative inverse of $n$ modulo prime $p$, defined as $n \times d(p, n, 0) = 1 \bmod p$.
Let $d(p, n, k) = \sum_{i = 1}^n d(p, i, k - 1)$ for $k \ge 1$.
Let $D(a, b, k) = \sum (d(p, p-1, k) \bmod p)$ for all primes $a \le p \lt a + b$.
You are given:
$D(101,1,10) = 45$
$D(10^3,10^2,10^2) = 8334$
$D(10^6,10^3,10^3) = 38162302$Find $D(10^9,10^5,10^5)$. | Let $d(p, n, 0)$ be the multiplicative inverse of $n$ modulo prime $p$, defined as $n \times d(p, n, 0) = 1 \bmod p$.
Let $d(p, n, k) = \sum_{i = 1}^n d(p, i, k - 1)$ for $k \ge 1$.
Let $D(a, b, k) = \sum (d(p, p-1, k) \bmod p)$ for all primes $a \le p \lt a + b$.
You are given:
$D(101,1,10) = 45$
$D(10^3,10^2,10^2) = 8334$
$D(10^6,10^3,10^3) = 38162302$Find $D(10^9,10^5,10^5)$. | <p>Let $d(p, n, 0)$ be the multiplicative inverse of $n$ modulo prime $p$, defined as $n \times d(p, n, 0) = 1 \bmod p$.<br/>
Let $d(p, n, k) = \sum_{i = 1}^n d(p, i, k - 1)$ for $k \ge 1$.<br/>
Let $D(a, b, k) = \sum (d(p, p-1, k) \bmod p)$ for all primes $a \le p \lt a + b$.</p>
<p>You are given:</p>
<ul><li>$D(101,1,10) = 45$</li>
<li>$D(10^3,10^2,10^2) = 8334$</li>
<li>$D(10^6,10^3,10^3) = 38162302$</li></ul><p>Find $D(10^9,10^5,10^5)$.</p> | 2422639000800 | Sunday, 10th May 2015, 07:00 am | 507 | 40% | medium |
407 | Idempotents | If we calculate $a^2 \bmod 6$ for $0 \leq a \leq 5$ we get: $0,1,4,3,4,1$.
The largest value of $a$ such that $a^2 \equiv a \bmod 6$ is $4$.
Let's call $M(n)$ the largest value of $a \lt n$ such that $a^2 \equiv a \pmod n$.
So $M(6) = 4$.
Find $\sum M(n)$ for $1 \leq n \leq 10^7$. | If we calculate $a^2 \bmod 6$ for $0 \leq a \leq 5$ we get: $0,1,4,3,4,1$.
The largest value of $a$ such that $a^2 \equiv a \bmod 6$ is $4$.
Let's call $M(n)$ the largest value of $a \lt n$ such that $a^2 \equiv a \pmod n$.
So $M(6) = 4$.
Find $\sum M(n)$ for $1 \leq n \leq 10^7$. | <p>
If we calculate $a^2 \bmod 6$ for $0 \leq a \leq 5$ we get: $0,1,4,3,4,1$.
</p>
<p>
The largest value of $a$ such that $a^2 \equiv a \bmod 6$ is $4$.<br/>
Let's call $M(n)$ the largest value of $a \lt n$ such that $a^2 \equiv a \pmod n$.<br/>
So $M(6) = 4$.
</p>
<p>
Find $\sum M(n)$ for $1 \leq n \leq 10^7$.
</p> | 39782849136421 | Sunday, 23rd December 2012, 10:00 am | 2751 | 20% | easy |
718 | Unreachable Numbers | Consider the equation
$17^pa+19^pb+23^pc = n$ where $a$, $b$, $c$ and $p$ are positive integers, i.e.
$a,b,c,p \gt 0$.
For a given $p$ there are some values of $n > 0$ for which the equation cannot be solved. We call these unreachable values.
Define $G(p)$ to be the sum of all unreachable values of $n$ for the given value of $p$. For example $G(1) = 8253$ and $G(2)= 60258000$.
Find $G(6)$. Give your answer modulo $1\,000\,000\,007$. | Consider the equation
$17^pa+19^pb+23^pc = n$ where $a$, $b$, $c$ and $p$ are positive integers, i.e.
$a,b,c,p \gt 0$.
For a given $p$ there are some values of $n > 0$ for which the equation cannot be solved. We call these unreachable values.
Define $G(p)$ to be the sum of all unreachable values of $n$ for the given value of $p$. For example $G(1) = 8253$ and $G(2)= 60258000$.
Find $G(6)$. Give your answer modulo $1\,000\,000\,007$. | <p>Consider the equation
$17^pa+19^pb+23^pc = n$ where $a$, $b$, $c$ and $p$ are positive integers, i.e.
$a,b,c,p \gt 0$.</p>
<p>For a given $p$ there are some values of $n > 0$ for which the equation cannot be solved. We call these <dfn>unreachable values</dfn>.</p>
<p>Define $G(p)$ to be the sum of all unreachable values of $n$ for the given value of $p$. For example $G(1) = 8253$ and $G(2)= 60258000$.</p>
<p>Find $G(6)$. Give your answer modulo $1\,000\,000\,007$.</p> | 228579116 | Saturday, 30th May 2020, 05:00 pm | 362 | 35% | medium |
239 | Twenty-two Foolish Primes | A set of disks numbered $1$ through $100$ are placed in a line in random order.
What is the probability that we have a partial derangement such that exactly $22$ prime number discs are found away from their natural positions?
(Any number of non-prime disks may also be found in or out of their natural positions.)
Give your answer rounded to $12$ places behind the decimal point in the form 0.abcdefghijkl. | A set of disks numbered $1$ through $100$ are placed in a line in random order.
What is the probability that we have a partial derangement such that exactly $22$ prime number discs are found away from their natural positions?
(Any number of non-prime disks may also be found in or out of their natural positions.)
Give your answer rounded to $12$ places behind the decimal point in the form 0.abcdefghijkl. | <p>A set of disks numbered $1$ through $100$ are placed in a line in random order.</p>
<p>What is the probability that we have a partial derangement such that exactly $22$ prime number discs are found away from their natural positions?<br/>
(Any number of non-prime disks may also be found in or out of their natural positions.)</p>
<p>Give your answer rounded to $12$ places behind the decimal point in the form 0.abcdefghijkl.</p> | 0.001887854841 | Friday, 3rd April 2009, 05:00 pm | 2019 | 65% | hard |
725 | Digit Sum Numbers | A number where one digit is the sum of the other digits is called a digit sum number or DS-number for short. For example, $352$, $3003$ and $32812$ are DS-numbers.
We define $S(n)$ to be the sum of all DS-numbers of $n$ digits or less.
You are given $S(3) = 63270$ and $S(7) = 85499991450$.
Find $S(2020)$. Give your answer modulo $10^{16}$. | A number where one digit is the sum of the other digits is called a digit sum number or DS-number for short. For example, $352$, $3003$ and $32812$ are DS-numbers.
We define $S(n)$ to be the sum of all DS-numbers of $n$ digits or less.
You are given $S(3) = 63270$ and $S(7) = 85499991450$.
Find $S(2020)$. Give your answer modulo $10^{16}$. | <p>
A number where one digit is the sum of the <b>other</b> digits is called a <dfn>digit sum number</dfn> or DS-number for short. For example, $352$, $3003$ and $32812$ are DS-numbers.
</p>
<p>
We define $S(n)$ to be the sum of all DS-numbers of $n$ digits or less.
</p>
<p>
You are given $S(3) = 63270$ and $S(7) = 85499991450$.
</p>
<p>
Find $S(2020)$. Give your answer modulo $10^{16}$.
</p> | 4598797036650685 | Saturday, 12th September 2020, 05:00 pm | 1230 | 10% | easy |
528 | Constrained Sums | Let $S(n, k, b)$ represent the number of valid solutions to $x_1 + x_2 + \cdots + x_k \le n$, where $0 \le x_m \le b^m$ for all $1 \le m \le k$.
For example, $S(14,3,2) = 135$, $S(200,5,3) = 12949440$, and $S(1000,10,5) \bmod 1\,000\,000\,007 = 624839075$.
Find $(\sum_{10 \le k \le 15} S(10^k, k, k)) \bmod 1\,000\,000\,007$. | Let $S(n, k, b)$ represent the number of valid solutions to $x_1 + x_2 + \cdots + x_k \le n$, where $0 \le x_m \le b^m$ for all $1 \le m \le k$.
For example, $S(14,3,2) = 135$, $S(200,5,3) = 12949440$, and $S(1000,10,5) \bmod 1\,000\,000\,007 = 624839075$.
Find $(\sum_{10 \le k \le 15} S(10^k, k, k)) \bmod 1\,000\,000\,007$. | <p>Let $S(n, k, b)$ represent the number of valid solutions to $x_1 + x_2 + \cdots + x_k \le n$, where $0 \le x_m \le b^m$ for all $1 \le m \le k$.</p>
<p>For example, $S(14,3,2) = 135$, $S(200,5,3) = 12949440$, and $S(1000,10,5) \bmod 1\,000\,000\,007 = 624839075$.</p>
<p>Find $(\sum_{10 \le k \le 15} S(10^k, k, k)) \bmod 1\,000\,000\,007$.</p> | 779027989 | Saturday, 3rd October 2015, 07:00 pm | 327 | 60% | hard |
582 | Nearly Isosceles $120$ Degree Triangles | Let $a, b$ and $c$ be the sides of an integer sided triangle with one angle of $120$ degrees, $a \le b \le c$ and $b-a \le 100$.
Let $T(n)$ be the number of such triangles with $c \le n$.
$T(1000)=235$ and $T(10^8)=1245$.
Find $T(10^{100})$. | Let $a, b$ and $c$ be the sides of an integer sided triangle with one angle of $120$ degrees, $a \le b \le c$ and $b-a \le 100$.
Let $T(n)$ be the number of such triangles with $c \le n$.
$T(1000)=235$ and $T(10^8)=1245$.
Find $T(10^{100})$. | <p>
Let $a, b$ and $c$ be the sides of an integer sided triangle with one angle of $120$ degrees, $a \le b \le c$ and $b-a \le 100$.<br/>
Let $T(n)$ be the number of such triangles with $c \le n$.<br/>
$T(1000)=235$ and $T(10^8)=1245$.<br/>
Find $T(10^{100})$.
</p> | 19903 | Sunday, 18th December 2016, 10:00 am | 363 | 50% | medium |
396 | Weak Goodstein Sequence | For any positive integer $n$, the $n$th weak Goodstein sequence $\{g_1, g_2, g_3, \dots\}$ is defined as:
$g_1 = n$
for $k \gt 1$, $g_k$ is obtained by writing $g_{k-1}$ in base $k$, interpreting it as a base $k + 1$ number, and subtracting $1$.
The sequence terminates when $g_k$ becomes $0$.
For example, the $6$th weak Goodstein sequence is $\{6, 11, 17, 25, \dots\}$:
$g_1 = 6$.
$g_2 = 11$ since $6 = 110_2$, $110_3 = 12$, and $12 - 1 = 11$.
$g_3 = 17$ since $11 = 102_3$, $102_4 = 18$, and $18 - 1 = 17$.
$g_4 = 25$ since $17 = 101_4$, $101_5 = 26$, and $26 - 1 = 25$.
and so on.
It can be shown that every weak Goodstein sequence terminates.
Let $G(n)$ be the number of nonzero elements in the $n$th weak Goodstein sequence.
It can be verified that $G(2) = 3$, $G(4) = 21$ and $G(6) = 381$.
It can also be verified that $\sum G(n) = 2517$ for $1 \le n \lt 8$.
Find the last $9$ digits of $\sum G(n)$ for $1 \le n \lt 16$. | For any positive integer $n$, the $n$th weak Goodstein sequence $\{g_1, g_2, g_3, \dots\}$ is defined as:
$g_1 = n$
for $k \gt 1$, $g_k$ is obtained by writing $g_{k-1}$ in base $k$, interpreting it as a base $k + 1$ number, and subtracting $1$.
The sequence terminates when $g_k$ becomes $0$.
For example, the $6$th weak Goodstein sequence is $\{6, 11, 17, 25, \dots\}$:
$g_1 = 6$.
$g_2 = 11$ since $6 = 110_2$, $110_3 = 12$, and $12 - 1 = 11$.
$g_3 = 17$ since $11 = 102_3$, $102_4 = 18$, and $18 - 1 = 17$.
$g_4 = 25$ since $17 = 101_4$, $101_5 = 26$, and $26 - 1 = 25$.
and so on.
It can be shown that every weak Goodstein sequence terminates.
Let $G(n)$ be the number of nonzero elements in the $n$th weak Goodstein sequence.
It can be verified that $G(2) = 3$, $G(4) = 21$ and $G(6) = 381$.
It can also be verified that $\sum G(n) = 2517$ for $1 \le n \lt 8$.
Find the last $9$ digits of $\sum G(n)$ for $1 \le n \lt 16$. | <p>
For any positive integer $n$, the <strong>$n$th weak Goodstein sequence</strong> $\{g_1, g_2, g_3, \dots\}$ is defined as:
</p><ul><li> $g_1 = n$
</li><li> for $k \gt 1$, $g_k$ is obtained by writing $g_{k-1}$ in base $k$, interpreting it as a base $k + 1$ number, and subtracting $1$.
</li></ul>
The sequence terminates when $g_k$ becomes $0$.
<p>
For example, the $6$th weak Goodstein sequence is $\{6, 11, 17, 25, \dots\}$:
</p><ul><li> $g_1 = 6$.
</li><li> $g_2 = 11$ since $6 = 110_2$, $110_3 = 12$, and $12 - 1 = 11$.
</li><li> $g_3 = 17$ since $11 = 102_3$, $102_4 = 18$, and $18 - 1 = 17$.
</li><li> $g_4 = 25$ since $17 = 101_4$, $101_5 = 26$, and $26 - 1 = 25$.
</li></ul>
and so on.
<p>
It can be shown that every weak Goodstein sequence terminates.
</p>
<p>
Let $G(n)$ be the number of nonzero elements in the $n$th weak Goodstein sequence.<br/>
It can be verified that $G(2) = 3$, $G(4) = 21$ and $G(6) = 381$.<br/>
It can also be verified that $\sum G(n) = 2517$ for $1 \le n \lt 8$.
</p>
<p>
Find the last $9$ digits of $\sum G(n)$ for $1 \le n \lt 16$.
</p> | 173214653 | Sunday, 30th September 2012, 02:00 am | 728 | 40% | medium |
320 | Factorials Divisible by a Huge Integer | Let $N(i)$ be the smallest integer $n$ such that $n!$ is divisible by $(i!)^{1234567890}$
Let $S(u)=\sum N(i)$ for $10 \le i \le u$.
$S(1000)=614538266565663$.
Find $S(1\,000\,000) \bmod 10^{18}$. | Let $N(i)$ be the smallest integer $n$ such that $n!$ is divisible by $(i!)^{1234567890}$
Let $S(u)=\sum N(i)$ for $10 \le i \le u$.
$S(1000)=614538266565663$.
Find $S(1\,000\,000) \bmod 10^{18}$. | <p>
Let $N(i)$ be the smallest integer $n$ such that $n!$ is divisible by $(i!)^{1234567890}$</p>
<p>
Let $S(u)=\sum N(i)$ for $10 \le i \le u$.
</p>
<p>
$S(1000)=614538266565663$.
</p>
<p>
Find $S(1\,000\,000) \bmod 10^{18}$.
</p> | 278157919195482643 | Saturday, 15th January 2011, 10:00 pm | 987 | 50% | medium |
102 | Triangle Containment | Three distinct points are plotted at random on a Cartesian plane, for which $-1000 \le x, y \le 1000$, such that a triangle is formed.
Consider the following two triangles:
\begin{gather}
A(-340,495), B(-153,-910), C(835,-947)\\
X(-175,41), Y(-421,-714), Z(574,-645)
\end{gather}
It can be verified that triangle $ABC$ contains the origin, whereas triangle $XYZ$ does not.
Using triangles.txt (right click and 'Save Link/Target As...'), a 27K text file containing the co-ordinates of one thousand "random" triangles, find the number of triangles for which the interior contains the origin.
NOTE: The first two examples in the file represent the triangles in the example given above. | Three distinct points are plotted at random on a Cartesian plane, for which $-1000 \le x, y \le 1000$, such that a triangle is formed.
Consider the following two triangles:
\begin{gather}
A(-340,495), B(-153,-910), C(835,-947)\\
X(-175,41), Y(-421,-714), Z(574,-645)
\end{gather}
It can be verified that triangle $ABC$ contains the origin, whereas triangle $XYZ$ does not.
Using triangles.txt (right click and 'Save Link/Target As...'), a 27K text file containing the co-ordinates of one thousand "random" triangles, find the number of triangles for which the interior contains the origin.
NOTE: The first two examples in the file represent the triangles in the example given above. | <p>Three distinct points are plotted at random on a Cartesian plane, for which $-1000 \le x, y \le 1000$, such that a triangle is formed.</p>
<p>Consider the following two triangles:</p>
\begin{gather}
A(-340,495), B(-153,-910), C(835,-947)\\
X(-175,41), Y(-421,-714), Z(574,-645)
\end{gather}
<p>It can be verified that triangle $ABC$ contains the origin, whereas triangle $XYZ$ does not.</p>
<p>Using <a href="resources/documents/0102_triangles.txt">triangles.txt</a> (right click and 'Save Link/Target As...'), a 27K text file containing the co-ordinates of one thousand "random" triangles, find the number of triangles for which the interior contains the origin.</p>
<p class="smaller">NOTE: The first two examples in the file represent the triangles in the example given above.</p> | 228 | Friday, 12th August 2005, 06:00 pm | 24175 | 15% | easy |
147 | Rectangles in Cross-hatched Grids | In a $3 \times 2$ cross-hatched grid, a total of $37$ different rectangles could be situated within that grid as indicated in the sketch.
There are $5$ grids smaller than $3 \times 2$, vertical and horizontal dimensions being important, i.e. $1 \times 1$, $2 \times 1$, $3 \times 1$, $1 \times 2$ and $2 \times 2$. If each of them is cross-hatched, the following number of different rectangles could be situated within those smaller grids:
$1 \times 1$$1$
$2 \times 1$$4$
$3 \times 1$$8$
$1 \times 2$$4$
$2 \times 2$$18$
Adding those to the $37$ of the $3 \times 2$ grid, a total of $72$ different rectangles could be situated within $3 \times 2$ and smaller grids.
How many different rectangles could be situated within $47 \times 43$ and smaller grids? | In a $3 \times 2$ cross-hatched grid, a total of $37$ different rectangles could be situated within that grid as indicated in the sketch.
There are $5$ grids smaller than $3 \times 2$, vertical and horizontal dimensions being important, i.e. $1 \times 1$, $2 \times 1$, $3 \times 1$, $1 \times 2$ and $2 \times 2$. If each of them is cross-hatched, the following number of different rectangles could be situated within those smaller grids:
$1 \times 1$$1$
$2 \times 1$$4$
$3 \times 1$$8$
$1 \times 2$$4$
$2 \times 2$$18$
Adding those to the $37$ of the $3 \times 2$ grid, a total of $72$ different rectangles could be situated within $3 \times 2$ and smaller grids.
How many different rectangles could be situated within $47 \times 43$ and smaller grids? | <p>In a $3 \times 2$ cross-hatched grid, a total of $37$ different rectangles could be situated within that grid as indicated in the sketch.</p>
<div class="center"><img alt="" class="dark_img" src="resources/images/0147.png?1678992052"/></div>
<p>There are $5$ grids smaller than $3 \times 2$, vertical and horizontal dimensions being important, i.e. $1 \times 1$, $2 \times 1$, $3 \times 1$, $1 \times 2$ and $2 \times 2$. If each of them is cross-hatched, the following number of different rectangles could be situated within those smaller grids:</p>
<table class="grid" style="margin:0 auto;">
<tr><td align="center" style="width:50px;">$1 \times 1$</td><td align="right" style="width:50px;">$1$</td></tr>
<tr><td align="center">$2 \times 1$</td><td align="right">$4$</td></tr>
<tr><td align="center">$3 \times 1$</td><td align="right">$8$</td></tr>
<tr><td align="center">$1 \times 2$</td><td align="right">$4$</td></tr>
<tr><td align="center">$2 \times 2$</td><td align="right">$18$</td></tr>
</table>
<p>Adding those to the $37$ of the $3 \times 2$ grid, a total of $72$ different rectangles could be situated within $3 \times 2$ and smaller grids.</p>
<p>How many different rectangles could be situated within $47 \times 43$ and smaller grids?</p> | 846910284 | Saturday, 31st March 2007, 06:00 am | 3428 | 65% | hard |
72 | Counting Fractions | Consider the fraction, $\dfrac n d$, where $n$ and $d$ are positive integers. If $n \lt d$ and $\operatorname{HCF}(n,d)=1$, it is called a reduced proper fraction.
If we list the set of reduced proper fractions for $d \le 8$ in ascending order of size, we get:
$$\frac 1 8, \frac 1 7, \frac 1 6, \frac 1 5, \frac 1 4, \frac 2 7, \frac 1 3, \frac 3 8, \frac 2 5, \frac 3 7, \frac 1 2, \frac 4 7, \frac 3 5, \frac 5 8, \frac 2 3, \frac 5 7, \frac 3 4, \frac 4 5, \frac 5 6, \frac 6 7, \frac 7 8$$
It can be seen that there are $21$ elements in this set.
How many elements would be contained in the set of reduced proper fractions for $d \le 1\,000\,000$? | Consider the fraction, $\dfrac n d$, where $n$ and $d$ are positive integers. If $n \lt d$ and $\operatorname{HCF}(n,d)=1$, it is called a reduced proper fraction.
If we list the set of reduced proper fractions for $d \le 8$ in ascending order of size, we get:
$$\frac 1 8, \frac 1 7, \frac 1 6, \frac 1 5, \frac 1 4, \frac 2 7, \frac 1 3, \frac 3 8, \frac 2 5, \frac 3 7, \frac 1 2, \frac 4 7, \frac 3 5, \frac 5 8, \frac 2 3, \frac 5 7, \frac 3 4, \frac 4 5, \frac 5 6, \frac 6 7, \frac 7 8$$
It can be seen that there are $21$ elements in this set.
How many elements would be contained in the set of reduced proper fractions for $d \le 1\,000\,000$? | <p>Consider the fraction, $\dfrac n d$, where $n$ and $d$ are positive integers. If $n \lt d$ and $\operatorname{HCF}(n,d)=1$, it is called a reduced proper fraction.</p>
<p>If we list the set of reduced proper fractions for $d \le 8$ in ascending order of size, we get:
$$\frac 1 8, \frac 1 7, \frac 1 6, \frac 1 5, \frac 1 4, \frac 2 7, \frac 1 3, \frac 3 8, \frac 2 5, \frac 3 7, \frac 1 2, \frac 4 7, \frac 3 5, \frac 5 8, \frac 2 3, \frac 5 7, \frac 3 4, \frac 4 5, \frac 5 6, \frac 6 7, \frac 7 8$$</p>
<p>It can be seen that there are $21$ elements in this set.</p>
<p>How many elements would be contained in the set of reduced proper fractions for $d \le 1\,000\,000$?</p> | 303963552391 | Friday, 18th June 2004, 06:00 pm | 25006 | 20% | easy |
695 | Random Rectangles | Three points, $P_1$, $P_2$ and $P_3$, are randomly selected within a unit square. Consider the three rectangles with sides parallel to the sides of the unit square and a diagonal that is one of the three line segments $\overline{P_1P_2}$, $\overline{P_1P_3}$ or $\overline{P_2P_3}$ (see picture below).
We are interested in the rectangle with the second biggest area. In the example above that happens to be the green rectangle defined with the diagonal $\overline{P_2P_3}$.
Find the expected value of the area of the second biggest of the three rectangles. Give your answer rounded to 10 digits after the decimal point. | Three points, $P_1$, $P_2$ and $P_3$, are randomly selected within a unit square. Consider the three rectangles with sides parallel to the sides of the unit square and a diagonal that is one of the three line segments $\overline{P_1P_2}$, $\overline{P_1P_3}$ or $\overline{P_2P_3}$ (see picture below).
We are interested in the rectangle with the second biggest area. In the example above that happens to be the green rectangle defined with the diagonal $\overline{P_2P_3}$.
Find the expected value of the area of the second biggest of the three rectangles. Give your answer rounded to 10 digits after the decimal point. | <p>Three points, $P_1$, $P_2$ and $P_3$, are randomly selected within a unit square. Consider the three rectangles with sides parallel to the sides of the unit square and a diagonal that is one of the three line segments $\overline{P_1P_2}$, $\overline{P_1P_3}$ or $\overline{P_2P_3}$ (see picture below).</p>
<div class="center">
<img alt="3 random rectangles" src="project/images/p695_randrect.png"/></div>
<p>We are interested in the rectangle with the second biggest area. In the example above that happens to be the green rectangle defined with the diagonal $\overline{P_2P_3}$.</p>
<p>Find the expected value of the area of the second biggest of the three rectangles. Give your answer rounded to 10 digits after the decimal point.</p> | 0.1017786859 | Saturday, 28th December 2019, 10:00 pm | 233 | 70% | hard |
78 | Coin Partitions | Let $p(n)$ represent the number of different ways in which $n$ coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so $p(5)=7$.
OOOOO
OOOO O
OOO OO
OOO O O
OO OO O
OO O O O
O O O O O
Find the least value of $n$ for which $p(n)$ is divisible by one million. | Let $p(n)$ represent the number of different ways in which $n$ coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so $p(5)=7$.
OOOOO
OOOO O
OOO OO
OOO O O
OO OO O
OO O O O
O O O O O
Find the least value of $n$ for which $p(n)$ is divisible by one million. | <p>Let $p(n)$ represent the number of different ways in which $n$ coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so $p(5)=7$.</p>
<div class="margin_left">
OOOOO<br/>
OOOO O<br/>
OOO OO<br/>
OOO O O<br/>
OO OO O<br/>
OO O O O<br/>
O O O O O
</div>
<p>Find the least value of $n$ for which $p(n)$ is divisible by one million.</p> | 55374 | Friday, 10th September 2004, 06:00 pm | 19163 | 30% | easy |
871 | Drifting Subsets | Let $f$ be a function from a finite set $S$ to itself. A drifting subset for $f$ is a subset $A$ of $S$ such that the number of elements in the union $A \cup f(A)$ is equal to twice the number of elements of $A$.
We write $D(f)$ for the maximal number of elements among all drifting subsets for $f$.
For a positive integer $n$, define $f_n$ as the function from $\{0, 1, \dots, n - 1\}$ to itself sending $x$ to $x^3 + x + 1 \bmod n$.
You are given $D(f_5) = 1$ and $D(f_{10}) = 3$.
Find $\displaystyle\sum_{i = 1}^{100} D(f_{10^5 + i})$. | Let $f$ be a function from a finite set $S$ to itself. A drifting subset for $f$ is a subset $A$ of $S$ such that the number of elements in the union $A \cup f(A)$ is equal to twice the number of elements of $A$.
We write $D(f)$ for the maximal number of elements among all drifting subsets for $f$.
For a positive integer $n$, define $f_n$ as the function from $\{0, 1, \dots, n - 1\}$ to itself sending $x$ to $x^3 + x + 1 \bmod n$.
You are given $D(f_5) = 1$ and $D(f_{10}) = 3$.
Find $\displaystyle\sum_{i = 1}^{100} D(f_{10^5 + i})$. | <p>
Let $f$ be a function from a finite set $S$ to itself. A <dfn>drifting subset</dfn> for $f$ is a subset $A$ of $S$ such that the number of elements in the union $A \cup f(A)$ is equal to twice the number of elements of $A$.<br/>
We write $D(f)$ for the maximal number of elements among all drifting subsets for $f$.</p>
<p>
For a positive integer $n$, define $f_n$ as the function from $\{0, 1, \dots, n - 1\}$ to itself sending $x$ to $x^3 + x + 1 \bmod n$.<br/>
You are given $D(f_5) = 1$ and $D(f_{10}) = 3$.</p>
<p>
Find $\displaystyle\sum_{i = 1}^{100} D(f_{10^5 + i})$.</p> | 2848790 | Saturday, 6th January 2024, 07:00 pm | 348 | 25% | easy |
656 | Palindromic Sequences | Given an irrational number $\alpha$, let $S_\alpha(n)$ be the sequence $S_\alpha(n)=\lfloor {\alpha \cdot n} \rfloor - \lfloor {\alpha \cdot (n-1)} \rfloor$ for $n \ge 1$.
($\lfloor \cdots \rfloor$ is the floor-function.)
It can be proven that for any irrational $\alpha$ there exist infinitely many values of $n$ such that the subsequence $ \{S_\alpha(1),S_\alpha(2)...S_\alpha(n) \} $ is palindromic.
The first $20$ values of $n$ that give a palindromic subsequence for $\alpha = \sqrt{31}$ are:
$1$, $3$, $5$, $7$, $44$, $81$, $118$, $273$, $3158$, $9201$, $15244$, $21287$, $133765$, $246243$, $358721$, $829920$, $9600319$, $27971037$, $46341755$, $64712473$.
Let $H_g(\alpha)$ be the sum of the first $g$ values of $n$ for which the corresponding subsequence is palindromic.
So $H_{20}(\sqrt{31})=150243655$.
Let $T=\{2,3,5,6,7,8,10,\dots,1000\}$ be the set of positive integers, not exceeding $1000$, excluding perfect squares.
Calculate the sum of $H_{100}(\sqrt \beta)$ for $\beta \in T$. Give the last $15$ digits of your answer. | Given an irrational number $\alpha$, let $S_\alpha(n)$ be the sequence $S_\alpha(n)=\lfloor {\alpha \cdot n} \rfloor - \lfloor {\alpha \cdot (n-1)} \rfloor$ for $n \ge 1$.
($\lfloor \cdots \rfloor$ is the floor-function.)
It can be proven that for any irrational $\alpha$ there exist infinitely many values of $n$ such that the subsequence $ \{S_\alpha(1),S_\alpha(2)...S_\alpha(n) \} $ is palindromic.
The first $20$ values of $n$ that give a palindromic subsequence for $\alpha = \sqrt{31}$ are:
$1$, $3$, $5$, $7$, $44$, $81$, $118$, $273$, $3158$, $9201$, $15244$, $21287$, $133765$, $246243$, $358721$, $829920$, $9600319$, $27971037$, $46341755$, $64712473$.
Let $H_g(\alpha)$ be the sum of the first $g$ values of $n$ for which the corresponding subsequence is palindromic.
So $H_{20}(\sqrt{31})=150243655$.
Let $T=\{2,3,5,6,7,8,10,\dots,1000\}$ be the set of positive integers, not exceeding $1000$, excluding perfect squares.
Calculate the sum of $H_{100}(\sqrt \beta)$ for $\beta \in T$. Give the last $15$ digits of your answer. | <p>
Given an irrational number $\alpha$, let $S_\alpha(n)$ be the sequence $S_\alpha(n)=\lfloor {\alpha \cdot n} \rfloor - \lfloor {\alpha \cdot (n-1)} \rfloor$ for $n \ge 1$.<br/>
($\lfloor \cdots \rfloor$ is the floor-function.)
</p>
<p>
It can be proven that for any irrational $\alpha$ there exist infinitely many values of $n$ such that the subsequence $ \{S_\alpha(1),S_\alpha(2)...S_\alpha(n) \} $ is palindromic.</p>
<p>
The first $20$ values of $n$ that give a palindromic subsequence for $\alpha = \sqrt{31}$ are:
$1$, $3$, $5$, $7$, $44$, $81$, $118$, $273$, $3158$, $9201$, $15244$, $21287$, $133765$, $246243$, $358721$, $829920$, $9600319$, $27971037$, $46341755$, $64712473$.</p>
<p>
Let $H_g(\alpha)$ be the sum of the first $g$ values of $n$ for which the corresponding subsequence is palindromic.<br/>
So $H_{20}(\sqrt{31})=150243655$.
</p><p>
Let $T=\{2,3,5,6,7,8,10,\dots,1000\}$ be the set of positive integers, not exceeding $1000$, excluding perfect squares.<br/>
Calculate the sum of $H_{100}(\sqrt \beta)$ for $\beta \in T$. Give the last $15$ digits of your answer.
</p> | 888873503555187 | Sunday, 17th February 2019, 10:00 am | 261 | 50% | medium |
137 | Fibonacci Golden Nuggets | Consider the infinite polynomial series $A_F(x) = x F_1 + x^2 F_2 + x^3 F_3 + \dots$, where $F_k$ is the $k$th term in the Fibonacci sequence: $1, 1, 2, 3, 5, 8, \dots$; that is, $F_k = F_{k-1} + F_{k-2}$, $F_1 = 1$ and $F_2 = 1$.
For this problem we shall be interested in values of $x$ for which $A_F(x)$ is a positive integer.
Surprisingly$\begin{align*}
A_F(\tfrac{1}{2})
&= (\tfrac{1}{2})\times 1 + (\tfrac{1}{2})^2\times 1 + (\tfrac{1}{2})^3\times 2 + (\tfrac{1}{2})^4\times 3 + (\tfrac{1}{2})^5\times 5 + \cdots \\
&= \tfrac{1}{2} + \tfrac{1}{4} + \tfrac{2}{8} + \tfrac{3}{16} + \tfrac{5}{32} + \cdots \\
&= 2
\end{align*}$
The corresponding values of $x$ for the first five natural numbers are shown below.
$x$$A_F(x)$
$\sqrt{2}-1$$1$
$\tfrac{1}{2}$$2$
$\frac{\sqrt{13}-2}{3}$$3$
$\frac{\sqrt{89}-5}{8}$$4$
$\frac{\sqrt{34}-3}{5}$$5$
We shall call $A_F(x)$ a golden nugget if $x$ is rational, because they become increasingly rarer; for example, the $10$th golden nugget is $74049690$.
Find the $15$th golden nugget. | Consider the infinite polynomial series $A_F(x) = x F_1 + x^2 F_2 + x^3 F_3 + \dots$, where $F_k$ is the $k$th term in the Fibonacci sequence: $1, 1, 2, 3, 5, 8, \dots$; that is, $F_k = F_{k-1} + F_{k-2}$, $F_1 = 1$ and $F_2 = 1$.
For this problem we shall be interested in values of $x$ for which $A_F(x)$ is a positive integer.
Surprisingly$\begin{align*}
A_F(\tfrac{1}{2})
&= (\tfrac{1}{2})\times 1 + (\tfrac{1}{2})^2\times 1 + (\tfrac{1}{2})^3\times 2 + (\tfrac{1}{2})^4\times 3 + (\tfrac{1}{2})^5\times 5 + \cdots \\
&= \tfrac{1}{2} + \tfrac{1}{4} + \tfrac{2}{8} + \tfrac{3}{16} + \tfrac{5}{32} + \cdots \\
&= 2
\end{align*}$
The corresponding values of $x$ for the first five natural numbers are shown below.
$x$$A_F(x)$
$\sqrt{2}-1$$1$
$\tfrac{1}{2}$$2$
$\frac{\sqrt{13}-2}{3}$$3$
$\frac{\sqrt{89}-5}{8}$$4$
$\frac{\sqrt{34}-3}{5}$$5$
We shall call $A_F(x)$ a golden nugget if $x$ is rational, because they become increasingly rarer; for example, the $10$th golden nugget is $74049690$.
Find the $15$th golden nugget. | <p>Consider the infinite polynomial series $A_F(x) = x F_1 + x^2 F_2 + x^3 F_3 + \dots$, where $F_k$ is the $k$th term in the Fibonacci sequence: $1, 1, 2, 3, 5, 8, \dots$; that is, $F_k = F_{k-1} + F_{k-2}$, $F_1 = 1$ and $F_2 = 1$.</p>
<p>For this problem we shall be interested in values of $x$ for which $A_F(x)$ is a positive integer.</p>
<table border="0" cellpadding="0" cellspacing="0" class="p236"><tr><td valign="top">Surprisingly</td><td>$\begin{align*}
A_F(\tfrac{1}{2})
&= (\tfrac{1}{2})\times 1 + (\tfrac{1}{2})^2\times 1 + (\tfrac{1}{2})^3\times 2 + (\tfrac{1}{2})^4\times 3 + (\tfrac{1}{2})^5\times 5 + \cdots \\
&= \tfrac{1}{2} + \tfrac{1}{4} + \tfrac{2}{8} + \tfrac{3}{16} + \tfrac{5}{32} + \cdots \\
&= 2
\end{align*}$</td>
</tr></table>
<p>The corresponding values of $x$ for the first five natural numbers are shown below.</p>
<div class="center">
<table align="center" border="1" cellpadding="2" cellspacing="0"><tr><th>$x$</th><th width="50">$A_F(x)$</th>
</tr><tr><td>$\sqrt{2}-1$</td><td>$1$</td>
</tr><tr><td>$\tfrac{1}{2}$</td><td>$2$</td>
</tr><tr><td>$\frac{\sqrt{13}-2}{3}$</td><td>$3$</td>
</tr><tr><td>$\frac{\sqrt{89}-5}{8}$</td><td>$4$</td>
</tr><tr><td>$\frac{\sqrt{34}-3}{5}$</td><td>$5$</td>
</tr></table></div>
<p>We shall call $A_F(x)$ a golden nugget if $x$ is rational, because they become increasingly rarer; for example, the $10$th golden nugget is $74049690$.</p>
<p>Find the $15$th golden nugget.</p> | 1120149658760 | Friday, 12th January 2007, 06:00 pm | 6255 | 50% | medium |
797 | Cyclogenic Polynomials | A monic polynomial is a single-variable polynomial in which the coefficient of highest degree is equal to $1$.
Define $\mathcal{F}$ to be the set of all monic polynomials with integer coefficients (including the constant polynomial $p(x)=1$). A polynomial $p(x)\in\mathcal{F}$ is cyclogenic if there exists $q(x)\in\mathcal{F}$ and a positive integer $n$ such that $p(x)q(x)=x^n-1$. If $n$ is the smallest such positive integer then $p(x)$ is $n$-cyclogenic.
Define $P_n(x)$ to be the sum of all $n$-cyclogenic polynomials. For example, there exist ten 6-cyclogenic polynomials (which divide $x^6-1$ and no smaller $x^k-1$):
$$\begin{align*}
&x^6-1&&x^4+x^3-x-1&&x^3+2x^2+2x+1&&x^2-x+1\\
&x^5+x^4+x^3+x^2+x+1&&x^4-x^3+x-1&&x^3-2x^2+2x-1\\
&x^5-x^4+x^3-x^2+x-1&&x^4+x^2+1&&x^3+1\end{align*}$$
giving
$$P_6(x)=x^6+2x^5+3x^4+5x^3+2x^2+5x$$
Also define
$$Q_N(x)=\sum_{n=1}^N P_n(x)$$
It's given that
$Q_{10}(x)=x^{10}+3x^9+3x^8+7x^7+8x^6+14x^5+11x^4+18x^3+12x^2+23x$ and $Q_{10}(2) = 5598$.
Find $Q_{10^7}(2)$. Give your answer modulo $1\,000\,000\,007$. | A monic polynomial is a single-variable polynomial in which the coefficient of highest degree is equal to $1$.
Define $\mathcal{F}$ to be the set of all monic polynomials with integer coefficients (including the constant polynomial $p(x)=1$). A polynomial $p(x)\in\mathcal{F}$ is cyclogenic if there exists $q(x)\in\mathcal{F}$ and a positive integer $n$ such that $p(x)q(x)=x^n-1$. If $n$ is the smallest such positive integer then $p(x)$ is $n$-cyclogenic.
Define $P_n(x)$ to be the sum of all $n$-cyclogenic polynomials. For example, there exist ten 6-cyclogenic polynomials (which divide $x^6-1$ and no smaller $x^k-1$):
$$\begin{align*}
&x^6-1&&x^4+x^3-x-1&&x^3+2x^2+2x+1&&x^2-x+1\\
&x^5+x^4+x^3+x^2+x+1&&x^4-x^3+x-1&&x^3-2x^2+2x-1\\
&x^5-x^4+x^3-x^2+x-1&&x^4+x^2+1&&x^3+1\end{align*}$$
giving
$$P_6(x)=x^6+2x^5+3x^4+5x^3+2x^2+5x$$
Also define
$$Q_N(x)=\sum_{n=1}^N P_n(x)$$
It's given that
$Q_{10}(x)=x^{10}+3x^9+3x^8+7x^7+8x^6+14x^5+11x^4+18x^3+12x^2+23x$ and $Q_{10}(2) = 5598$.
Find $Q_{10^7}(2)$. Give your answer modulo $1\,000\,000\,007$. | <p>A <strong>monic polynomial</strong> is a single-variable polynomial in which the coefficient of highest degree is equal to $1$.</p>
<p>Define $\mathcal{F}$ to be the set of all monic polynomials with integer coefficients (including the constant polynomial $p(x)=1$). A polynomial $p(x)\in\mathcal{F}$ is <dfn>cyclogenic</dfn> if there exists $q(x)\in\mathcal{F}$ and a positive integer $n$ such that $p(x)q(x)=x^n-1$. If $n$ is the smallest such positive integer then $p(x)$ is <dfn>$n$-cyclogenic</dfn>.</p>
<p>Define $P_n(x)$ to be the sum of all $n$-cyclogenic polynomials. For example, there exist ten 6-cyclogenic polynomials (which divide $x^6-1$ and no smaller $x^k-1$):</p>
$$\begin{align*}
&x^6-1&&x^4+x^3-x-1&&x^3+2x^2+2x+1&&x^2-x+1\\
&x^5+x^4+x^3+x^2+x+1&&x^4-x^3+x-1&&x^3-2x^2+2x-1\\
&x^5-x^4+x^3-x^2+x-1&&x^4+x^2+1&&x^3+1\end{align*}$$
<p>giving</p>
$$P_6(x)=x^6+2x^5+3x^4+5x^3+2x^2+5x$$
<p>Also define</p>
$$Q_N(x)=\sum_{n=1}^N P_n(x)$$
<p>It's given that
$Q_{10}(x)=x^{10}+3x^9+3x^8+7x^7+8x^6+14x^5+11x^4+18x^3+12x^2+23x$ and $Q_{10}(2) = 5598$.</p>
<p>Find $Q_{10^7}(2)$. Give your answer modulo $1\,000\,000\,007$.</p> | 47722272 | Saturday, 7th May 2022, 08:00 pm | 201 | 50% | medium |
369 | Badugi | In a standard $52$ card deck of playing cards, a set of $4$ cards is a Badugi if it contains $4$ cards with no pairs and no two cards of the same suit.
Let $f(n)$ be the number of ways to choose $n$ cards with a $4$ card subset that is a Badugi. For example, there are $2598960$ ways to choose five cards from a standard $52$ card deck, of which $514800$ contain a $4$ card subset that is a Badugi, so $f(5) = 514800$.
Find $\sum f(n)$ for $4 \le n \le 13$. | In a standard $52$ card deck of playing cards, a set of $4$ cards is a Badugi if it contains $4$ cards with no pairs and no two cards of the same suit.
Let $f(n)$ be the number of ways to choose $n$ cards with a $4$ card subset that is a Badugi. For example, there are $2598960$ ways to choose five cards from a standard $52$ card deck, of which $514800$ contain a $4$ card subset that is a Badugi, so $f(5) = 514800$.
Find $\sum f(n)$ for $4 \le n \le 13$. | <p>In a standard $52$ card deck of playing cards, a set of $4$ cards is a <strong>Badugi</strong> if it contains $4$ cards with no pairs and no two cards of the same suit.</p>
<p>Let $f(n)$ be the number of ways to choose $n$ cards with a $4$ card subset that is a Badugi. For example, there are $2598960$ ways to choose five cards from a standard $52$ card deck, of which $514800$ contain a $4$ card subset that is a Badugi, so $f(5) = 514800$.</p>
<p>Find $\sum f(n)$ for $4 \le n \le 13$.</p> | 862400558448 | Sunday, 29th January 2012, 04:00 am | 527 | 60% | hard |
1 | Multiples of 3 or 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 sum of these multiples is $23$.
Find the sum of all the multiples of $3$ or $5$ below $1000$. | If we list all the natural numbers below $10$ that are multiples of $3$ or $5$, we get $3, 5, 6$ and $9$. The sum of these multiples is $23$.
Find the sum of all the multiples of $3$ or $5$ below $1000$. | <p>If we list all the natural numbers below $10$ that are multiples of $3$ or $5$, we get $3, 5, 6$ and $9$. The sum of these multiples is $23$.</p>
<p>Find the sum of all the multiples of $3$ or $5$ below $1000$.</p> | 233168 | Friday, 5th October 2001, 06:00 pm | 1025612 | 5% | easy |
231 | Prime Factorisation of Binomial Coefficients | The binomial coefficient $\displaystyle \binom {10} 3 = 120$.
$120 = 2^3 \times 3 \times 5 = 2 \times 2 \times 2 \times 3 \times 5$, and $2 + 2 + 2 + 3 + 5 = 14$.
So the sum of the terms in the prime factorisation of $\displaystyle \binom {10} 3$ is $14$.
Find the sum of the terms in the prime factorisation of $\displaystyle \binom {20\,000\,000} {15\,000\,000}$. | The binomial coefficient $\displaystyle \binom {10} 3 = 120$.
$120 = 2^3 \times 3 \times 5 = 2 \times 2 \times 2 \times 3 \times 5$, and $2 + 2 + 2 + 3 + 5 = 14$.
So the sum of the terms in the prime factorisation of $\displaystyle \binom {10} 3$ is $14$.
Find the sum of the terms in the prime factorisation of $\displaystyle \binom {20\,000\,000} {15\,000\,000}$. | <p>The binomial coefficient $\displaystyle \binom {10} 3 = 120$.<br/>
$120 = 2^3 \times 3 \times 5 = 2 \times 2 \times 2 \times 3 \times 5$, and $2 + 2 + 2 + 3 + 5 = 14$.<br/>
So the sum of the terms in the prime factorisation of $\displaystyle \binom {10} 3$ is $14$.
<br/><br/>
Find the sum of the terms in the prime factorisation of $\displaystyle \binom {20\,000\,000} {15\,000\,000}$.
</p> | 7526965179680 | Friday, 6th February 2009, 01:00 pm | 5961 | 40% | medium |
282 | The Ackermann Function | $\def\htmltext#1{\style{font-family:inherit;}{\text{#1}}}$
For non-negative integers $m$, $n$, the Ackermann function $A(m,n)$ is defined as follows:
$$
A(m,n) = \cases{
n+1 &$\htmltext{ if }m=0$\cr
A(m-1,1) &$\htmltext{ if }m>0 \htmltext{ and } n=0$\cr
A(m-1,A(m,n-1)) &$\htmltext{ if }m>0 \htmltext{ and } n>0$\cr
}$$
For example $A(1,0) = 2$, $A(2,2) = 7$ and $A(3,4) = 125$.
Find $\displaystyle\sum_{n=0}^6 A(n,n)$ and give your answer mod $14^8$. | $\def\htmltext#1{\style{font-family:inherit;}{\text{#1}}}$
For non-negative integers $m$, $n$, the Ackermann function $A(m,n)$ is defined as follows:
$$
A(m,n) = \cases{
n+1 &$\htmltext{ if }m=0$\cr
A(m-1,1) &$\htmltext{ if }m>0 \htmltext{ and } n=0$\cr
A(m-1,A(m,n-1)) &$\htmltext{ if }m>0 \htmltext{ and } n>0$\cr
}$$
For example $A(1,0) = 2$, $A(2,2) = 7$ and $A(3,4) = 125$.
Find $\displaystyle\sum_{n=0}^6 A(n,n)$ and give your answer mod $14^8$. | $\def\htmltext#1{\style{font-family:inherit;}{\text{#1}}}$
<p>
For non-negative integers $m$, $n$, the Ackermann function $A(m,n)$ is defined as follows:
$$
A(m,n) = \cases{
n+1 &$\htmltext{ if }m=0$\cr
A(m-1,1) &$\htmltext{ if }m>0 \htmltext{ and } n=0$\cr
A(m-1,A(m,n-1)) &$\htmltext{ if }m>0 \htmltext{ and } n>0$\cr
}$$
</p>
<p>
For example $A(1,0) = 2$, $A(2,2) = 7$ and $A(3,4) = 125$.
</p>
<p>
Find $\displaystyle\sum_{n=0}^6 A(n,n)$ and give your answer mod $14^8$.</p> | 1098988351 | Friday, 12th March 2010, 05:00 pm | 1155 | 70% | hard |
628 | Open Chess Positions | A position in chess is an (orientated) arrangement of chess pieces placed on a chessboard of given size. In the following, we consider all positions in which $n$ pawns are placed on a $n \times n$
board in such a way, that there is a single pawn in every row and every column.
We call such a position an open position, if a rook, starting at the (empty) lower left corner and using only moves towards the right or upwards, can reach the upper right corner without moving onto any field occupied by a pawn.
Let $f(n)$ be the number of open positions for a $n \times n$ chessboard.
For example, $f(3)=2$, illustrated by the two open positions for a $3 \times 3$ chessboard below.
You are also given $f(5)=70$.
Find $f(10^8)$ modulo $1\,008\,691\,207$. | A position in chess is an (orientated) arrangement of chess pieces placed on a chessboard of given size. In the following, we consider all positions in which $n$ pawns are placed on a $n \times n$
board in such a way, that there is a single pawn in every row and every column.
We call such a position an open position, if a rook, starting at the (empty) lower left corner and using only moves towards the right or upwards, can reach the upper right corner without moving onto any field occupied by a pawn.
Let $f(n)$ be the number of open positions for a $n \times n$ chessboard.
For example, $f(3)=2$, illustrated by the two open positions for a $3 \times 3$ chessboard below.
You are also given $f(5)=70$.
Find $f(10^8)$ modulo $1\,008\,691\,207$. | <p>
A position in chess is an (orientated) arrangement of chess pieces placed on a chessboard of given size. In the following, we consider all positions in which $n$ pawns are placed on a $n \times n$
board in such a way, that there is a single pawn in every row and every column.
</p>
<p>
We call such a position an <dfn>open</dfn> position, if a rook, starting at the (empty) lower left corner and using only moves towards the right or upwards, can reach the upper right corner without moving onto any field occupied by a pawn.
</p>
<p>Let $f(n)$ be the number of open positions for a $n \times n$ chessboard.<br/>
For example, $f(3)=2$, illustrated by the two open positions for a $3 \times 3$ chessboard below.
</p>
<table align="center"><tr>
<td><img alt="Open position 1" src="resources/images/0628_chess4.png?1678992054"/></td><td width="60"></td><td><img alt="Open position 2" src="resources/images/0628_chess5.png?1678992054"/></td>
</tr>
</table>
<p>
You are also given $f(5)=70$.</p>
<p>Find $f(10^8)$ modulo $1\,008\,691\,207$.</p> | 210286684 | Sunday, 3rd June 2018, 01:00 am | 870 | 30% | easy |
93 | Arithmetic Expressions | By using each of the digits from the set, $\{1, 2, 3, 4\}$, exactly once, and making use of the four arithmetic operations ($+, -, \times, /$) and brackets/parentheses, it is possible to form different positive integer targets.
For example,
\begin{align}
8 &= (4 \times (1 + 3)) / 2\\
14 &= 4 \times (3 + 1 / 2)\\
19 &= 4 \times (2 + 3) - 1\\
36 &= 3 \times 4 \times (2 + 1)
\end{align}
Note that concatenations of the digits, like $12 + 34$, are not allowed.
Using the set, $\{1, 2, 3, 4\}$, it is possible to obtain thirty-one different target numbers of which $36$ is the maximum, and each of the numbers $1$ to $28$ can be obtained before encountering the first non-expressible number.
Find the set of four distinct digits, $a \lt b \lt c \lt d$, for which the longest set of consecutive positive integers, $1$ to $n$, can be obtained, giving your answer as a string: abcd. | By using each of the digits from the set, $\{1, 2, 3, 4\}$, exactly once, and making use of the four arithmetic operations ($+, -, \times, /$) and brackets/parentheses, it is possible to form different positive integer targets.
For example,
\begin{align}
8 &= (4 \times (1 + 3)) / 2\\
14 &= 4 \times (3 + 1 / 2)\\
19 &= 4 \times (2 + 3) - 1\\
36 &= 3 \times 4 \times (2 + 1)
\end{align}
Note that concatenations of the digits, like $12 + 34$, are not allowed.
Using the set, $\{1, 2, 3, 4\}$, it is possible to obtain thirty-one different target numbers of which $36$ is the maximum, and each of the numbers $1$ to $28$ can be obtained before encountering the first non-expressible number.
Find the set of four distinct digits, $a \lt b \lt c \lt d$, for which the longest set of consecutive positive integers, $1$ to $n$, can be obtained, giving your answer as a string: abcd. | <p>By using each of the digits from the set, $\{1, 2, 3, 4\}$, exactly once, and making use of the four arithmetic operations ($+, -, \times, /$) and brackets/parentheses, it is possible to form different positive integer targets.</p>
<p>For example,</p>
\begin{align}
8 &= (4 \times (1 + 3)) / 2\\
14 &= 4 \times (3 + 1 / 2)\\
19 &= 4 \times (2 + 3) - 1\\
36 &= 3 \times 4 \times (2 + 1)
\end{align}
<p>Note that concatenations of the digits, like $12 + 34$, are not allowed.</p>
<p>Using the set, $\{1, 2, 3, 4\}$, it is possible to obtain thirty-one different target numbers of which $36$ is the maximum, and each of the numbers $1$ to $28$ can be obtained before encountering the first non-expressible number.</p>
<p>Find the set of four distinct digits, $a \lt b \lt c \lt d$, for which the longest set of consecutive positive integers, $1$ to $n$, can be obtained, giving your answer as a string: <i>abcd</i>.</p> | 1258 | Friday, 15th April 2005, 06:00 pm | 13412 | 35% | medium |
303 | Multiples with Small Digits | For a positive integer $n$, define $f(n)$ as the least positive multiple of $n$ that, written in base $10$, uses only digits $\le 2$.
Thus $f(2)=2$, $f(3)=12$, $f(7)=21$, $f(42)=210$, $f(89)=1121222$.
Also, $\sum \limits_{n = 1}^{100} {\dfrac{f(n)}{n}} = 11363107$.
Find $\sum \limits_{n=1}^{10000} {\dfrac{f(n)}{n}}$. | For a positive integer $n$, define $f(n)$ as the least positive multiple of $n$ that, written in base $10$, uses only digits $\le 2$.
Thus $f(2)=2$, $f(3)=12$, $f(7)=21$, $f(42)=210$, $f(89)=1121222$.
Also, $\sum \limits_{n = 1}^{100} {\dfrac{f(n)}{n}} = 11363107$.
Find $\sum \limits_{n=1}^{10000} {\dfrac{f(n)}{n}}$. | <p>
For a positive integer $n$, define $f(n)$ as the least positive multiple of $n$ that, written in base $10$, uses only digits $\le 2$.</p>
<p>Thus $f(2)=2$, $f(3)=12$, $f(7)=21$, $f(42)=210$, $f(89)=1121222$.</p>
<p>Also, $\sum \limits_{n = 1}^{100} {\dfrac{f(n)}{n}} = 11363107$.</p>
<p>
Find $\sum \limits_{n=1}^{10000} {\dfrac{f(n)}{n}}$.
</p> | 1111981904675169 | Saturday, 25th September 2010, 10:00 pm | 3976 | 35% | medium |
364 | Comfortable Distance | There are $N$ seats in a row. $N$ people come after each other to fill the seats according to the following rules:
If there is any seat whose adjacent seat(s) are not occupied take such a seat.
If there is no such seat and there is any seat for which only one adjacent seat is occupied take such a seat.
Otherwise take one of the remaining available seats.
Let $T(N)$ be the number of possibilities that $N$ seats are occupied by $N$ people with the given rules. The following figure shows $T(4)=8$.
We can verify that $T(10) = 61632$ and $T(1\,000) \bmod 100\,000\,007 = 47255094$.
Find $T(1\,000\,000) \bmod 100\,000\,007$. | There are $N$ seats in a row. $N$ people come after each other to fill the seats according to the following rules:
If there is any seat whose adjacent seat(s) are not occupied take such a seat.
If there is no such seat and there is any seat for which only one adjacent seat is occupied take such a seat.
Otherwise take one of the remaining available seats.
Let $T(N)$ be the number of possibilities that $N$ seats are occupied by $N$ people with the given rules. The following figure shows $T(4)=8$.
We can verify that $T(10) = 61632$ and $T(1\,000) \bmod 100\,000\,007 = 47255094$.
Find $T(1\,000\,000) \bmod 100\,000\,007$. | <p>
There are $N$ seats in a row. $N$ people come after each other to fill the seats according to the following rules:
</p><ol type="1"><li>If there is any seat whose adjacent seat(s) are not occupied take such a seat.</li>
<li>If there is no such seat and there is any seat for which only one adjacent seat is occupied take such a seat.</li>
<li>Otherwise take one of the remaining available seats. </li>
</ol>
Let $T(N)$ be the number of possibilities that $N$ seats are occupied by $N$ people with the given rules.<br/> The following figure shows $T(4)=8$.
<div align="center">
<img alt="0364_comf_dist.gif" class="dark_img" src="resources/images/0364_comf_dist.gif?1678992056"/></div>
<p>We can verify that $T(10) = 61632$ and $T(1\,000) \bmod 100\,000\,007 = 47255094$.</p>
<p>Find $T(1\,000\,000) \bmod 100\,000\,007$.</p> | 44855254 | Saturday, 24th December 2011, 01:00 pm | 784 | 50% | medium |
659 | Largest Prime | Consider the sequence $n^2+3$ with $n \ge 1$.
If we write down the first terms of this sequence we get:
$4, 7, 12, 19, 28, 39, 52, 67, 84, 103, 124, 147, 172, 199, 228, 259, 292, 327, 364, \dots$ .
We see that the terms for $n=6$ and $n=7$ ($39$ and $52$) are both divisible by $13$.
In fact $13$ is the largest prime dividing any two successive terms of this sequence.
Let $P(k)$ be the largest prime that divides any two successive terms of the sequence $n^2+k^2$.
Find the last $18$ digits of $\displaystyle \sum_{k=1}^{10\,000\,000} P(k)$. | Consider the sequence $n^2+3$ with $n \ge 1$.
If we write down the first terms of this sequence we get:
$4, 7, 12, 19, 28, 39, 52, 67, 84, 103, 124, 147, 172, 199, 228, 259, 292, 327, 364, \dots$ .
We see that the terms for $n=6$ and $n=7$ ($39$ and $52$) are both divisible by $13$.
In fact $13$ is the largest prime dividing any two successive terms of this sequence.
Let $P(k)$ be the largest prime that divides any two successive terms of the sequence $n^2+k^2$.
Find the last $18$ digits of $\displaystyle \sum_{k=1}^{10\,000\,000} P(k)$. | <p>
Consider the sequence $n^2+3$ with $n \ge 1$. <br/>
If we write down the first terms of this sequence we get:<br/>
$4, 7, 12, 19, 28, 39, 52, 67, 84, 103, 124, 147, 172, 199, 228, 259, 292, 327, 364, \dots$ .<br/>
We see that the terms for $n=6$ and $n=7$ ($39$ and $52$) are both divisible by $13$.<br/>
In fact $13$ is the largest prime dividing any two successive terms of this sequence.
</p>
<p>
Let $P(k)$ be the largest prime that divides any two successive terms of the sequence $n^2+k^2$.
</p>
<p>
Find the last $18$ digits of $\displaystyle \sum_{k=1}^{10\,000\,000} P(k)$.
</p> | 238518915714422000 | Saturday, 2nd March 2019, 04:00 pm | 1087 | 20% | easy |
684 | Inverse Digit Sum | Define $s(n)$ to be the smallest number that has a digit sum of $n$. For example $s(10) = 19$.
Let $\displaystyle S(k) = \sum_{n=1}^k s(n)$. You are given $S(20) = 1074$.
Further let $f_i$ be the Fibonacci sequence defined by $f_0=0, f_1=1$ and $f_i=f_{i-2}+f_{i-1}$ for all $i \ge 2$.
Find $\displaystyle \sum_{i=2}^{90} S(f_i)$. Give your answer modulo $1\,000\,000\,007$. | Define $s(n)$ to be the smallest number that has a digit sum of $n$. For example $s(10) = 19$.
Let $\displaystyle S(k) = \sum_{n=1}^k s(n)$. You are given $S(20) = 1074$.
Further let $f_i$ be the Fibonacci sequence defined by $f_0=0, f_1=1$ and $f_i=f_{i-2}+f_{i-1}$ for all $i \ge 2$.
Find $\displaystyle \sum_{i=2}^{90} S(f_i)$. Give your answer modulo $1\,000\,000\,007$. | <p>Define $s(n)$ to be the smallest number that has a digit sum of $n$. For example $s(10) = 19$.<br>
Let $\displaystyle S(k) = \sum_{n=1}^k s(n)$. You are given $S(20) = 1074$.</br></p>
<p>
Further let $f_i$ be the Fibonacci sequence defined by $f_0=0, f_1=1$ and $f_i=f_{i-2}+f_{i-1}$ for all $i \ge 2$.</p>
<p>
Find $\displaystyle \sum_{i=2}^{90} S(f_i)$. Give your answer modulo $1\,000\,000\,007$.</p> | 922058210 | Saturday, 19th October 2019, 04:00 pm | 3024 | 5% | easy |
564 | Maximal Polygons | A line segment of length $2n-3$ is randomly split into $n$ segments of integer length ($n \ge 3$). In the sequence given by this split, the segments are then used as consecutive sides of a convex $n$-polygon, formed in such a way that its area is maximal. All of the $\binom{2n-4} {n-1}$ possibilities for splitting up the initial line segment occur with the same probability.
Let $E(n)$ be the expected value of the area that is obtained by this procedure.
For example, for $n=3$ the only possible split of the line segment of length $3$ results in three line segments with length $1$, that form an equilateral triangle with an area of $\frac 1 4 \sqrt{3}$. Therefore $E(3)=0.433013$, rounded to $6$ decimal places.
For $n=4$ you can find $4$ different possible splits, each of which is composed of three line segments with length $1$ and one line segment with length $2$. All of these splits lead to the same maximal quadrilateral with an area of $\frac 3 4 \sqrt{3}$, thus $E(4)=1.299038$, rounded to $6$ decimal places.
Let $S(k)=\displaystyle \sum_{n=3}^k E(n)$.
For example, $S(3)=0.433013$, $S(4)=1.732051$, $S(5)=4.604767$ and $S(10)=66.955511$, rounded to $6$ decimal places each.
Find $S(50)$, rounded to $6$ decimal places. | A line segment of length $2n-3$ is randomly split into $n$ segments of integer length ($n \ge 3$). In the sequence given by this split, the segments are then used as consecutive sides of a convex $n$-polygon, formed in such a way that its area is maximal. All of the $\binom{2n-4} {n-1}$ possibilities for splitting up the initial line segment occur with the same probability.
Let $E(n)$ be the expected value of the area that is obtained by this procedure.
For example, for $n=3$ the only possible split of the line segment of length $3$ results in three line segments with length $1$, that form an equilateral triangle with an area of $\frac 1 4 \sqrt{3}$. Therefore $E(3)=0.433013$, rounded to $6$ decimal places.
For $n=4$ you can find $4$ different possible splits, each of which is composed of three line segments with length $1$ and one line segment with length $2$. All of these splits lead to the same maximal quadrilateral with an area of $\frac 3 4 \sqrt{3}$, thus $E(4)=1.299038$, rounded to $6$ decimal places.
Let $S(k)=\displaystyle \sum_{n=3}^k E(n)$.
For example, $S(3)=0.433013$, $S(4)=1.732051$, $S(5)=4.604767$ and $S(10)=66.955511$, rounded to $6$ decimal places each.
Find $S(50)$, rounded to $6$ decimal places. | <p>A line segment of length $2n-3$ is randomly split into $n$ segments of integer length ($n \ge 3$). In the sequence given by this split, the segments are then used as consecutive sides of a convex $n$-polygon, formed in such a way that its area is maximal. All of the $\binom{2n-4} {n-1}$ possibilities for splitting up the initial line segment occur with the same probability. </p>
<p>Let $E(n)$ be the expected value of the area that is obtained by this procedure.<br/>
For example, for $n=3$ the only possible split of the line segment of length $3$ results in three line segments with length $1$, that form an equilateral triangle with an area of $\frac 1 4 \sqrt{3}$. Therefore $E(3)=0.433013$, rounded to $6$ decimal places.<br/>
For $n=4$ you can find $4$ different possible splits, each of which is composed of three line segments with length $1$ and one line segment with length $2$. All of these splits lead to the same maximal quadrilateral with an area of $\frac 3 4 \sqrt{3}$, thus $E(4)=1.299038$, rounded to $6$ decimal places.</p>
<p>Let $S(k)=\displaystyle \sum_{n=3}^k E(n)$.<br/>
For example, $S(3)=0.433013$, $S(4)=1.732051$, $S(5)=4.604767$ and $S(10)=66.955511$, rounded to $6$ decimal places each.</p>
<p>Find $S(50)$, rounded to $6$ decimal places.</p> | 12363.698850 | Sunday, 12th June 2016, 07:00 am | 267 | 60% | hard |
165 | Intersections | A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities:
the segments have zero points, one point, or infinitely many points in common.
Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.
We will call a common point $T$ of two segments $L_1$ and $L_2$ a true intersection point of $L_1$ and $L_2$ if $T$ is the only common point of $L_1$ and $L_2$ and $T$ is an interior point of both segments.
Consider the three segments $L_1$, $L_2$, and $L_3$:
$L_1$: $(27, 44)$ to $(12, 32)$
$L_2$: $(46, 53)$ to $(17, 62)$
$L_3$: $(46, 70)$ to $(22, 40)$
It can be verified that line segments $L_2$ and $L_3$ have a true intersection point. We note that as the one of the end points of $L_3$: $(22,40)$ lies on $L_1$ this is not considered to be a true point of intersection. $L_1$ and $L_2$ have no common point. So among the three line segments, we find one true intersection point.
Now let us do the same for $5000$ line segments. To this end, we generate $20000$ numbers using the so-called "Blum Blum Shub" pseudo-random number generator.
\begin{align}
s_0 &= 290797\\
s_{n + 1} &= s_n \times s_n \pmod{50515093}\\
t_n &= s_n \pmod{500}
\end{align}
To create each line segment, we use four consecutive numbers $t_n$. That is, the first line segment is given by:
$(t_1, t_2)$ to $(t_3, t_4)$.
The first four numbers computed according to the above generator should be: $27$, $144$, $12$ and $232$. The first segment would thus be $(27,144)$ to $(12,232)$.
How many distinct true intersection points are found among the $5000$ line segments? | A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities:
the segments have zero points, one point, or infinitely many points in common.
Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.
We will call a common point $T$ of two segments $L_1$ and $L_2$ a true intersection point of $L_1$ and $L_2$ if $T$ is the only common point of $L_1$ and $L_2$ and $T$ is an interior point of both segments.
Consider the three segments $L_1$, $L_2$, and $L_3$:
$L_1$: $(27, 44)$ to $(12, 32)$
$L_2$: $(46, 53)$ to $(17, 62)$
$L_3$: $(46, 70)$ to $(22, 40)$
It can be verified that line segments $L_2$ and $L_3$ have a true intersection point. We note that as the one of the end points of $L_3$: $(22,40)$ lies on $L_1$ this is not considered to be a true point of intersection. $L_1$ and $L_2$ have no common point. So among the three line segments, we find one true intersection point.
Now let us do the same for $5000$ line segments. To this end, we generate $20000$ numbers using the so-called "Blum Blum Shub" pseudo-random number generator.
\begin{align}
s_0 &= 290797\\
s_{n + 1} &= s_n \times s_n \pmod{50515093}\\
t_n &= s_n \pmod{500}
\end{align}
To create each line segment, we use four consecutive numbers $t_n$. That is, the first line segment is given by:
$(t_1, t_2)$ to $(t_3, t_4)$.
The first four numbers computed according to the above generator should be: $27$, $144$, $12$ and $232$. The first segment would thus be $(27,144)$ to $(12,232)$.
How many distinct true intersection points are found among the $5000$ line segments? | <p>A segment is uniquely defined by its two endpoints.<br/> By considering two line segments in plane geometry there are three possibilities:<br/>
the segments have zero points, one point, or infinitely many points in common.</p>
<p>Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.<br/>
We will call a common point $T$ of two segments $L_1$ and $L_2$ a true intersection point of $L_1$ and $L_2$ if $T$ is the only common point of $L_1$ and $L_2$ and $T$ is an interior point of both segments.
</p>
<p>Consider the three segments $L_1$, $L_2$, and $L_3$:</p>
<ul style="list-style-type:none;">
<li>$L_1$: $(27, 44)$ to $(12, 32)$</li>
<li>$L_2$: $(46, 53)$ to $(17, 62)$</li>
<li>$L_3$: $(46, 70)$ to $(22, 40)$</li></ul>
<p>It can be verified that line segments $L_2$ and $L_3$ have a true intersection point. We note that as the one of the end points of $L_3$: $(22,40)$ lies on $L_1$ this is not considered to be a true point of intersection. $L_1$ and $L_2$ have no common point. So among the three line segments, we find one true intersection point.</p>
<p>Now let us do the same for $5000$ line segments. To this end, we generate $20000$ numbers using the so-called "Blum Blum Shub" pseudo-random number generator.</p>
\begin{align}
s_0 &= 290797\\
s_{n + 1} &= s_n \times s_n \pmod{50515093}\\
t_n &= s_n \pmod{500}
\end{align}
<p>To create each line segment, we use four consecutive numbers $t_n$. That is, the first line segment is given by:</p>
<p>$(t_1, t_2)$ to $(t_3, t_4)$.</p>
<p>The first four numbers computed according to the above generator should be: $27$, $144$, $12$ and $232$. The first segment would thus be $(27,144)$ to $(12,232)$.</p>
<p>How many distinct true intersection points are found among the $5000$ line segments?</p> | 2868868 | Saturday, 27th October 2007, 10:00 am | 2939 | 65% | hard |
752 | Powers of $1+\sqrt 7$ | When $(1+\sqrt 7)$ is raised to an integral power, $n$, we always get a number of the form $(a+b\sqrt 7)$.
We write $(1+\sqrt 7)^n = \alpha(n) + \beta(n)\sqrt 7$.
For a given number $x$ we define $g(x)$ to be the smallest positive integer $n$ such that:
$$\begin{align}
\alpha(n) &\equiv 1 \pmod x\qquad \text{and }\\
\beta(n) &\equiv 0 \pmod x\end{align}
$$
and $g(x) = 0$ if there is no such value of $n$. For example, $g(3) = 0$, $g(5) = 12$.
Further define
$$ G(N) = \sum_{x=2}^N g(x)$$
You are given $G(10^2) = 28891$ and $G(10^3) = 13131583$.
Find $G(10^6)$. | When $(1+\sqrt 7)$ is raised to an integral power, $n$, we always get a number of the form $(a+b\sqrt 7)$.
We write $(1+\sqrt 7)^n = \alpha(n) + \beta(n)\sqrt 7$.
For a given number $x$ we define $g(x)$ to be the smallest positive integer $n$ such that:
$$\begin{align}
\alpha(n) &\equiv 1 \pmod x\qquad \text{and }\\
\beta(n) &\equiv 0 \pmod x\end{align}
$$
and $g(x) = 0$ if there is no such value of $n$. For example, $g(3) = 0$, $g(5) = 12$.
Further define
$$ G(N) = \sum_{x=2}^N g(x)$$
You are given $G(10^2) = 28891$ and $G(10^3) = 13131583$.
Find $G(10^6)$. | <p>
When $(1+\sqrt 7)$ is raised to an integral power, $n$, we always get a number of the form $(a+b\sqrt 7)$.<br/>
We write $(1+\sqrt 7)^n = \alpha(n) + \beta(n)\sqrt 7$.
</p>
<p>
For a given number $x$ we define $g(x)$ to be the smallest positive integer $n$ such that:
$$\begin{align}
\alpha(n) &\equiv 1 \pmod x\qquad \text{and }\\
\beta(n) &\equiv 0 \pmod x\end{align}
$$
and $g(x) = 0$ if there is no such value of $n$. For example, $g(3) = 0$, $g(5) = 12$.
</p>
<p>
Further define
$$ G(N) = \sum_{x=2}^N g(x)$$
You are given $G(10^2) = 28891$ and $G(10^3) = 13131583$.
</p>
<p>
Find $G(10^6)$.
</p> | 5610899769745488 | Sunday, 21st March 2021, 01:00 am | 725 | 25% | easy |
249 | Prime Subset Sums | Let $S = \{2, 3, 5, \dots, 4999\}$ be the set of prime numbers less than $5000$.
Find the number of subsets of $S$, the sum of whose elements is a prime number.
Enter the rightmost $16$ digits as your answer. | Let $S = \{2, 3, 5, \dots, 4999\}$ be the set of prime numbers less than $5000$.
Find the number of subsets of $S$, the sum of whose elements is a prime number.
Enter the rightmost $16$ digits as your answer. | <p>Let $S = \{2, 3, 5, \dots, 4999\}$ be the set of prime numbers less than $5000$.</p>
<p>Find the number of subsets of $S$, the sum of whose elements is a prime number.<br/>
Enter the rightmost $16$ digits as your answer.</p> | 9275262564250418 | Saturday, 13th June 2009, 05:00 am | 2810 | 60% | hard |
127 | abc-hits | The radical of $n$, $\operatorname{rad}(n)$, is the product of distinct prime factors of $n$. For example, $504 = 2^3 \times 3^2 \times 7$, so $\operatorname{rad}(504) = 2 \times 3 \times 7 = 42$.
We shall define the triplet of positive integers $(a, b, c)$ to be an abc-hit if:
$\gcd(a, b) = \gcd(a, c) = \gcd(b, c) = 1$
$a \lt b$
$a + b = c$
$\operatorname{rad}(abc) \lt c$
For example, $(5, 27, 32)$ is an abc-hit, because:
$\gcd(5, 27) = \gcd(5, 32) = \gcd(27, 32) = 1$
$5 \lt 27$
$5 + 27 = 32$
$\operatorname{rad}(4320) = 30 \lt 32$
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for $c \lt 1000$, with $\sum c = 12523$.
Find $\sum c$ for $c \lt 120000$. | The radical of $n$, $\operatorname{rad}(n)$, is the product of distinct prime factors of $n$. For example, $504 = 2^3 \times 3^2 \times 7$, so $\operatorname{rad}(504) = 2 \times 3 \times 7 = 42$.
We shall define the triplet of positive integers $(a, b, c)$ to be an abc-hit if:
$\gcd(a, b) = \gcd(a, c) = \gcd(b, c) = 1$
$a \lt b$
$a + b = c$
$\operatorname{rad}(abc) \lt c$
For example, $(5, 27, 32)$ is an abc-hit, because:
$\gcd(5, 27) = \gcd(5, 32) = \gcd(27, 32) = 1$
$5 \lt 27$
$5 + 27 = 32$
$\operatorname{rad}(4320) = 30 \lt 32$
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for $c \lt 1000$, with $\sum c = 12523$.
Find $\sum c$ for $c \lt 120000$. | <p>The radical of $n$, $\operatorname{rad}(n)$, is the product of distinct prime factors of $n$. For example, $504 = 2^3 \times 3^2 \times 7$, so $\operatorname{rad}(504) = 2 \times 3 \times 7 = 42$.</p>
<p>We shall define the triplet of positive integers $(a, b, c)$ to be an abc-hit if:</p>
<ol><li>$\gcd(a, b) = \gcd(a, c) = \gcd(b, c) = 1$</li>
<li>$a \lt b$</li>
<li>$a + b = c$</li>
<li>$\operatorname{rad}(abc) \lt c$</li>
</ol><p>For example, $(5, 27, 32)$ is an abc-hit, because:</p>
<ol><li>$\gcd(5, 27) = \gcd(5, 32) = \gcd(27, 32) = 1$</li>
<li>$5 \lt 27$</li>
<li>$5 + 27 = 32$</li>
<li>$\operatorname{rad}(4320) = 30 \lt 32$</li>
</ol><p>It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for $c \lt 1000$, with $\sum c = 12523$.</p>
<p>Find $\sum c$ for $c \lt 120000$.</p> | 18407904 | Friday, 1st September 2006, 06:00 pm | 7059 | 50% | medium |
841 | Regular Star Polygons | The regular star polygon $\{p/q\}$, for coprime integers $p,q$ with $p \gt 2q \gt 0$, is a polygon formed from $p$ edges of equal length and equal internal angles, such that tracing the complete polygon wraps $q$ times around the centre. For example, $\{8/3\}$ is illustrated below:
The edges of a regular star polygon intersect one another, dividing the interior into several regions. Define the alternating shading of a regular star polygon to be a selection of such regions to shade, such that every piece of every edge has a shaded region on one side and an unshaded region on the other, with the exterior of the polygon unshaded. For example, the above image shows the alternating shading (in green) of $\{8/3\}$.
Let $A(p, q)$ be the area of the alternating shading of $\{p/q\}$, assuming that its inradius is $1$. (The inradius of a regular polygon, star or otherwise, is the distance from its centre to the midpoint of any of its edges.) For example, in the diagram above, it can be shown that central shaded octagon has area $8(\sqrt{2}-1)$ and each point's shaded kite has area $2(\sqrt{2}-1)$, giving $A(8,3) = 24(\sqrt{2}-1) \approx 9.9411254970$.
You are also given that $A(130021, 50008)\approx 10.9210371479$, rounded to $10$ digits after the decimal point.
Find $\sum_{n=3}^{34} A(F_{n+1},F_{n-1})$, where $F_j$ is the Fibonacci sequence with $F_1=F_2=1$ (so $A(F_{5+1},F_{5-1}) = A(8,3)$). Give your answer rounded to $10$ digits after the decimal point. | The regular star polygon $\{p/q\}$, for coprime integers $p,q$ with $p \gt 2q \gt 0$, is a polygon formed from $p$ edges of equal length and equal internal angles, such that tracing the complete polygon wraps $q$ times around the centre. For example, $\{8/3\}$ is illustrated below:
The edges of a regular star polygon intersect one another, dividing the interior into several regions. Define the alternating shading of a regular star polygon to be a selection of such regions to shade, such that every piece of every edge has a shaded region on one side and an unshaded region on the other, with the exterior of the polygon unshaded. For example, the above image shows the alternating shading (in green) of $\{8/3\}$.
Let $A(p, q)$ be the area of the alternating shading of $\{p/q\}$, assuming that its inradius is $1$. (The inradius of a regular polygon, star or otherwise, is the distance from its centre to the midpoint of any of its edges.) For example, in the diagram above, it can be shown that central shaded octagon has area $8(\sqrt{2}-1)$ and each point's shaded kite has area $2(\sqrt{2}-1)$, giving $A(8,3) = 24(\sqrt{2}-1) \approx 9.9411254970$.
You are also given that $A(130021, 50008)\approx 10.9210371479$, rounded to $10$ digits after the decimal point.
Find $\sum_{n=3}^{34} A(F_{n+1},F_{n-1})$, where $F_j$ is the Fibonacci sequence with $F_1=F_2=1$ (so $A(F_{5+1},F_{5-1}) = A(8,3)$). Give your answer rounded to $10$ digits after the decimal point. | <p>The regular star polygon $\{p/q\}$, for coprime integers $p,q$ with $p \gt 2q \gt 0$, is a polygon formed from $p$ edges of equal length and equal internal angles, such that tracing the complete polygon wraps $q$ times around the centre. For example, $\{8/3\}$ is illustrated below:</p>
<div align="center"><img alt="{8/3}" height="250" src="resources/images/0841_star_polygon_8_3.png?1680515338"/></div>
<p>The edges of a regular star polygon intersect one another, dividing the interior into several regions. Define the <dfn>alternating shading</dfn> of a regular star polygon to be a selection of such regions to shade, such that every piece of every edge has a shaded region on one side and an unshaded region on the other, with the exterior of the polygon unshaded. For example, the above image shows the alternating shading (in green) of $\{8/3\}$.</p>
<p>Let $A(p, q)$ be the area of the alternating shading of $\{p/q\}$, assuming that its inradius is $1$. (The <strong>inradius</strong> of a regular polygon, star or otherwise, is the distance from its centre to the midpoint of any of its edges.) For example, in the diagram above, it can be shown that central shaded octagon has area $8(\sqrt{2}-1)$ and each point's shaded kite has area $2(\sqrt{2}-1)$, giving $A(8,3) = 24(\sqrt{2}-1) \approx 9.9411254970$.</p>
<p>You are also given that $A(130021, 50008)\approx 10.9210371479$, rounded to $10$ digits after the decimal point.</p>
<p>Find $\sum_{n=3}^{34} A(F_{n+1},F_{n-1})$, where $F_j$ is the Fibonacci sequence with $F_1=F_2=1$ (so $A(F_{5+1},F_{5-1}) = A(8,3)$). Give your answer rounded to $10$ digits after the decimal point.</p> | 381.7860132854 | Sunday, 30th April 2023, 05:00 am | 203 | 45% | medium |
329 | Prime Frog | Susan has a prime frog.
Her frog is jumping around over $500$ squares numbered $1$ to $500$.
He can only jump one square to the left or to the right, with equal probability, and he cannot jump outside the range $[1;500]$.(if it lands at either end, it automatically jumps to the only available square on the next move.)
When he is on a square with a prime number on it, he croaks 'P' (PRIME) with probability $2/3$ or 'N' (NOT PRIME) with probability $1/3$ just before jumping to the next square.
When he is on a square with a number on it that is not a prime he croaks 'P' with probability $1/3$ or 'N' with probability $2/3$ just before jumping to the next square.
Given that the frog's starting position is random with the same probability for every square, and given that she listens to his first $15$ croaks, what is the probability that she hears the sequence PPPPNNPPPNPPNPN?
Give your answer as a fraction $p/q$ in reduced form. | Susan has a prime frog.
Her frog is jumping around over $500$ squares numbered $1$ to $500$.
He can only jump one square to the left or to the right, with equal probability, and he cannot jump outside the range $[1;500]$.(if it lands at either end, it automatically jumps to the only available square on the next move.)
When he is on a square with a prime number on it, he croaks 'P' (PRIME) with probability $2/3$ or 'N' (NOT PRIME) with probability $1/3$ just before jumping to the next square.
When he is on a square with a number on it that is not a prime he croaks 'P' with probability $1/3$ or 'N' with probability $2/3$ just before jumping to the next square.
Given that the frog's starting position is random with the same probability for every square, and given that she listens to his first $15$ croaks, what is the probability that she hears the sequence PPPPNNPPPNPPNPN?
Give your answer as a fraction $p/q$ in reduced form. | <p>Susan has a prime frog.<br/>
Her frog is jumping around over $500$ squares numbered $1$ to $500$.
He can only jump one square to the left or to the right, with equal probability, and he cannot jump outside the range $[1;500]$.<br/>(if it lands at either end, it automatically jumps to the only available square on the next move.)
</p>
<p>
When he is on a square with a prime number on it, he croaks 'P' (PRIME) with probability $2/3$ or 'N' (NOT PRIME) with probability $1/3$ just before jumping to the next square.<br/>
When he is on a square with a number on it that is not a prime he croaks 'P' with probability $1/3$ or 'N' with probability $2/3$ just before jumping to the next square.
</p>
<p>
Given that the frog's starting position is random with the same probability for every square, and given that she listens to his first $15$ croaks, what is the probability that she hears the sequence PPPPNNPPPNPPNPN?
</p>
Give your answer as a fraction $p/q$ in reduced form. | 199740353/29386561536000 | Sunday, 20th March 2011, 01:00 am | 2762 | 25% | easy |
351 | Hexagonal Orchards | A hexagonal orchard of order $n$ is a triangular lattice made up of points within a regular hexagon with side $n$. The following is an example of a hexagonal orchard of order $5$:
Highlighted in green are the points which are hidden from the center by a point closer to it. It can be seen that for a hexagonal orchard of order $5$, $30$ points are hidden from the center.
Let $H(n)$ be the number of points hidden from the center in a hexagonal orchard of order $n$.
$H(5) = 30$. $H(10) = 138$. $H(1\,000) = 1177848$.
Find $H(100\,000\,000)$. | A hexagonal orchard of order $n$ is a triangular lattice made up of points within a regular hexagon with side $n$. The following is an example of a hexagonal orchard of order $5$:
Highlighted in green are the points which are hidden from the center by a point closer to it. It can be seen that for a hexagonal orchard of order $5$, $30$ points are hidden from the center.
Let $H(n)$ be the number of points hidden from the center in a hexagonal orchard of order $n$.
$H(5) = 30$. $H(10) = 138$. $H(1\,000) = 1177848$.
Find $H(100\,000\,000)$. | <p>A <dfn>hexagonal orchard</dfn> of order $n$ is a triangular lattice made up of points within a regular hexagon with side $n$. The following is an example of a hexagonal orchard of order $5$:
</p>
<div align="center">
<img alt="0351_hexorchard.png" class="dark_img" src="resources/images/0351_hexorchard.png?1678992052"/><br/></div>
<p>
Highlighted in green are the points which are hidden from the center by a point closer to it. It can be seen that for a hexagonal orchard of order $5$, $30$ points are hidden from the center.
</p>
<p>
Let $H(n)$ be the number of points hidden from the center in a hexagonal orchard of order $n$.
</p>
<p>
$H(5) = 30$. $H(10) = 138$. $H(1\,000) = 1177848$.
</p>
<p>
Find $H(100\,000\,000)$.
</p> | 11762187201804552 | Saturday, 17th September 2011, 10:00 pm | 2850 | 25% | easy |
806 | Nim on Towers of Hanoi | This problem combines the game of Nim with the Towers of Hanoi. For a brief introduction to the rules of these games, please refer to Problem 301 and Problem 497, respectively.
The unique shortest solution to the Towers of Hanoi problem with $n$ disks and $3$ pegs requires $2^n-1$ moves. Number the positions in the solution from index 0 (starting position, all disks on the first peg) to index $2^n-1$ (final position, all disks on the third peg).
Each of these $2^n$ positions can be considered as the starting configuration for a game of Nim, in which two players take turns to select a peg and remove any positive number of disks from it. The winner is the player who removes the last disk.
We define $f(n)$ to be the sum of the indices of those positions for which, when considered as a Nim game, the first player will lose (assuming an optimal strategy from both players).
For $n=4$, the indices of losing positions in the shortest solution are 3,6,9 and 12. So we have $f(4) = 30$.
You are given that $f(10) = 67518$.
Find $f(10^5)$. Give your answer modulo $1\,000\,000\,007$. | This problem combines the game of Nim with the Towers of Hanoi. For a brief introduction to the rules of these games, please refer to Problem 301 and Problem 497, respectively.
The unique shortest solution to the Towers of Hanoi problem with $n$ disks and $3$ pegs requires $2^n-1$ moves. Number the positions in the solution from index 0 (starting position, all disks on the first peg) to index $2^n-1$ (final position, all disks on the third peg).
Each of these $2^n$ positions can be considered as the starting configuration for a game of Nim, in which two players take turns to select a peg and remove any positive number of disks from it. The winner is the player who removes the last disk.
We define $f(n)$ to be the sum of the indices of those positions for which, when considered as a Nim game, the first player will lose (assuming an optimal strategy from both players).
For $n=4$, the indices of losing positions in the shortest solution are 3,6,9 and 12. So we have $f(4) = 30$.
You are given that $f(10) = 67518$.
Find $f(10^5)$. Give your answer modulo $1\,000\,000\,007$. | <p>This problem combines the game of Nim with the Towers of Hanoi. For a brief introduction to the rules of these games, please refer to <a href="problem=301">Problem 301</a> and <a href="problem=497">Problem 497</a>, respectively.</p>
<p>The unique shortest solution to the Towers of Hanoi problem with $n$ disks and $3$ pegs requires $2^n-1$ moves. Number the positions in the solution from index 0 (starting position, all disks on the first peg) to index $2^n-1$ (final position, all disks on the third peg).</p>
<p>Each of these $2^n$ positions can be considered as the starting configuration for a game of Nim, in which two players take turns to select a peg and remove any positive number of disks from it. The winner is the player who removes the last disk.</p>
<p>We define $f(n)$ to be the sum of the indices of those positions for which, when considered as a Nim game, the first player will lose (assuming an optimal strategy from both players).</p>
<p>For $n=4$, the indices of losing positions in the shortest solution are 3,6,9 and 12. So we have $f(4) = 30$.</p>
<p>You are given that $f(10) = 67518$.</p>
<p>Find $f(10^5)$. Give your answer modulo $1\,000\,000\,007$.</p> | 94394343 | Saturday, 9th July 2022, 11:00 pm | 143 | 100% | hard |
706 | $3$-Like Numbers | For a positive integer $n$, define $f(n)$ to be the number of non-empty substrings of $n$ that are divisible by $3$. For example, the string "2573" has $10$ non-empty substrings, three of which represent numbers that are divisible by $3$, namely $57$, $573$ and $3$. So $f(2573) = 3$.
If $f(n)$ is divisible by $3$ then we say that $n$ is $3$-like.
Define $F(d)$ to be how many $d$ digit numbers are $3$-like. For example, $F(2) = 30$ and $F(6) = 290898$.
Find $F(10^5)$. Give your answer modulo $1\,000\,000\,007$. | For a positive integer $n$, define $f(n)$ to be the number of non-empty substrings of $n$ that are divisible by $3$. For example, the string "2573" has $10$ non-empty substrings, three of which represent numbers that are divisible by $3$, namely $57$, $573$ and $3$. So $f(2573) = 3$.
If $f(n)$ is divisible by $3$ then we say that $n$ is $3$-like.
Define $F(d)$ to be how many $d$ digit numbers are $3$-like. For example, $F(2) = 30$ and $F(6) = 290898$.
Find $F(10^5)$. Give your answer modulo $1\,000\,000\,007$. | <p>
For a positive integer $n$, define $f(n)$ to be the number of non-empty substrings of $n$ that are divisible by $3$. For example, the string "2573" has $10$ non-empty substrings, three of which represent numbers that are divisible by $3$, namely $57$, $573$ and $3$. So $f(2573) = 3$.
</p>
<p>
If $f(n)$ is divisible by $3$ then we say that $n$ is <dfn>$3$-like</dfn>.
</p>
<p>
Define $F(d)$ to be how many $d$ digit numbers are $3$-like. For example, $F(2) = 30$ and $F(6) = 290898$.
</p>
<p>
Find $F(10^5)$. Give your answer modulo $1\,000\,000\,007$.
</p> | 884837055 | Sunday, 15th March 2020, 07:00 am | 634 | 25% | easy |
499 | St. Petersburg Lottery | A gambler decides to participate in a special lottery. In this lottery the gambler plays a series of one or more games.
Each game costs $m$ pounds to play and starts with an initial pot of $1$ pound. The gambler flips an unbiased coin. Every time a head appears, the pot is doubled and the gambler continues. When a tail appears, the game ends and the gambler collects the current value of the pot. The gambler is certain to win at least $1$ pound, the starting value of the pot, at the cost of $m$ pounds, the initial fee.
The game ends if the gambler's fortune falls below $m$ pounds.
Let $p_m(s)$ denote the probability that the gambler will never run out of money in this lottery given an initial fortune $s$ and the cost per game $m$.
For example $p_2(2) \approx 0.2522$, $p_2(5) \approx 0.6873$ and $p_6(10\,000) \approx 0.9952$ (note: $p_m(s) = 0$ for $s \lt m$).
Find $p_{15}(10^9)$ and give your answer rounded to $7$ decimal places behind the decimal point in the form 0.abcdefg. | A gambler decides to participate in a special lottery. In this lottery the gambler plays a series of one or more games.
Each game costs $m$ pounds to play and starts with an initial pot of $1$ pound. The gambler flips an unbiased coin. Every time a head appears, the pot is doubled and the gambler continues. When a tail appears, the game ends and the gambler collects the current value of the pot. The gambler is certain to win at least $1$ pound, the starting value of the pot, at the cost of $m$ pounds, the initial fee.
The game ends if the gambler's fortune falls below $m$ pounds.
Let $p_m(s)$ denote the probability that the gambler will never run out of money in this lottery given an initial fortune $s$ and the cost per game $m$.
For example $p_2(2) \approx 0.2522$, $p_2(5) \approx 0.6873$ and $p_6(10\,000) \approx 0.9952$ (note: $p_m(s) = 0$ for $s \lt m$).
Find $p_{15}(10^9)$ and give your answer rounded to $7$ decimal places behind the decimal point in the form 0.abcdefg. | <p>A gambler decides to participate in a special lottery. In this lottery the gambler plays a series of one or more games.<br/>
Each game costs $m$ pounds to play and starts with an initial pot of $1$ pound. The gambler flips an unbiased coin. Every time a head appears, the pot is doubled and the gambler continues. When a tail appears, the game ends and the gambler collects the current value of the pot. The gambler is certain to win at least $1$ pound, the starting value of the pot, at the cost of $m$ pounds, the initial fee.</p>
<p>The game ends if the gambler's fortune falls below $m$ pounds.
Let $p_m(s)$ denote the probability that the gambler will never run out of money in this lottery given an initial fortune $s$ and the cost per game $m$.<br/>
For example $p_2(2) \approx 0.2522$, $p_2(5) \approx 0.6873$ and $p_6(10\,000) \approx 0.9952$ (note: $p_m(s) = 0$ for $s \lt m$).</p>
<p>Find $p_{15}(10^9)$ and give your answer rounded to $7$ decimal places behind the decimal point in the form 0.abcdefg.</p> | 0.8660312 | Sunday, 25th January 2015, 10:00 am | 385 | 100% | hard |
307 | Chip Defects | $k$ defects are randomly distributed amongst $n$ integrated-circuit chips produced by a factory (any number of defects may be found on a chip and each defect is independent of the other defects).
Let $p(k, n)$ represent the probability that there is a chip with at least $3$ defects.
For instance $p(3,7) \approx 0.0204081633$.
Find $p(20\,000, 1\,000\,000)$ and give your answer rounded to $10$ decimal places in the form 0.abcdefghij. | $k$ defects are randomly distributed amongst $n$ integrated-circuit chips produced by a factory (any number of defects may be found on a chip and each defect is independent of the other defects).
Let $p(k, n)$ represent the probability that there is a chip with at least $3$ defects.
For instance $p(3,7) \approx 0.0204081633$.
Find $p(20\,000, 1\,000\,000)$ and give your answer rounded to $10$ decimal places in the form 0.abcdefghij. | <p>
$k$ defects are randomly distributed amongst $n$ integrated-circuit chips produced by a factory (any number of defects may be found on a chip and each defect is independent of the other defects).
</p>
<p>
Let $p(k, n)$ represent the probability that there is a chip with at least $3$ defects.<br/>
For instance $p(3,7) \approx 0.0204081633$.
</p>
<p>
Find $p(20\,000, 1\,000\,000)$ and give your answer rounded to $10$ decimal places in the form 0.abcdefghij.
</p> | 0.7311720251 | Sunday, 24th October 2010, 10:00 am | 1840 | 40% | medium |
421 | Prime Factors of $n^{15}+1$ | Numbers of the form $n^{15}+1$ are composite for every integer $n \gt 1$.
For positive integers $n$ and $m$ let $s(n,m)$ be defined as the sum of the distinct prime factors of $n^{15}+1$ not exceeding $m$.
E.g. $2^{15}+1 = 3 \times 3 \times 11 \times 331$.
So $s(2,10) = 3$ and $s(2,1000) = 3+11+331 = 345$.
Also $10^{15}+1 = 7 \times 11 \times 13 \times 211 \times 241 \times 2161 \times 9091$.
So $s(10,100) = 31$ and $s(10,1000) = 483$.
Find $\sum s(n,10^8)$ for $1 \leq n \leq 10^{11}$. | Numbers of the form $n^{15}+1$ are composite for every integer $n \gt 1$.
For positive integers $n$ and $m$ let $s(n,m)$ be defined as the sum of the distinct prime factors of $n^{15}+1$ not exceeding $m$.
E.g. $2^{15}+1 = 3 \times 3 \times 11 \times 331$.
So $s(2,10) = 3$ and $s(2,1000) = 3+11+331 = 345$.
Also $10^{15}+1 = 7 \times 11 \times 13 \times 211 \times 241 \times 2161 \times 9091$.
So $s(10,100) = 31$ and $s(10,1000) = 483$.
Find $\sum s(n,10^8)$ for $1 \leq n \leq 10^{11}$. | <p>
Numbers of the form $n^{15}+1$ are composite for every integer $n \gt 1$.<br/>
For positive integers $n$ and $m$ let $s(n,m)$ be defined as the sum of the <i>distinct</i> prime factors of $n^{15}+1$ not exceeding $m$.
</p>
E.g. $2^{15}+1 = 3 \times 3 \times 11 \times 331$.<br/>
So $s(2,10) = 3$ and $s(2,1000) = 3+11+331 = 345$.<br/><br/>
Also $10^{15}+1 = 7 \times 11 \times 13 \times 211 \times 241 \times 2161 \times 9091$.<br/>
So $s(10,100) = 31$ and $s(10,1000) = 483$.<br/><p>
Find $\sum s(n,10^8)$ for $1 \leq n \leq 10^{11}$.
</p> | 2304215802083466198 | Sunday, 31st March 2013, 04:00 am | 745 | 50% | medium |
803 | Pseudorandom Sequence | Rand48 is a pseudorandom number generator used by some programming languages. It generates a sequence from any given integer $0 \le a_0 < 2^{48}$ using the rule $a_n = (25214903917 \cdot a_{n - 1} + 11) \bmod 2^{48}$.
Let $b_n = \lfloor a_n / 2^{16} \rfloor \bmod 52$.
The sequence $b_0, b_1, \dots$ is translated to an infinite string $c = c_0c_1\dots$ via the rule:
$0 \rightarrow$ a, $1\rightarrow$ b, $\dots$, $25 \rightarrow$ z, $26 \rightarrow$ A, $27 \rightarrow$ B, $\dots$, $51 \rightarrow$ Z.
For example, if we choose $a_0 = 123456$, then the string $c$ starts with: "bQYicNGCY$\dots$".
Moreover, starting from index $100$, we encounter the substring "RxqLBfWzv" for the first time.
Alternatively, if $c$ starts with "EULERcats$\dots$", then $a_0$ must be $78580612777175$.
Now suppose that the string $c$ starts with "PuzzleOne$\dots$".
Find the starting index of the first occurrence of the substring "LuckyText" in $c$. | Rand48 is a pseudorandom number generator used by some programming languages. It generates a sequence from any given integer $0 \le a_0 < 2^{48}$ using the rule $a_n = (25214903917 \cdot a_{n - 1} + 11) \bmod 2^{48}$.
Let $b_n = \lfloor a_n / 2^{16} \rfloor \bmod 52$.
The sequence $b_0, b_1, \dots$ is translated to an infinite string $c = c_0c_1\dots$ via the rule:
$0 \rightarrow$ a, $1\rightarrow$ b, $\dots$, $25 \rightarrow$ z, $26 \rightarrow$ A, $27 \rightarrow$ B, $\dots$, $51 \rightarrow$ Z.
For example, if we choose $a_0 = 123456$, then the string $c$ starts with: "bQYicNGCY$\dots$".
Moreover, starting from index $100$, we encounter the substring "RxqLBfWzv" for the first time.
Alternatively, if $c$ starts with "EULERcats$\dots$", then $a_0$ must be $78580612777175$.
Now suppose that the string $c$ starts with "PuzzleOne$\dots$".
Find the starting index of the first occurrence of the substring "LuckyText" in $c$. | <p>
<b>Rand48</b> is a pseudorandom number generator used by some programming languages. It generates a sequence from any given integer $0 \le a_0 < 2^{48}$ using the rule $a_n = (25214903917 \cdot a_{n - 1} + 11) \bmod 2^{48}$.
</p>
<p>
Let $b_n = \lfloor a_n / 2^{16} \rfloor \bmod 52$.
The sequence $b_0, b_1, \dots$ is translated to an infinite string $c = c_0c_1\dots$ via the rule:<br/>
$0 \rightarrow$ a, $1\rightarrow$ b, $\dots$, $25 \rightarrow$ z, $26 \rightarrow$ A, $27 \rightarrow$ B, $\dots$, $51 \rightarrow$ Z.
</p>
<p>
For example, if we choose $a_0 = 123456$, then the string $c$ starts with: "bQYicNGCY$\dots$".<br/>
Moreover, starting from index $100$, we encounter the substring "RxqLBfWzv" for the first time.
</p>
<p>
Alternatively, if $c$ starts with "EULERcats$\dots$", then $a_0$ must be $78580612777175$.
</p>
<p>
Now suppose that the string $c$ starts with "PuzzleOne$\dots$".<br/>
Find the starting index of the first occurrence of the substring "LuckyText" in $c$.
</p> | 9300900470636 | Saturday, 18th June 2022, 02:00 pm | 239 | 55% | medium |
920 | Tau Numbers | For a positive integer $n$ we define $\tau(n)$ to be the count of the divisors of $n$. For example, the divisors of $12$ are $\{1,2,3,4,6,12\}$ and so $\tau(12) = 6$.
A positive integer $n$ is a tau number if it is divisible by $\tau(n)$. For example $\tau(12)=6$ and $6$ divides $12$ so $12$ is a tau number.
Let $m(k)$ be the smallest tau number $x$ such that $\tau(x) = k$. For example, $m(8) = 24$, $m(12)=60$ and $m(16)=384$.
Further define $M(n)$ to be the sum of all $m(k)$ whose values do not exceed $10^n$. You are given $M(3) = 3189$.
Find $M(16)$. | For a positive integer $n$ we define $\tau(n)$ to be the count of the divisors of $n$. For example, the divisors of $12$ are $\{1,2,3,4,6,12\}$ and so $\tau(12) = 6$.
A positive integer $n$ is a tau number if it is divisible by $\tau(n)$. For example $\tau(12)=6$ and $6$ divides $12$ so $12$ is a tau number.
Let $m(k)$ be the smallest tau number $x$ such that $\tau(x) = k$. For example, $m(8) = 24$, $m(12)=60$ and $m(16)=384$.
Further define $M(n)$ to be the sum of all $m(k)$ whose values do not exceed $10^n$. You are given $M(3) = 3189$.
Find $M(16)$. | <p>For a positive integer $n$ we define $\tau(n)$ to be the count of the divisors of $n$. For example, the divisors of $12$ are $\{1,2,3,4,6,12\}$ and so $\tau(12) = 6$.</p>
<p>
A positive integer $n$ is a <b>tau number</b> if it is divisible by $\tau(n)$. For example $\tau(12)=6$ and $6$ divides $12$ so $12$ is a tau number.</p>
<p>
Let $m(k)$ be the smallest tau number $x$ such that $\tau(x) = k$. For example, $m(8) = 24$, $m(12)=60$ and $m(16)=384$.</p>
<p>
Further define $M(n)$ to be the sum of all $m(k)$ whose values do not exceed $10^n$. You are given $M(3) = 3189$.</p>
<p>
Find $M(16)$.</p> | 1154027691000533893 | Sunday, 8th December 2024, 10:00 am | 245 | 30% | easy |
186 | Connectedness of a Network | Here are the records from a busy telephone system with one million users:
RecNrCallerCalled
$1$$200007$$100053$$2$$600183$$500439$$3$$600863$$701497$$\cdots$$\cdots$$\cdots$
The telephone number of the caller and the called number in record $n$ are $\operatorname{Caller}(n) = S_{2n-1}$ and $\operatorname{Called}(n) = S_{2n}$ where $S_{1,2,3,\dots}$ come from the "Lagged Fibonacci Generator":
For $1 \le k \le 55$, $S_k = [100003 - 200003k + 300007k^3] \pmod{1000000}$.
For $56 \le k$, $S_k = [S_{k-24} + S_{k-55}] \pmod{1000000}$.
If $\operatorname{Caller}(n) = \operatorname{Called}(n)$ then the user is assumed to have misdialled and the call fails; otherwise the call is successful.
From the start of the records, we say that any pair of users $X$ and $Y$ are friends if $X$ calls $Y$ or vice-versa. Similarly, $X$ is a friend of a friend of $Z$ if $X$ is a friend of $Y$ and $Y$ is a friend of $Z$; and so on for longer chains.
The Prime Minister's phone number is $524287$. After how many successful calls, not counting misdials, will $99\%$ of the users (including the PM) be a friend, or a friend of a friend etc., of the Prime Minister? | Here are the records from a busy telephone system with one million users:
RecNrCallerCalled
$1$$200007$$100053$$2$$600183$$500439$$3$$600863$$701497$$\cdots$$\cdots$$\cdots$
The telephone number of the caller and the called number in record $n$ are $\operatorname{Caller}(n) = S_{2n-1}$ and $\operatorname{Called}(n) = S_{2n}$ where $S_{1,2,3,\dots}$ come from the "Lagged Fibonacci Generator":
For $1 \le k \le 55$, $S_k = [100003 - 200003k + 300007k^3] \pmod{1000000}$.
For $56 \le k$, $S_k = [S_{k-24} + S_{k-55}] \pmod{1000000}$.
If $\operatorname{Caller}(n) = \operatorname{Called}(n)$ then the user is assumed to have misdialled and the call fails; otherwise the call is successful.
From the start of the records, we say that any pair of users $X$ and $Y$ are friends if $X$ calls $Y$ or vice-versa. Similarly, $X$ is a friend of a friend of $Z$ if $X$ is a friend of $Y$ and $Y$ is a friend of $Z$; and so on for longer chains.
The Prime Minister's phone number is $524287$. After how many successful calls, not counting misdials, will $99\%$ of the users (including the PM) be a friend, or a friend of a friend etc., of the Prime Minister? | <p>Here are the records from a busy telephone system with one million users:</p>
<div class="center">
<table class="grid" style="margin:0 auto;"><tr><th>RecNr</th><th align="center" width="60">Caller</th><th align="center" width="60">Called</th></tr>
<tr><td align="center">$1$</td><td align="center">$200007$</td><td align="center">$100053$</td></tr><tr><td align="center">$2$</td><td align="center">$600183$</td><td align="center">$500439$</td></tr><tr><td align="center">$3$</td><td align="center">$600863$</td><td align="center">$701497$</td></tr><tr><td align="center">$\cdots$</td><td align="center">$\cdots$</td><td align="center">$\cdots$</td></tr></table></div>
<p>The telephone number of the caller and the called number in record $n$ are $\operatorname{Caller}(n) = S_{2n-1}$ and $\operatorname{Called}(n) = S_{2n}$ where $S_{1,2,3,\dots}$ come from the "Lagged Fibonacci Generator":</p>
<p>For $1 \le k \le 55$, $S_k = [100003 - 200003k + 300007k^3] \pmod{1000000}$.<br/>
For $56 \le k$, $S_k = [S_{k-24} + S_{k-55}] \pmod{1000000}$.</p>
<p>If $\operatorname{Caller}(n) = \operatorname{Called}(n)$ then the user is assumed to have misdialled and the call fails; otherwise the call is successful.</p>
<p>From the start of the records, we say that any pair of users $X$ and $Y$ are friends if $X$ calls $Y$ or vice-versa. Similarly, $X$ is a friend of a friend of $Z$ if $X$ is a friend of $Y$ and $Y$ is a friend of $Z$; and so on for longer chains.</p>
<p>The Prime Minister's phone number is $524287$. After how many successful calls, not counting misdials, will $99\%$ of the users (including the PM) be a friend, or a friend of a friend etc., of the Prime Minister?</p> | 2325629 | Saturday, 15th March 2008, 05:00 am | 3184 | 60% | hard |
275 | Balanced Sculptures | Let us define a balanced sculpture of order $n$ as follows:
A polyominoAn arrangement of identical squares connected through shared edges; holes are allowed. made up of $n + 1$ tiles known as the blocks ($n$ tiles) and the plinth (remaining tile);
the plinth has its centre at position ($x = 0, y = 0$);
the blocks have $y$-coordinates greater than zero (so the plinth is the unique lowest tile);
the centre of mass of all the blocks, combined, has $x$-coordinate equal to zero.
When counting the sculptures, any arrangements which are simply reflections about the $y$-axis, are not counted as distinct. For example, the $18$ balanced sculptures of order $6$ are shown below; note that each pair of mirror images (about the $y$-axis) is counted as one sculpture:
There are $964$ balanced sculptures of order $10$ and $360505$ of order $15$.How many balanced sculptures are there of order $18$? | Let us define a balanced sculpture of order $n$ as follows:
A polyominoAn arrangement of identical squares connected through shared edges; holes are allowed. made up of $n + 1$ tiles known as the blocks ($n$ tiles) and the plinth (remaining tile);
the plinth has its centre at position ($x = 0, y = 0$);
the blocks have $y$-coordinates greater than zero (so the plinth is the unique lowest tile);
the centre of mass of all the blocks, combined, has $x$-coordinate equal to zero.
When counting the sculptures, any arrangements which are simply reflections about the $y$-axis, are not counted as distinct. For example, the $18$ balanced sculptures of order $6$ are shown below; note that each pair of mirror images (about the $y$-axis) is counted as one sculpture:
There are $964$ balanced sculptures of order $10$ and $360505$ of order $15$.How many balanced sculptures are there of order $18$? | <p>Let us define a <dfn>balanced sculpture</dfn> of order $n$ as follows:
</p><ul><li>A <strong class="tooltip">polyomino<span class="tooltiptext">An arrangement of identical squares connected through shared edges; holes are allowed.</span></strong> made up of $n + 1$ tiles known as the <dfn>blocks</dfn> ($n$ tiles)<br/> and the <dfn>plinth</dfn> (remaining tile);</li>
<li>the plinth has its centre at position ($x = 0, y = 0$);</li>
<li>the blocks have $y$-coordinates greater than zero (so the plinth is the unique lowest tile);</li>
<li>the centre of mass of all the blocks, combined, has $x$-coordinate equal to zero.</li>
</ul><p>When counting the sculptures, any arrangements which are simply reflections about the $y$-axis, are <u>not</u> counted as distinct. For example, the $18$ balanced sculptures of order $6$ are shown below; note that each pair of mirror images (about the $y$-axis) is counted as one sculpture:</p>
<div align="center"><img alt="0275_sculptures2.gif" src="resources/images/0275_sculptures2.gif?1678992056"/></div>
<p>There are $964$ balanced sculptures of order $10$ and $360505$ of order $15$.<br/>How many balanced sculptures are there of order $18$?</p> | 15030564 | Friday, 22nd January 2010, 05:00 pm | 684 | 85% | hard |
332 | Spherical Triangles | A spherical triangle is a figure formed on the surface of a sphere by three great circular arcs intersecting pairwise in three vertices.
Let $C(r)$ be the sphere with the centre $(0,0,0)$ and radius $r$.
Let $Z(r)$ be the set of points on the surface of $C(r)$ with integer coordinates.
Let $T(r)$ be the set of spherical triangles with vertices in $Z(r)$.
Degenerate spherical triangles, formed by three points on the same great arc, are not included in $T(r)$.
Let $A(r)$ be the area of the smallest spherical triangle in $T(r)$.
For example $A(14)$ is $3.294040$ rounded to six decimal places.
Find $\sum \limits_{r = 1}^{50} A(r)$. Give your answer rounded to six decimal places. | A spherical triangle is a figure formed on the surface of a sphere by three great circular arcs intersecting pairwise in three vertices.
Let $C(r)$ be the sphere with the centre $(0,0,0)$ and radius $r$.
Let $Z(r)$ be the set of points on the surface of $C(r)$ with integer coordinates.
Let $T(r)$ be the set of spherical triangles with vertices in $Z(r)$.
Degenerate spherical triangles, formed by three points on the same great arc, are not included in $T(r)$.
Let $A(r)$ be the area of the smallest spherical triangle in $T(r)$.
For example $A(14)$ is $3.294040$ rounded to six decimal places.
Find $\sum \limits_{r = 1}^{50} A(r)$. Give your answer rounded to six decimal places. | <p>A <strong>spherical triangle</strong> is a figure formed on the surface of a sphere by three <strong>great circular arcs</strong> intersecting pairwise in three vertices.</p>
<div align="center"><img alt="0332_spherical.jpg" class="dark_img" src="resources/images/0332_spherical.jpg?1678992054"/></div>
<p>Let $C(r)$ be the sphere with the centre $(0,0,0)$ and radius $r$.<br/>
Let $Z(r)$ be the set of points on the surface of $C(r)$ with integer coordinates.<br/>
Let $T(r)$ be the set of spherical triangles with vertices in $Z(r)$.
Degenerate spherical triangles, formed by three points on the same great arc, are <u>not</u> included in $T(r)$.<br/>
Let $A(r)$ be the area of the smallest spherical triangle in $T(r)$.</p>
<p>For example $A(14)$ is $3.294040$ rounded to six decimal places.</p>
<p>Find $\sum \limits_{r = 1}^{50} A(r)$. Give your answer rounded to six decimal places.</p> | 2717.751525 | Sunday, 10th April 2011, 10:00 am | 682 | 50% | medium |
279 | Triangles with Integral Sides and an Integral Angle | How many triangles are there with integral sides, at least one integral angle (measured in degrees), and a perimeter that does not exceed $10^8$? | How many triangles are there with integral sides, at least one integral angle (measured in degrees), and a perimeter that does not exceed $10^8$? | <p>
How many triangles are there with integral sides, at least one integral angle (measured in degrees), and a perimeter that does not exceed $10^8$?
</p> | 416577688 | Saturday, 20th February 2010, 09:00 am | 840 | 60% | hard |
269 | Polynomials with at Least One Integer Root | A root or zero of a polynomial $P(x)$ is a solution to the equation $P(x) = 0$.
Define $P_n$ as the polynomial whose coefficients are the digits of $n$.
For example, $P_{5703}(x) = 5x^3 + 7x^2 + 3$.
We can see that:$P_n(0)$ is the last digit of $n$,
$P_n(1)$ is the sum of the digits of $n$,
$P_n(10)$ is $n$ itself.Define $Z(k)$ as the number of positive integers, $n$, not exceeding $k$ for which the polynomial $P_n$ has at least one integer root.
It can be verified that $Z(100\,000)$ is $14696$.
What is $Z(10^{16})$? | A root or zero of a polynomial $P(x)$ is a solution to the equation $P(x) = 0$.
Define $P_n$ as the polynomial whose coefficients are the digits of $n$.
For example, $P_{5703}(x) = 5x^3 + 7x^2 + 3$.
We can see that:$P_n(0)$ is the last digit of $n$,
$P_n(1)$ is the sum of the digits of $n$,
$P_n(10)$ is $n$ itself.Define $Z(k)$ as the number of positive integers, $n$, not exceeding $k$ for which the polynomial $P_n$ has at least one integer root.
It can be verified that $Z(100\,000)$ is $14696$.
What is $Z(10^{16})$? | <p>A root or zero of a polynomial $P(x)$ is a solution to the equation $P(x) = 0$. <br/>
Define $P_n$ as the polynomial whose coefficients are the digits of $n$.<br/>
For example, $P_{5703}(x) = 5x^3 + 7x^2 + 3$.</p>
<p>We can see that:</p><ul><li>$P_n(0)$ is the last digit of $n$,</li>
<li>$P_n(1)$ is the sum of the digits of $n$,</li>
<li>$P_n(10)$ is $n$ itself.</li></ul><p>Define $Z(k)$ as the number of positive integers, $n$, not exceeding $k$ for which the polynomial $P_n$ has at least one integer root.</p>
<p>It can be verified that $Z(100\,000)$ is $14696$.</p>
<p>What is $Z(10^{16})$?</p> | 1311109198529286 | Saturday, 19th December 2009, 09:00 am | 789 | 80% | hard |
45 | Triangular, Pentagonal, and Hexagonal | Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
Triangle
$T_n=n(n+1)/2$
$1, 3, 6, 10, 15, \dots$
Pentagonal
$P_n=n(3n - 1)/2$
$1, 5, 12, 22, 35, \dots$
Hexagonal
$H_n=n(2n - 1)$
$1, 6, 15, 28, 45, \dots$
It can be verified that $T_{285} = P_{165} = H_{143} = 40755$.
Find the next triangle number that is also pentagonal and hexagonal. | Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
Triangle
$T_n=n(n+1)/2$
$1, 3, 6, 10, 15, \dots$
Pentagonal
$P_n=n(3n - 1)/2$
$1, 5, 12, 22, 35, \dots$
Hexagonal
$H_n=n(2n - 1)$
$1, 6, 15, 28, 45, \dots$
It can be verified that $T_{285} = P_{165} = H_{143} = 40755$.
Find the next triangle number that is also pentagonal and hexagonal. | <p>Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:</p>
<table><tr><td>Triangle</td>
<td> </td>
<td>$T_n=n(n+1)/2$</td>
<td> </td>
<td>$1, 3, 6, 10, 15, \dots$</td>
</tr><tr><td>Pentagonal</td>
<td> </td>
<td>$P_n=n(3n - 1)/2$</td>
<td> </td>
<td>$1, 5, 12, 22, 35, \dots$</td>
</tr><tr><td>Hexagonal</td>
<td> </td>
<td>$H_n=n(2n - 1)$</td>
<td> </td>
<td>$1, 6, 15, 28, 45, \dots$</td>
</tr></table><p>It can be verified that $T_{285} = P_{165} = H_{143} = 40755$.</p>
<p>Find the next triangle number that is also pentagonal and hexagonal.</p> | 1533776805 | Friday, 6th June 2003, 06:00 pm | 77303 | 5% | easy |
798 | Card Stacking Game | Two players play a game with a deck of cards which contains $s$ suits with each suit containing $n$ cards numbered from $1$ to $n$.
Before the game starts, a set of cards (which may be empty) is picked from the deck and placed face-up on the table, with no overlap. These are called the visible cards.
The players then make moves in turn.
A move consists of choosing a card X from the rest of the deck and placing it face-up on top of a visible card Y, subject to the following restrictions:
X and Y must be the same suit;
the value of X must be larger than the value of Y.
The card X then covers the card Y and replaces Y as a visible card.
The player unable to make a valid move loses and play stops.
Let $C(n, s)$ be the number of different initial sets of cards for which the first player will lose given best play for both players.
For example, $C(3, 2) = 26$ and $C(13, 4) \equiv 540318329 \pmod {1\,000\,000\,007}$.
Find $C(10^7, 10^7)$. Give your answer modulo $1\,000\,000\,007$. | Two players play a game with a deck of cards which contains $s$ suits with each suit containing $n$ cards numbered from $1$ to $n$.
Before the game starts, a set of cards (which may be empty) is picked from the deck and placed face-up on the table, with no overlap. These are called the visible cards.
The players then make moves in turn.
A move consists of choosing a card X from the rest of the deck and placing it face-up on top of a visible card Y, subject to the following restrictions:
X and Y must be the same suit;
the value of X must be larger than the value of Y.
The card X then covers the card Y and replaces Y as a visible card.
The player unable to make a valid move loses and play stops.
Let $C(n, s)$ be the number of different initial sets of cards for which the first player will lose given best play for both players.
For example, $C(3, 2) = 26$ and $C(13, 4) \equiv 540318329 \pmod {1\,000\,000\,007}$.
Find $C(10^7, 10^7)$. Give your answer modulo $1\,000\,000\,007$. | <p>
Two players play a game with a deck of cards which contains $s$ suits with each suit containing $n$ cards numbered from $1$ to $n$.</p>
<p>
Before the game starts, a set of cards (which may be empty) is picked from the deck and placed face-up on the table, with no overlap. These are called the visible cards.</p>
<p>
The players then make moves in turn.<br>
A move consists of choosing a card X from the rest of the deck and placing it face-up on top of a visible card Y, subject to the following restrictions:</br></p>
<ul>
<li>X and Y must be the same suit;</li>
<li>the value of X must be larger than the value of Y.</li>
</ul>
<p>
The card X then covers the card Y and replaces Y as a visible card.<br/>
The player unable to make a valid move loses and play stops.</p>
<p>
Let $C(n, s)$ be the number of different initial sets of cards for which the first player will lose given best play for both players.</p>
<p>
For example, $C(3, 2) = 26$ and $C(13, 4) \equiv 540318329 \pmod {1\,000\,000\,007}$.</p>
<p>
Find $C(10^7, 10^7)$. Give your answer modulo $1\,000\,000\,007$.</p> | 132996198 | Saturday, 14th May 2022, 11:00 pm | 138 | 100% | hard |
815 | Group by Value | A pack of cards contains $4n$ cards with four identical cards of each value. The pack is shuffled and cards are dealt one at a time and placed in piles of equal value. If the card has the same value as any pile it is placed in that pile. If there is no pile of that value then it begins a new pile. When a pile has four cards of the same value it is removed.
Throughout the process the maximum number of non empty piles is recorded. Let $E(n)$ be its expected value. You are given $E(2) = 1.97142857$ rounded to 8 decimal places.
Find $E(60)$. Give your answer rounded to 8 digits after the decimal point. | A pack of cards contains $4n$ cards with four identical cards of each value. The pack is shuffled and cards are dealt one at a time and placed in piles of equal value. If the card has the same value as any pile it is placed in that pile. If there is no pile of that value then it begins a new pile. When a pile has four cards of the same value it is removed.
Throughout the process the maximum number of non empty piles is recorded. Let $E(n)$ be its expected value. You are given $E(2) = 1.97142857$ rounded to 8 decimal places.
Find $E(60)$. Give your answer rounded to 8 digits after the decimal point. | <p>
A pack of cards contains $4n$ cards with four identical cards of each value. The pack is shuffled and cards are dealt one at a time and placed in piles of equal value. If the card has the same value as any pile it is placed in that pile. If there is no pile of that value then it begins a new pile. When a pile has four cards of the same value it is removed.</p>
<p>
Throughout the process the maximum number of non empty piles is recorded. Let $E(n)$ be its expected value. You are given $E(2) = 1.97142857$ rounded to 8 decimal places.</p>
<p>
Find $E(60)$. Give your answer rounded to 8 digits after the decimal point. </p> | 54.12691621 | Sunday, 6th November 2022, 01:00 am | 470 | 25% | easy |
477 | Number Sequence Game | The number sequence game starts with a sequence $S$ of $N$ numbers written on a line.
Two players alternate turns. The players on their respective turns must select and remove either the first or the last number remaining in the sequence.
A player's own score is (determined by) the sum of all the numbers that player has taken. Each player attempts to maximize their own sum.
If $N = 4$ and $S = \{1, 2, 10, 3\}$, then each player maximizes their own score as follows:
Player 1: removes the first number ($1$)
Player 2: removes the last number from the remaining sequence ($3$)
Player 1: removes the last number from the remaining sequence ($10$)
Player 2: removes the remaining number ($2$)
Player 1 score is $1 + 10 = 11$.
Let $F(N)$ be the score of player 1 if both players follow the optimal strategy for the sequence $S = \{s_1, s_2, \dots, s_N\}$ defined as:
$s_1 = 0$
$s_{i + 1} = (s_i^2 + 45)$ modulo $1\,000\,000\,007$
The sequence begins with $S=\{0, 45, 2070, 4284945, 753524550, 478107844, 894218625, \dots\}$.
You are given $F(2)=45$, $F(4)=4284990$, $F(100)=26365463243$, $F(10^4)=2495838522951$.
Find $F(10^8)$. | The number sequence game starts with a sequence $S$ of $N$ numbers written on a line.
Two players alternate turns. The players on their respective turns must select and remove either the first or the last number remaining in the sequence.
A player's own score is (determined by) the sum of all the numbers that player has taken. Each player attempts to maximize their own sum.
If $N = 4$ and $S = \{1, 2, 10, 3\}$, then each player maximizes their own score as follows:
Player 1: removes the first number ($1$)
Player 2: removes the last number from the remaining sequence ($3$)
Player 1: removes the last number from the remaining sequence ($10$)
Player 2: removes the remaining number ($2$)
Player 1 score is $1 + 10 = 11$.
Let $F(N)$ be the score of player 1 if both players follow the optimal strategy for the sequence $S = \{s_1, s_2, \dots, s_N\}$ defined as:
$s_1 = 0$
$s_{i + 1} = (s_i^2 + 45)$ modulo $1\,000\,000\,007$
The sequence begins with $S=\{0, 45, 2070, 4284945, 753524550, 478107844, 894218625, \dots\}$.
You are given $F(2)=45$, $F(4)=4284990$, $F(100)=26365463243$, $F(10^4)=2495838522951$.
Find $F(10^8)$. | <p>The number sequence game starts with a sequence $S$ of $N$ numbers written on a line.</p>
<p>Two players alternate turns. The players on their respective turns must select and remove either the first or the last number remaining in the sequence.</p>
<p>A player's own score is (determined by) the sum of all the numbers that player has taken. Each player attempts to maximize their own sum.</p>
If $N = 4$ and $S = \{1, 2, 10, 3\}$, then each player maximizes their own score as follows:
<ul><li>Player 1: removes the first number ($1$)</li>
<li>Player 2: removes the last number from the remaining sequence ($3$)</li>
<li>Player 1: removes the last number from the remaining sequence ($10$)</li>
<li>Player 2: removes the remaining number ($2$)</li>
</ul><p>Player 1 score is $1 + 10 = 11$.</p>
<p>Let $F(N)$ be the score of player 1 if both players follow the optimal strategy for the sequence $S = \{s_1, s_2, \dots, s_N\}$ defined as:</p>
<ul><li>$s_1 = 0$</li>
<li>$s_{i + 1} = (s_i^2 + 45)$ modulo $1\,000\,000\,007$</li>
</ul><p>The sequence begins with $S=\{0, 45, 2070, 4284945, 753524550, 478107844, 894218625, \dots\}$.</p>
<p>You are given $F(2)=45$, $F(4)=4284990$, $F(100)=26365463243$, $F(10^4)=2495838522951$.</p>
<p>Find $F(10^8)$.</p> | 25044905874565165 | Saturday, 23rd August 2014, 04:00 pm | 287 | 65% | hard |
220 | Heighway Dragon | Let D0 be the two-letter string "Fa". For n≥1, derive Dn from Dn-1 by the string-rewriting rules:
"a" → "aRbFR"
"b" → "LFaLb"
Thus, D0 = "Fa", D1 = "FaRbFR", D2 = "FaRbFRRLFaLbFR", and so on.
These strings can be interpreted as instructions to a computer graphics program, with "F" meaning "draw forward one unit", "L" meaning "turn left 90 degrees", "R" meaning "turn right 90 degrees", and "a" and "b" being ignored. The initial position of the computer cursor is (0,0), pointing up towards (0,1).
Then Dn is an exotic drawing known as the Heighway Dragon of order n. For example, D10 is shown below; counting each "F" as one step, the highlighted spot at (18,16) is the position reached after 500 steps.
What is the position of the cursor after 1012 steps in D50 ?
Give your answer in the form x,y with no spaces. | Let D0 be the two-letter string "Fa". For n≥1, derive Dn from Dn-1 by the string-rewriting rules:
"a" → "aRbFR"
"b" → "LFaLb"
Thus, D0 = "Fa", D1 = "FaRbFR", D2 = "FaRbFRRLFaLbFR", and so on.
These strings can be interpreted as instructions to a computer graphics program, with "F" meaning "draw forward one unit", "L" meaning "turn left 90 degrees", "R" meaning "turn right 90 degrees", and "a" and "b" being ignored. The initial position of the computer cursor is (0,0), pointing up towards (0,1).
Then Dn is an exotic drawing known as the Heighway Dragon of order n. For example, D10 is shown below; counting each "F" as one step, the highlighted spot at (18,16) is the position reached after 500 steps.
What is the position of the cursor after 1012 steps in D50 ?
Give your answer in the form x,y with no spaces. | <p>Let <b><i>D</i></b><sub>0</sub> be the two-letter string "Fa". For n≥1, derive <b><i>D</i></b><sub>n</sub> from <b><i>D</i></b><sub>n-1</sub> by the string-rewriting rules:</p>
<p style="margin-left:40px;">"a" → "aRbFR"<br>
"b" → "LFaLb"</br></p>
<p>Thus, <b><i>D</i></b><sub>0</sub> = "Fa", <b><i>D</i></b><sub>1</sub> = "FaRbFR", <b><i>D</i></b><sub>2</sub> = "FaRbFRRLFaLbFR", and so on.</p>
<p>These strings can be interpreted as instructions to a computer graphics program, with "F" meaning "draw forward one unit", "L" meaning "turn left 90 degrees", "R" meaning "turn right 90 degrees", and "a" and "b" being ignored. The initial position of the computer cursor is (0,0), pointing up towards (0,1).</p>
<p>Then <b><i>D</i></b><sub>n</sub> is an exotic drawing known as the <i>Heighway Dragon</i> of order <i>n</i>. For example, <b><i>D</i></b><sub>10</sub> is shown below; counting each "F" as one step, the highlighted spot at (18,16) is the position reached after 500 steps.</p>
<div class="center">
<img alt="" class="dark_img" src="project/images/p220.gif"/></div>
<p>What is the position of the cursor after 10<sup>12</sup> steps in <b><i>D</i></b><sub>50</sub> ?<br/>
Give your answer in the form <i>x</i>,<i>y</i> with no spaces.</p> | 139776,963904 | Saturday, 6th December 2008, 09:00 am | 2379 | 55% | medium |
471 | Triangle Inscribed in Ellipse | The triangle $\triangle ABC$ is inscribed in an ellipse with equation $\frac {x^2} {a^2} + \frac {y^2} {b^2} = 1$, $0 \lt 2b \lt a$, $a$ and $b$ integers.
Let $r(a, b)$ be the radius of the incircle of $\triangle ABC$ when the incircle has center $(2b, 0)$ and $A$ has coordinates $\left( \frac a 2, \frac {\sqrt 3} 2 b\right)$.
For example, $r(3,1)=\frac12$, $r(6,2)=1$, $r(12,3)=2$.
Let $G(n) = \sum_{a=3}^n \sum_{b=1}^{\lfloor \frac {a - 1} 2 \rfloor} r(a, b)$
You are given $G(10) = 20.59722222$, $G(100) = 19223.60980$ (rounded to $10$ significant digits).
Find $G(10^{11})$.
Give your answer in scientific notation rounded to $10$ significant digits. Use a lowercase e to separate mantissa and exponent.
For $G(10)$ the answer would have been 2.059722222e1. | The triangle $\triangle ABC$ is inscribed in an ellipse with equation $\frac {x^2} {a^2} + \frac {y^2} {b^2} = 1$, $0 \lt 2b \lt a$, $a$ and $b$ integers.
Let $r(a, b)$ be the radius of the incircle of $\triangle ABC$ when the incircle has center $(2b, 0)$ and $A$ has coordinates $\left( \frac a 2, \frac {\sqrt 3} 2 b\right)$.
For example, $r(3,1)=\frac12$, $r(6,2)=1$, $r(12,3)=2$.
Let $G(n) = \sum_{a=3}^n \sum_{b=1}^{\lfloor \frac {a - 1} 2 \rfloor} r(a, b)$
You are given $G(10) = 20.59722222$, $G(100) = 19223.60980$ (rounded to $10$ significant digits).
Find $G(10^{11})$.
Give your answer in scientific notation rounded to $10$ significant digits. Use a lowercase e to separate mantissa and exponent.
For $G(10)$ the answer would have been 2.059722222e1. | <p>The triangle $\triangle ABC$ is inscribed in an ellipse with equation $\frac {x^2} {a^2} + \frac {y^2} {b^2} = 1$, $0 \lt 2b \lt a$, $a$ and $b$ integers.</p>
<p>Let $r(a, b)$ be the radius of the incircle of $\triangle ABC$ when the incircle has center $(2b, 0)$ and $A$ has coordinates $\left( \frac a 2, \frac {\sqrt 3} 2 b\right)$.</p>
<p>For example, $r(3,1)=\frac12$, $r(6,2)=1$, $r(12,3)=2$.</p>
<p align="center"><img alt="0471-triangle-inscribed-in-ellipse-1.png" src="resources/images/0471-triangle-inscribed-in-ellipse-1.png?1678992053"/></p>
<p align="center"><img alt="0471-triangle-inscribed-in-ellipse-2.png" src="resources/images/0471-triangle-inscribed-in-ellipse-2.png?1678992053"/></p>
<p>Let $G(n) = \sum_{a=3}^n \sum_{b=1}^{\lfloor \frac {a - 1} 2 \rfloor} r(a, b)$</p>
<p>You are given $G(10) = 20.59722222$, $G(100) = 19223.60980$ (rounded to $10$ significant digits).</p>
<p>Find $G(10^{11})$.</p>
<p>Give your answer in scientific notation rounded to $10$ significant digits. Use a lowercase e to separate mantissa and exponent.</p>
<p>For $G(10)$ the answer would have been 2.059722222e1.</p> | 1.895093981e31 | Saturday, 10th May 2014, 10:00 pm | 239 | 75% | hard |
End of preview. Expand
in Data Studio
Project Euler Problems Dataset
A comprehensive collection of mathematical and programming challenges from Project Euler (projecteuler.net), organized for machine learning and educational purposes.
Dataset Description
This dataset contains 918 problems from Project Euler, a series of challenging mathematical/computer programming problems that require creative problem-solving approaches.
Features
- id: Problem number (integer)
- title: Problem title
- problem: Plain text version of the problem statement
- question_latex: LaTeX formatted problem statement
- question_html: HTML formatted problem statement
- numerical_answer: The correct numerical answer
- pub_date: Publication date
- solved_by: Number of people who have solved the problem
- diff_rate: Difficulty rating (percentage of users who solved it)
Splits
The dataset provides several splits for different use cases:
- train/test: Standard 80/10/10 split for machine learning
- train: 734 problems
- test: 184 problems
- easy/medium/hard: Problems grouped by difficulty level
- easy: 277 problems (>25% solve rate)
- medium: 336 problems (5-25% solve rate)
- hard: 305 problems (≤5% solve rate)
- early_problems/later_problems: First half vs. second half of problems by ID
- early_problems: 464 problems
- later_problems: 454 problems
- sample: A random selection of 50 problems for quick experimentation
Usage
from datasets import load_dataset
# Load the entire dataset with all splits
dataset = load_dataset("alexandonian/project-euler")
# Work with specific splits
train_problems = dataset["train"]
hard_problems = dataset["hard"]
sample_problems = dataset["sample"]
# Example: Get a problem
problem = train_problems[0]
print(f"Problem #{problem["id"]}: {problem["title"]}")
print(problem["problem"])
print(f"Answer: {problem["numerical_answer"]}")
Potential Applications
- Training math problem-solving models
- Generating solutions or solution approaches
- Testing reasoning capabilities of language models
- Educational tools for learning algorithmic thinking
Citation & License
This dataset is provided for research and educational purposes. Project Euler problems are from projecteuler.net.
- Downloads last month
- 192