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
733
Ascending Subsequences
Let $a_i$ be the sequence defined by $a_i=153^i \bmod 10\,000\,019$ for $i \ge 1$. The first terms of $a_i$ are: $153, 23409, 3581577, 7980255, 976697, 9434375, \dots$ Consider the subsequences consisting of $4$ terms in ascending order. For the part of the sequence shown above, these are: $153, 23409, 3581577, 7980255$ $153, 23409, 3581577, 9434375$ $153, 23409, 7980255, 9434375$ $153, 23409, 976697, 9434375$ $153, 3581577, 7980255, 9434375$ and $23409, 3581577, 7980255, 9434375$. Define $S(n)$ to be the sum of the terms for all such subsequences within the first $n$ terms of $a_i$. Thus $S(6)=94513710$. You are given that $S(100)=4465488724217$. Find $S(10^6)$ modulo $1\,000\,000\,007$.
Let $a_i$ be the sequence defined by $a_i=153^i \bmod 10\,000\,019$ for $i \ge 1$. The first terms of $a_i$ are: $153, 23409, 3581577, 7980255, 976697, 9434375, \dots$ Consider the subsequences consisting of $4$ terms in ascending order. For the part of the sequence shown above, these are: $153, 23409, 3581577, 7980255$ $153, 23409, 3581577, 9434375$ $153, 23409, 7980255, 9434375$ $153, 23409, 976697, 9434375$ $153, 3581577, 7980255, 9434375$ and $23409, 3581577, 7980255, 9434375$. Define $S(n)$ to be the sum of the terms for all such subsequences within the first $n$ terms of $a_i$. Thus $S(6)=94513710$. You are given that $S(100)=4465488724217$. Find $S(10^6)$ modulo $1\,000\,000\,007$.
<p> Let $a_i$ be the sequence defined by $a_i=153^i \bmod 10\,000\,019$ for $i \ge 1$.<br/> The first terms of $a_i$ are: $153, 23409, 3581577, 7980255, 976697, 9434375, \dots$ </p> <p> Consider the subsequences consisting of $4$ terms in ascending order. For the part of the sequence shown above, these are:<br/> $153, 23409, 3581577, 7980255$<br/> $153, 23409, 3581577, 9434375$<br/> $153, 23409, 7980255, 9434375$<br/> $153, 23409, 976697, 9434375$<br/> $153, 3581577, 7980255, 9434375$ and<br/> $23409, 3581577, 7980255, 9434375$. </p> <p> Define $S(n)$ to be the sum of the terms for all such subsequences within the first $n$ terms of $a_i$. Thus $S(6)=94513710$.<br/> You are given that $S(100)=4465488724217$. </p> <p> Find $S(10^6)$ modulo $1\,000\,000\,007$. </p>
574368578
Saturday, 7th November 2020, 04:00 pm
509
25%
easy
484
Arithmetic Derivative
The arithmetic derivative is defined by $p^\prime = 1$ for any prime $p$ $(ab)^\prime = a^\prime b + ab^\prime$ for all integers $a, b$ (Leibniz rule) For example, $20^\prime = 24$. Find $\sum \operatorname{\mathbf{gcd}}(k,k^\prime)$ for $1 \lt k \le 5 \times 10^{15}$. Note: $\operatorname{\mathbf{gcd}}(x,y)$ denotes the greatest common divisor of $x$ and $y$.
The arithmetic derivative is defined by $p^\prime = 1$ for any prime $p$ $(ab)^\prime = a^\prime b + ab^\prime$ for all integers $a, b$ (Leibniz rule) For example, $20^\prime = 24$. Find $\sum \operatorname{\mathbf{gcd}}(k,k^\prime)$ for $1 \lt k \le 5 \times 10^{15}$. Note: $\operatorname{\mathbf{gcd}}(x,y)$ denotes the greatest common divisor of $x$ and $y$.
<p>The <strong>arithmetic derivative</strong> is defined by</p> <ul><li>$p^\prime = 1$ for any prime $p$</li> <li>$(ab)^\prime = a^\prime b + ab^\prime$ for all integers $a, b$ (Leibniz rule)</li> </ul><p>For example, $20^\prime = 24$.</p> <p>Find $\sum \operatorname{\mathbf{gcd}}(k,k^\prime)$ for $1 \lt k \le 5 \times 10^{15}$.</p> <p><span style="font-size:smaller;">Note: $\operatorname{\mathbf{gcd}}(x,y)$ denotes the greatest common divisor of $x$ and $y$.</span></p>
8907904768686152599
Saturday, 11th October 2014, 01:00 pm
441
100%
hard
6
Sum Square Difference
The sum of the squares of the first ten natural numbers is, $$1^2 + 2^2 + ... + 10^2 = 385.$$ The square of the sum of the first ten natural numbers is, $$(1 + 2 + ... + 10)^2 = 55^2 = 3025.$$ Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is $3025 - 385 = 2640$. Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
The sum of the squares of the first ten natural numbers is, $$1^2 + 2^2 + ... + 10^2 = 385.$$ The square of the sum of the first ten natural numbers is, $$(1 + 2 + ... + 10)^2 = 55^2 = 3025.$$ Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is $3025 - 385 = 2640$. Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.
<p>The sum of the squares of the first ten natural numbers is,</p> $$1^2 + 2^2 + ... + 10^2 = 385.$$ <p>The square of the sum of the first ten natural numbers is,</p> $$(1 + 2 + ... + 10)^2 = 55^2 = 3025.$$ <p>Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is $3025 - 385 = 2640$.</p> <p>Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.</p>
25164150
Friday, 14th December 2001, 06:00 pm
525978
5%
easy
598
Split Divisibilities
Consider the number $48$. There are five pairs of integers $a$ and $b$ ($a \leq b$) such that $a \times b=48$: $(1,48)$, $(2,24)$, $(3,16)$, $(4,12)$ and $(6,8)$. It can be seen that both $6$ and $8$ have $4$ divisors. So of those five pairs one consists of two integers with the same number of divisors. In general: Let $C(n)$ be the number of pairs of positive integers $a \times b=n$, ($a \leq b$) such that $a$ and $b$ have the same number of divisors; so $C(48)=1$. You are given $C(10!)=3$: $(1680, 2160)$, $(1800, 2016)$ and $(1890,1920)$. Find $C(100!)$.
Consider the number $48$. There are five pairs of integers $a$ and $b$ ($a \leq b$) such that $a \times b=48$: $(1,48)$, $(2,24)$, $(3,16)$, $(4,12)$ and $(6,8)$. It can be seen that both $6$ and $8$ have $4$ divisors. So of those five pairs one consists of two integers with the same number of divisors. In general: Let $C(n)$ be the number of pairs of positive integers $a \times b=n$, ($a \leq b$) such that $a$ and $b$ have the same number of divisors; so $C(48)=1$. You are given $C(10!)=3$: $(1680, 2160)$, $(1800, 2016)$ and $(1890,1920)$. Find $C(100!)$.
<p> Consider the number $48$.<br/> There are five pairs of integers $a$ and $b$ ($a \leq b$) such that $a \times b=48$: $(1,48)$, $(2,24)$, $(3,16)$, $(4,12)$ and $(6,8)$.<br/> It can be seen that both $6$ and $8$ have $4$ divisors.<br/> So of those five pairs one consists of two integers with the same number of divisors.</p> <p> In general:<br/> Let $C(n)$ be the number of pairs of positive integers $a \times b=n$, ($a \leq b$) such that $a$ and $b$ have the same number of divisors; <br/>so $C(48)=1$. </p> <p> You are given $C(10!)=3$: $(1680, 2160)$, $(1800, 2016)$ and $(1890,1920)$.</p><p> Find $C(100!)$.</p>
543194779059
Sunday, 9th April 2017, 10:00 am
538
40%
medium
700
Eulercoin
Leonhard Euler was born on 15 April 1707. Consider the sequence 1504170715041707n mod 4503599627370517. An element of this sequence is defined to be an Eulercoin if it is strictly smaller than all previously found Eulercoins. For example, the first term is 1504170715041707 which is the first Eulercoin. The second term is 3008341430083414 which is greater than 1504170715041707 so is not an Eulercoin. However, the third term is 8912517754604 which is small enough to be a new Eulercoin. The sum of the first 2 Eulercoins is therefore 1513083232796311. Find the sum of all Eulercoins.
Leonhard Euler was born on 15 April 1707. Consider the sequence 1504170715041707n mod 4503599627370517. An element of this sequence is defined to be an Eulercoin if it is strictly smaller than all previously found Eulercoins. For example, the first term is 1504170715041707 which is the first Eulercoin. The second term is 3008341430083414 which is greater than 1504170715041707 so is not an Eulercoin. However, the third term is 8912517754604 which is small enough to be a new Eulercoin. The sum of the first 2 Eulercoins is therefore 1513083232796311. Find the sum of all Eulercoins.
<p>Leonhard Euler was born on 15 April 1707.</p> <p>Consider the sequence 1504170715041707<var>n</var> mod 4503599627370517.</p> <p>An element of this sequence is defined to be an Eulercoin if it is strictly smaller than all previously found Eulercoins.</p> <p>For example, the first term is 1504170715041707 which is the first Eulercoin. The second term is 3008341430083414 which is greater than 1504170715041707 so is not an Eulercoin. However, the third term is 8912517754604 which is small enough to be a new Eulercoin.</p> <p>The sum of the first 2 Eulercoins is therefore 1513083232796311.</p> <p>Find the sum of all Eulercoins.</p>
1517926517777556
Saturday, 1st February 2020, 01:00 pm
3887
5%
easy
881
Divisor Graph Width
For a positive integer $n$ create a graph using its divisors as vertices. An edge is drawn between two vertices $a \lt b$ if their quotient $b/a$ is prime. The graph can be arranged into levels where vertex $n$ is at level $0$ and vertices that are a distance $k$ from $n$ are on level $k$. Define $g(n)$ to be the maximum number of vertices in a single level. The example above shows that $g(45) = 2$. You are also given $g(5040) = 12$. Find the smallest number, $n$, such that $g(n) \ge 10^4$.
For a positive integer $n$ create a graph using its divisors as vertices. An edge is drawn between two vertices $a \lt b$ if their quotient $b/a$ is prime. The graph can be arranged into levels where vertex $n$ is at level $0$ and vertices that are a distance $k$ from $n$ are on level $k$. Define $g(n)$ to be the maximum number of vertices in a single level. The example above shows that $g(45) = 2$. You are also given $g(5040) = 12$. Find the smallest number, $n$, such that $g(n) \ge 10^4$.
<p> For a positive integer $n$ create a graph using its divisors as vertices. An edge is drawn between two vertices $a \lt b$ if their quotient $b/a$ is prime. The graph can be arranged into levels where vertex $n$ is at level $0$ and vertices that are a distance $k$ from $n$ are on level $k$. Define $g(n)$ to be the maximum number of vertices in a single level. </p> <img alt="0881_example45.jpg" src="resources/images/0881_example45.jpg?1707508801"/> <p> The example above shows that $g(45) = 2$. You are also given $g(5040) = 12$.</p> <p> Find the smallest number, $n$, such that $g(n) \ge 10^4$.</p>
205702861096933200
Saturday, 9th March 2024, 10:00 pm
502
20%
easy
443
GCD Sequence
Let $g(n)$ be a sequence defined as follows: $g(4) = 13$, $g(n) = g(n-1) + \gcd(n, g(n-1))$ for $n \gt 4$. The first few values are: $n$4567891011121314151617181920... $g(n)$1314161718272829303132333451545560... You are given that $g(1\,000) = 2524$ and $g(1\,000\,000) = 2624152$. Find $g(10^{15})$.
Let $g(n)$ be a sequence defined as follows: $g(4) = 13$, $g(n) = g(n-1) + \gcd(n, g(n-1))$ for $n \gt 4$. The first few values are: $n$4567891011121314151617181920... $g(n)$1314161718272829303132333451545560... You are given that $g(1\,000) = 2524$ and $g(1\,000\,000) = 2624152$. Find $g(10^{15})$.
<p>Let $g(n)$ be a sequence defined as follows:<br/> $g(4) = 13$,<br/> $g(n) = g(n-1) + \gcd(n, g(n-1))$ for $n \gt 4$.</p> <p>The first few values are:</p> <div align="center"> <table align="center" border="0" cellpadding="5" cellspacing="1"><tr><td>$n$</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td><td>16</td><td>17</td><td>18</td><td>19</td><td>20</td><td>...</td> </tr><tr><td>$g(n)$</td><td>13</td><td>14</td><td>16</td><td>17</td><td>18</td><td>27</td><td>28</td><td>29</td><td>30</td><td>31</td><td>32</td><td>33</td><td>34</td><td>51</td><td>54</td><td>55</td><td>60</td><td>...</td> </tr></table></div> <p>You are given that $g(1\,000) = 2524$ and $g(1\,000\,000) = 2624152$.</p> <p>Find $g(10^{15})$.</p>
2744233049300770
Saturday, 2nd November 2013, 04:00 pm
1282
30%
easy
818
SET
The SET® card game is played with a pack of $81$ distinct cards. Each card has four features (Shape, Color, Number, Shading). Each feature has three different variants (e.g. Color can be red, purple, green). A SET consists of three different cards such that each feature is either the same on each card or different on each card. For a collection $C_n$ of $n$ cards, let $S(C_n)$ denote the number of SETs in $C_n$. Then define $F(n) = \sum\limits_{C_n} S(C_n)^4$ where $C_n$ ranges through all collections of $n$ cards (among the $81$ cards). You are given $F(3) = 1080$ and $F(6) = 159690960$. Find $F(12)$. $\scriptsize{\text{SET is a registered trademark of Cannei, LLC. All rights reserved. Used with permission from PlayMonster, LLC.}}$
The SET® card game is played with a pack of $81$ distinct cards. Each card has four features (Shape, Color, Number, Shading). Each feature has three different variants (e.g. Color can be red, purple, green). A SET consists of three different cards such that each feature is either the same on each card or different on each card. For a collection $C_n$ of $n$ cards, let $S(C_n)$ denote the number of SETs in $C_n$. Then define $F(n) = \sum\limits_{C_n} S(C_n)^4$ where $C_n$ ranges through all collections of $n$ cards (among the $81$ cards). You are given $F(3) = 1080$ and $F(6) = 159690960$. Find $F(12)$. $\scriptsize{\text{SET is a registered trademark of Cannei, LLC. All rights reserved. Used with permission from PlayMonster, LLC.}}$
<p> The SET® card game is played with a pack of $81$ distinct cards. Each card has four features (Shape, Color, Number, Shading). Each feature has three different variants (e.g. Color can be red, purple, green).</p> <p> A <i>SET</i> consists of three different cards such that each feature is either the same on each card or different on each card.</p> <p> For a collection $C_n$ of $n$ cards, let $S(C_n)$ denote the number of <i>SET</i>s in $C_n$. Then define $F(n) = \sum\limits_{C_n} S(C_n)^4$ where $C_n$ ranges through all collections of $n$ cards (among the $81$ cards). You are given $F(3) = 1080$ and $F(6) = 159690960$.</p> <p> Find $F(12)$.</p> <p> $\scriptsize{\text{SET is a registered trademark of Cannei, LLC. All rights reserved. Used with permission from PlayMonster, LLC.}}$</p>
11871909492066000
Sunday, 27th November 2022, 10:00 am
147
85%
hard
386
Maximum Length of an Antichain
Let $n$ be an integer and $S(n)$ be the set of factors of $n$. A subset $A$ of $S(n)$ is called an antichain of $S(n)$ if $A$ contains only one element or if none of the elements of $A$ divides any of the other elements of $A$. For example: $S(30) = \{1, 2, 3, 5, 6, 10, 15, 30\}$. $\{2, 5, 6\}$ is not an antichain of $S(30)$. $\{2, 3, 5\}$ is an antichain of $S(30)$. Let $N(n)$ be the maximum length of an antichain of $S(n)$. Find $\sum N(n)$ for $1 \le n \le 10^8$.
Let $n$ be an integer and $S(n)$ be the set of factors of $n$. A subset $A$ of $S(n)$ is called an antichain of $S(n)$ if $A$ contains only one element or if none of the elements of $A$ divides any of the other elements of $A$. For example: $S(30) = \{1, 2, 3, 5, 6, 10, 15, 30\}$. $\{2, 5, 6\}$ is not an antichain of $S(30)$. $\{2, 3, 5\}$ is an antichain of $S(30)$. Let $N(n)$ be the maximum length of an antichain of $S(n)$. Find $\sum N(n)$ for $1 \le n \le 10^8$.
<p>Let $n$ be an integer and $S(n)$ be the set of factors of $n$.</p> <p>A subset $A$ of $S(n)$ is called an <strong>antichain</strong> of $S(n)$ if $A$ contains only one element or if none of the elements of $A$ divides any of the other elements of $A$.</p> <p>For example: $S(30) = \{1, 2, 3, 5, 6, 10, 15, 30\}$. <br/>$\{2, 5, 6\}$ is not an antichain of $S(30)$. <br/>$\{2, 3, 5\}$ is an antichain of $S(30)$.</p> <p>Let $N(n)$ be the maximum length of an antichain of $S(n)$.</p> <p>Find $\sum N(n)$ for $1 \le n \le 10^8$.</p>
528755790
Sunday, 27th May 2012, 08:00 am
833
40%
medium
333
Special Partitions
All positive integers can be partitioned in such a way that each and every term of the partition can be expressed as $2^i \times 3^j$, where $i,j \ge 0$. Let's consider only such partitions where none of the terms can divide any of the other terms. For example, the partition of $17 = 2 + 6 + 9 = (2^1 \times 3^0 + 2^1 \times 3^1 + 2^0 \times 3^2)$ would not be valid since $2$ can divide $6$. Neither would the partition $17 = 16 + 1 = (2^4 \times 3^0 + 2^0 \times 3^0)$ since $1$ can divide $16$. The only valid partition of $17$ would be $8 + 9 = (2^3 \times 3^0 + 2^0 \times 3^2)$. Many integers have more than one valid partition, the first being $11$ having the following two partitions. $11 = 2 + 9 = (2^1 \times 3^0 + 2^0 \times 3^2)$ $11 = 8 + 3 = (2^3 \times 3^0 + 2^0 \times 3^1)$ Let's define $P(n)$ as the number of valid partitions of $n$. For example, $P(11) = 2$. Let's consider only the prime integers $q$ which would have a single valid partition such as $P(17)$. The sum of the primes $q \lt 100$ such that $P(q)=1$ equals $233$. Find the sum of the primes $q \lt 1000000$ such that $P(q)=1$.
All positive integers can be partitioned in such a way that each and every term of the partition can be expressed as $2^i \times 3^j$, where $i,j \ge 0$. Let's consider only such partitions where none of the terms can divide any of the other terms. For example, the partition of $17 = 2 + 6 + 9 = (2^1 \times 3^0 + 2^1 \times 3^1 + 2^0 \times 3^2)$ would not be valid since $2$ can divide $6$. Neither would the partition $17 = 16 + 1 = (2^4 \times 3^0 + 2^0 \times 3^0)$ since $1$ can divide $16$. The only valid partition of $17$ would be $8 + 9 = (2^3 \times 3^0 + 2^0 \times 3^2)$. Many integers have more than one valid partition, the first being $11$ having the following two partitions. $11 = 2 + 9 = (2^1 \times 3^0 + 2^0 \times 3^2)$ $11 = 8 + 3 = (2^3 \times 3^0 + 2^0 \times 3^1)$ Let's define $P(n)$ as the number of valid partitions of $n$. For example, $P(11) = 2$. Let's consider only the prime integers $q$ which would have a single valid partition such as $P(17)$. The sum of the primes $q \lt 100$ such that $P(q)=1$ equals $233$. Find the sum of the primes $q \lt 1000000$ such that $P(q)=1$.
<p>All positive integers can be partitioned in such a way that each and every term of the partition can be expressed as $2^i \times 3^j$, where $i,j \ge 0$.</p> <p>Let's consider only such partitions where none of the terms can divide any of the other terms. <br/>For example, the partition of $17 = 2 + 6 + 9 = (2^1 \times 3^0 + 2^1 \times 3^1 + 2^0 \times 3^2)$ would not be valid since $2$ can divide $6$. Neither would the partition $17 = 16 + 1 = (2^4 \times 3^0 + 2^0 \times 3^0)$ since $1$ can divide $16$. The only valid partition of $17$ would be $8 + 9 = (2^3 \times 3^0 + 2^0 \times 3^2)$.</p> <p>Many integers have more than one valid partition, the first being $11$ having the following two partitions. <br/>$11 = 2 + 9 = (2^1 \times 3^0 + 2^0 \times 3^2)$ <br/>$11 = 8 + 3 = (2^3 \times 3^0 + 2^0 \times 3^1)$</p> <p>Let's define $P(n)$ as the number of valid partitions of $n$. For example, $P(11) = 2$.</p> <p>Let's consider only the prime integers $q$ which would have a single valid partition such as $P(17)$.</p> <p>The sum of the primes $q \lt 100$ such that $P(q)=1$ equals $233$.</p> <p>Find the sum of the primes $q \lt 1000000$ such that $P(q)=1$.</p>
3053105
Saturday, 16th April 2011, 01:00 pm
1374
35%
medium
791
Average and Variance
Denote the average of $k$ numbers $x_1, ..., x_k$ by $\bar{x} = \frac{1}{k} \sum_i x_i$. Their variance is defined as $\frac{1}{k} \sum_i \left( x_i - \bar{x} \right) ^ 2$. Let $S(n)$ be the sum of all quadruples of integers $(a,b,c,d)$ satisfying $1 \leq a \leq b \leq c \leq d \leq n$ such that their average is exactly twice their variance. For $n=5$, there are $5$ such quadruples, namely: $(1, 1, 1, 3), (1, 1, 3, 3), (1, 2, 3, 4), (1, 3, 4, 4), (2, 2, 3, 5)$. Hence $S(5)=48$. You are also given $S(10^3)=37048340$. Find $S(10^8)$. Give your answer modulo $433494437$.
Denote the average of $k$ numbers $x_1, ..., x_k$ by $\bar{x} = \frac{1}{k} \sum_i x_i$. Their variance is defined as $\frac{1}{k} \sum_i \left( x_i - \bar{x} \right) ^ 2$. Let $S(n)$ be the sum of all quadruples of integers $(a,b,c,d)$ satisfying $1 \leq a \leq b \leq c \leq d \leq n$ such that their average is exactly twice their variance. For $n=5$, there are $5$ such quadruples, namely: $(1, 1, 1, 3), (1, 1, 3, 3), (1, 2, 3, 4), (1, 3, 4, 4), (2, 2, 3, 5)$. Hence $S(5)=48$. You are also given $S(10^3)=37048340$. Find $S(10^8)$. Give your answer modulo $433494437$.
<p>Denote the average of $k$ numbers $x_1, ..., x_k$ by $\bar{x} = \frac{1}{k} \sum_i x_i$. Their variance is defined as $\frac{1}{k} \sum_i \left( x_i - \bar{x} \right) ^ 2$.</p> <p>Let $S(n)$ be the sum of all quadruples of integers $(a,b,c,d)$ satisfying $1 \leq a \leq b \leq c \leq d \leq n$ such that their average is exactly twice their variance.</p> <p>For $n=5$, there are $5$ such quadruples, namely: $(1, 1, 1, 3), (1, 1, 3, 3), (1, 2, 3, 4), (1, 3, 4, 4), (2, 2, 3, 5)$.</p> <p>Hence $S(5)=48$. You are also given $S(10^3)=37048340$.</p> <p>Find $S(10^8)$. Give your answer modulo $433494437$.</p>
404890862
Sunday, 27th March 2022, 02:00 am
168
60%
hard
360
Scary Sphere
Given two points $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$ in three dimensional space, the Manhattan distance between those points is defined as$|x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|$. Let $C(r)$ be a sphere with radius $r$ and center in the origin $O(0,0,0)$. Let $I(r)$ be the set of all points with integer coordinates on the surface of $C(r)$. Let $S(r)$ be the sum of the Manhattan distances of all elements of $I(r)$ to the origin $O$. E.g. $S(45)=34518$. Find $S(10^{10})$.
Given two points $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$ in three dimensional space, the Manhattan distance between those points is defined as$|x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|$. Let $C(r)$ be a sphere with radius $r$ and center in the origin $O(0,0,0)$. Let $I(r)$ be the set of all points with integer coordinates on the surface of $C(r)$. Let $S(r)$ be the sum of the Manhattan distances of all elements of $I(r)$ to the origin $O$. E.g. $S(45)=34518$. Find $S(10^{10})$.
<p> Given two points $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$ in three dimensional space, the <strong>Manhattan distance</strong> between those points is defined as<br/>$|x_1 - x_2| + |y_1 - y_2| + |z_1 - z_2|$. </p> <p> Let $C(r)$ be a sphere with radius $r$ and center in the origin $O(0,0,0)$.<br/> Let $I(r)$ be the set of all points with integer coordinates on the surface of $C(r)$.<br/> Let $S(r)$ be the sum of the Manhattan distances of all elements of $I(r)$ to the origin $O$. </p> <p> E.g. $S(45)=34518$. </p> <p> Find $S(10^{10})$. </p>
878825614395267072
Sunday, 27th November 2011, 01:00 am
651
50%
medium
591
Best Approximations by Quadratic Integers
Given a non-square integer $d$, any real $x$ can be approximated arbitrarily close by quadratic integers $a+b\sqrt{d}$, where $a,b$ are integers. For example, the following inequalities approximate $\pi$ with precision $10^{-13}$: $$4375636191520\sqrt{2}-6188084046055 < \pi < 721133315582\sqrt{2}-1019836515172 $$ We call $BQA_d(x,n)$ the quadratic integer closest to $x$ with the absolute values of $a,b$ not exceeding $n$. We also define the integral part of a quadratic integer as $I_d(a+b\sqrt{d}) = a$. You are given that: $BQA_2(\pi,10) = 6 - 2\sqrt{2}$ $BQA_5(\pi,100)=26\sqrt{5}-55$ $BQA_7(\pi,10^6)=560323 - 211781\sqrt{7}$ $I_2(BQA_2(\pi,10^{13}))=-6188084046055$Find the sum of $|I_d(BQA_d(\pi,10^{13}))|$ for all non-square positive integers less than 100.
Given a non-square integer $d$, any real $x$ can be approximated arbitrarily close by quadratic integers $a+b\sqrt{d}$, where $a,b$ are integers. For example, the following inequalities approximate $\pi$ with precision $10^{-13}$: $$4375636191520\sqrt{2}-6188084046055 < \pi < 721133315582\sqrt{2}-1019836515172 $$ We call $BQA_d(x,n)$ the quadratic integer closest to $x$ with the absolute values of $a,b$ not exceeding $n$. We also define the integral part of a quadratic integer as $I_d(a+b\sqrt{d}) = a$. You are given that: $BQA_2(\pi,10) = 6 - 2\sqrt{2}$ $BQA_5(\pi,100)=26\sqrt{5}-55$ $BQA_7(\pi,10^6)=560323 - 211781\sqrt{7}$ $I_2(BQA_2(\pi,10^{13}))=-6188084046055$Find the sum of $|I_d(BQA_d(\pi,10^{13}))|$ for all non-square positive integers less than 100.
<p>Given a non-square integer $d$, any real $x$ can be approximated arbitrarily close by <b>quadratic integers</b> $a+b\sqrt{d}$, where $a,b$ are integers. For example, the following inequalities approximate $\pi$ with precision $10^{-13}$:<br> $$4375636191520\sqrt{2}-6188084046055 &lt; \pi &lt; 721133315582\sqrt{2}-1019836515172 $$<br/> We call $BQA_d(x,n)$ the quadratic integer closest to $x$ with the absolute values of $a,b$ not exceeding $n$.<br/> We also define the integral part of a quadratic integer as $I_d(a+b\sqrt{d}) = a$.</br></p> <p>You are given that:</p> <ul><li>$BQA_2(\pi,10) = 6 - 2\sqrt{2}$</li> <li>$BQA_5(\pi,100)=26\sqrt{5}-55$</li> <li>$BQA_7(\pi,10^6)=560323 - 211781\sqrt{7}$</li> <li>$I_2(BQA_2(\pi,10^{13}))=-6188084046055$</li></ul><p>Find the sum of $|I_d(BQA_d(\pi,10^{13}))|$ for all non-square positive integers less than 100.</p>
526007984625966
Saturday, 18th February 2017, 01:00 pm
218
95%
hard
505
Bidirectional Recurrence
Let: $\begin{array}{ll} x(0)&=0 \\ x(1)&=1 \\ x(2k)&=(3x(k)+2x(\lfloor \frac k 2 \rfloor)) \text{ mod } 2^{60} \text{ for } k \ge 1 \text {, where } \lfloor \text { } \rfloor \text { is the floor function} \\ x(2k+1)&=(2x(k)+3x(\lfloor \frac k 2 \rfloor)) \text{ mod } 2^{60} \text{ for } k \ge 1 \\ y_n(k)&=\left\{{\begin{array}{lc} x(k) && \text{if } k \ge n \\ 2^{60} - 1 - max(y_n(2k),y_n(2k+1)) && \text{if } k < n \end{array}} \right. \\ A(n)&=y_n(1) \end{array}$ You are given: $\begin{array}{ll} x(2)&=3 \\ x(3)&=2 \\ x(4)&=11 \\ y_4(4)&=11 \\ y_4(3)&=2^{60}-9\\ y_4(2)&=2^{60}-12 \\ y_4(1)&=A(4)=8 \\ A(10)&=2^{60}-34\\ A(10^3)&=101881 \end{array}$ Find $A(10^{12})$.
Let: $\begin{array}{ll} x(0)&=0 \\ x(1)&=1 \\ x(2k)&=(3x(k)+2x(\lfloor \frac k 2 \rfloor)) \text{ mod } 2^{60} \text{ for } k \ge 1 \text {, where } \lfloor \text { } \rfloor \text { is the floor function} \\ x(2k+1)&=(2x(k)+3x(\lfloor \frac k 2 \rfloor)) \text{ mod } 2^{60} \text{ for } k \ge 1 \\ y_n(k)&=\left\{{\begin{array}{lc} x(k) && \text{if } k \ge n \\ 2^{60} - 1 - max(y_n(2k),y_n(2k+1)) && \text{if } k < n \end{array}} \right. \\ A(n)&=y_n(1) \end{array}$ You are given: $\begin{array}{ll} x(2)&=3 \\ x(3)&=2 \\ x(4)&=11 \\ y_4(4)&=11 \\ y_4(3)&=2^{60}-9\\ y_4(2)&=2^{60}-12 \\ y_4(1)&=A(4)=8 \\ A(10)&=2^{60}-34\\ A(10^3)&=101881 \end{array}$ Find $A(10^{12})$.
<p>Let:</p> <p style="margin-left:32px;">$\begin{array}{ll} x(0)&amp;=0 \\ x(1)&amp;=1 \\ x(2k)&amp;=(3x(k)+2x(\lfloor \frac k 2 \rfloor)) \text{ mod } 2^{60} \text{ for } k \ge 1 \text {, where } \lfloor \text { } \rfloor \text { is the floor function} \\ x(2k+1)&amp;=(2x(k)+3x(\lfloor \frac k 2 \rfloor)) \text{ mod } 2^{60} \text{ for } k \ge 1 \\ y_n(k)&amp;=\left\{{\begin{array}{lc} x(k) &amp;&amp; \text{if } k \ge n \\ 2^{60} - 1 - max(y_n(2k),y_n(2k+1)) &amp;&amp; \text{if } k &lt; n \end{array}} \right. \\ A(n)&amp;=y_n(1) \end{array}$</p> <p>You are given:</p> <p style="margin-left:32px;">$\begin{array}{ll} x(2)&amp;=3 \\ x(3)&amp;=2 \\ x(4)&amp;=11 \\ y_4(4)&amp;=11 \\ y_4(3)&amp;=2^{60}-9\\ y_4(2)&amp;=2^{60}-12 \\ y_4(1)&amp;=A(4)=8 \\ A(10)&amp;=2^{60}-34\\ A(10^3)&amp;=101881 \end{array}$</p> Find $A(10^{12})$.
714591308667615832
Sunday, 1st March 2015, 01:00 am
232
90%
hard
890
Binary Partitions
Let $p(n)$ be the number of ways to write $n$ as the sum of powers of two, ignoring order. For example, $p(7) = 6$, the partitions being $$ \begin{align} 7 &= 1+1+1+1+1+1+1 \\ &=1+1+1+1+1+2 \\ &=1+1+1+2+2 \\ &=1+1+1+4 \\ &=1+2+2+2 \\ &=1+2+4 \end{align} $$ You are also given $p(7^7) \equiv 144548435 \pmod {10^9+7}$. Find $p(7^{777})$. Give your answer modulo $10^9 + 7$.
Let $p(n)$ be the number of ways to write $n$ as the sum of powers of two, ignoring order. For example, $p(7) = 6$, the partitions being $$ \begin{align} 7 &= 1+1+1+1+1+1+1 \\ &=1+1+1+1+1+2 \\ &=1+1+1+2+2 \\ &=1+1+1+4 \\ &=1+2+2+2 \\ &=1+2+4 \end{align} $$ You are also given $p(7^7) \equiv 144548435 \pmod {10^9+7}$. Find $p(7^{777})$. Give your answer modulo $10^9 + 7$.
<p>Let $p(n)$ be the number of ways to write $n$ as the sum of powers of two, ignoring order.</p> <p>For example, $p(7) = 6$, the partitions being $$ \begin{align} 7 &amp;= 1+1+1+1+1+1+1 \\ &amp;=1+1+1+1+1+2 \\ &amp;=1+1+1+2+2 \\ &amp;=1+1+1+4 \\ &amp;=1+2+2+2 \\ &amp;=1+2+4 \end{align} $$ You are also given $p(7^7) \equiv 144548435 \pmod {10^9+7}$.</p> <p>Find $p(7^{777})$. Give your answer modulo $10^9 + 7$.</p>
820442179
Sunday, 12th May 2024, 02:00 am
192
55%
medium
376
Nontransitive Sets of Dice
Consider the following set of dice with nonstandard pips: Die $A$: $1$ $4$ $4$ $4$ $4$ $4$ Die $B$: $2$ $2$ $2$ $5$ $5$ $5$ Die $C$: $3$ $3$ $3$ $3$ $3$ $6$ A game is played by two players picking a die in turn and rolling it. The player who rolls the highest value wins. If the first player picks die $A$ and the second player picks die $B$ we get $P(\text{second player wins}) = 7/12 \gt 1/2$. If the first player picks die $B$ and the second player picks die $C$ we get $P(\text{second player wins}) = 7/12 \gt 1/2$. If the first player picks die $C$ and the second player picks die $A$ we get $P(\text{second player wins}) = 25/36 \gt 1/2$. So whatever die the first player picks, the second player can pick another die and have a larger than $50\%$ chance of winning. A set of dice having this property is called a nontransitive set of dice. We wish to investigate how many sets of nontransitive dice exist. We will assume the following conditions:There are three six-sided dice with each side having between $1$ and $N$ pips, inclusive. Dice with the same set of pips are equal, regardless of which side on the die the pips are located. The same pip value may appear on multiple dice; if both players roll the same value neither player wins. The sets of dice $\{A,B,C\}$, $\{B,C,A\}$ and $\{C,A,B\}$ are the same set. For $N = 7$ we find there are $9780$ such sets. How many are there for $N = 30$?
Consider the following set of dice with nonstandard pips: Die $A$: $1$ $4$ $4$ $4$ $4$ $4$ Die $B$: $2$ $2$ $2$ $5$ $5$ $5$ Die $C$: $3$ $3$ $3$ $3$ $3$ $6$ A game is played by two players picking a die in turn and rolling it. The player who rolls the highest value wins. If the first player picks die $A$ and the second player picks die $B$ we get $P(\text{second player wins}) = 7/12 \gt 1/2$. If the first player picks die $B$ and the second player picks die $C$ we get $P(\text{second player wins}) = 7/12 \gt 1/2$. If the first player picks die $C$ and the second player picks die $A$ we get $P(\text{second player wins}) = 25/36 \gt 1/2$. So whatever die the first player picks, the second player can pick another die and have a larger than $50\%$ chance of winning. A set of dice having this property is called a nontransitive set of dice. We wish to investigate how many sets of nontransitive dice exist. We will assume the following conditions:There are three six-sided dice with each side having between $1$ and $N$ pips, inclusive. Dice with the same set of pips are equal, regardless of which side on the die the pips are located. The same pip value may appear on multiple dice; if both players roll the same value neither player wins. The sets of dice $\{A,B,C\}$, $\{B,C,A\}$ and $\{C,A,B\}$ are the same set. For $N = 7$ we find there are $9780$ such sets. How many are there for $N = 30$?
<p> Consider the following set of dice with nonstandard pips: </p> <p> Die $A$: $1$ $4$ $4$ $4$ $4$ $4$<br/> Die $B$: $2$ $2$ $2$ $5$ $5$ $5$<br/> Die $C$: $3$ $3$ $3$ $3$ $3$ $6$<br/></p> <p> A game is played by two players picking a die in turn and rolling it. The player who rolls the highest value wins. </p> <p> If the first player picks die $A$ and the second player picks die $B$ we get<br/> $P(\text{second player wins}) = 7/12 \gt 1/2$.</p> <p> If the first player picks die $B$ and the second player picks die $C$ we get<br/> $P(\text{second player wins}) = 7/12 \gt 1/2$.</p> <p> If the first player picks die $C$ and the second player picks die $A$ we get<br/> $P(\text{second player wins}) = 25/36 \gt 1/2$.</p> <p> So whatever die the first player picks, the second player can pick another die and have a larger than $50\%$ chance of winning.<br/> A set of dice having this property is called a <strong>nontransitive set of dice</strong>. </p> <p> We wish to investigate how many sets of nontransitive dice exist. We will assume the following conditions:</p><ul><li>There are three six-sided dice with each side having between $1$ and $N$ pips, inclusive.</li> <li>Dice with the same set of pips are equal, regardless of which side on the die the pips are located.</li> <li>The same pip value may appear on multiple dice; if both players roll the same value neither player wins.</li> <li>The sets of dice $\{A,B,C\}$, $\{B,C,A\}$ and $\{C,A,B\}$ are the same set.</li> </ul><p> For $N = 7$ we find there are $9780$ such sets.<br/> How many are there for $N = 30$? </p>
973059630185670
Sunday, 18th March 2012, 01:00 am
319
70%
hard
115
Counting Block Combinations II
NOTE: This is a more difficult version of Problem 114. A row measuring $n$ units in length has red blocks with a minimum length of $m$ units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square. Let the fill-count function, $F(m, n)$, represent the number of ways that a row can be filled. For example, $F(3, 29) = 673135$ and $F(3, 30) = 1089155$. That is, for $m = 3$, it can be seen that $n = 30$ is the smallest value for which the fill-count function first exceeds one million. In the same way, for $m = 10$, it can be verified that $F(10, 56) = 880711$ and $F(10, 57) = 1148904$, so $n = 57$ is the least value for which the fill-count function first exceeds one million. For $m = 50$, find the least value of $n$ for which the fill-count function first exceeds one million.
NOTE: This is a more difficult version of Problem 114. A row measuring $n$ units in length has red blocks with a minimum length of $m$ units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square. Let the fill-count function, $F(m, n)$, represent the number of ways that a row can be filled. For example, $F(3, 29) = 673135$ and $F(3, 30) = 1089155$. That is, for $m = 3$, it can be seen that $n = 30$ is the smallest value for which the fill-count function first exceeds one million. In the same way, for $m = 10$, it can be verified that $F(10, 56) = 880711$ and $F(10, 57) = 1148904$, so $n = 57$ is the least value for which the fill-count function first exceeds one million. For $m = 50$, find the least value of $n$ for which the fill-count function first exceeds one million.
<p class="note">NOTE: This is a more difficult version of <a href="problem=114">Problem 114</a>.</p> <p>A row measuring $n$ units in length has red blocks with a minimum length of $m$ units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square.</p> <p>Let the fill-count function, $F(m, n)$, represent the number of ways that a row can be filled.</p> <p>For example, $F(3, 29) = 673135$ and $F(3, 30) = 1089155$.</p> <p>That is, for $m = 3$, it can be seen that $n = 30$ is the smallest value for which the fill-count function first exceeds one million.</p> <p>In the same way, for $m = 10$, it can be verified that $F(10, 56) = 880711$ and $F(10, 57) = 1148904$, so $n = 57$ is the least value for which the fill-count function first exceeds one million.</p> <p>For $m = 50$, find the least value of $n$ for which the fill-count function first exceeds one million.</p>
168
Friday, 24th February 2006, 06:00 pm
11053
35%
medium
171
Square Sum of the Digital Squares
For a positive integer $n$, let $f(n)$ be the sum of the squares of the digits (in base $10$) of $n$, e.g. \begin{align} f(3) &= 3^2 = 9,\\ f(25) &= 2^2 + 5^2 = 4 + 25 = 29,\\ f(442) &= 4^2 + 4^2 + 2^2 = 16 + 16 + 4 = 36\\ \end{align} Find the last nine digits of the sum of all $n$, $0 \lt n \lt 10^{20}$, such that $f(n)$ is a perfect square.
For a positive integer $n$, let $f(n)$ be the sum of the squares of the digits (in base $10$) of $n$, e.g. \begin{align} f(3) &= 3^2 = 9,\\ f(25) &= 2^2 + 5^2 = 4 + 25 = 29,\\ f(442) &= 4^2 + 4^2 + 2^2 = 16 + 16 + 4 = 36\\ \end{align} Find the last nine digits of the sum of all $n$, $0 \lt n \lt 10^{20}$, such that $f(n)$ is a perfect square.
<p>For a positive integer $n$, let $f(n)$ be the sum of the squares of the digits (in base $10$) of $n$, e.g.</p> \begin{align} f(3) &= 3^2 = 9,\\ f(25) &= 2^2 + 5^2 = 4 + 25 = 29,\\ f(442) &= 4^2 + 4^2 + 2^2 = 16 + 16 + 4 = 36\\ \end{align} <p>Find the last nine digits of the sum of all $n$, $0 \lt n \lt 10^{20}$, such that $f(n)$ is a perfect square.</p>
142989277
Saturday, 8th December 2007, 05:00 am
3134
65%
hard
124
Ordered Radicals
The radical of $n$, $\operatorname{rad}(n)$, is the product of the 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$. If we calculate $\operatorname{rad}(n)$ for $1 \le n \le 10$, then sort them on $\operatorname{rad}(n)$, and sorting on $n$ if the radical values are equal, we get: Unsorted   Sorted n rad(n)   n rad(n) k 11   111 22   222 33   423 42   824 55   335 66   936 77   557 82   668 93   779 1010   101010 Let $E(k)$ be the $k$-th element in the sorted $n$ column; for example, $E(4) = 8$ and $E(6) = 9$. If $\operatorname{rad}(n)$ is sorted for $1 \le n \le 100000$, find $E(10000)$.
The radical of $n$, $\operatorname{rad}(n)$, is the product of the 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$. If we calculate $\operatorname{rad}(n)$ for $1 \le n \le 10$, then sort them on $\operatorname{rad}(n)$, and sorting on $n$ if the radical values are equal, we get: Unsorted   Sorted n rad(n)   n rad(n) k 11   111 22   222 33   423 42   824 55   335 66   936 77   557 82   668 93   779 1010   101010 Let $E(k)$ be the $k$-th element in the sorted $n$ column; for example, $E(4) = 8$ and $E(6) = 9$. If $\operatorname{rad}(n)$ is sorted for $1 \le n \le 100000$, find $E(10000)$.
<p>The radical of $n$, $\operatorname{rad}(n)$, is the product of the 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>If we calculate $\operatorname{rad}(n)$ for $1 \le n \le 10$, then sort them on $\operatorname{rad}(n)$, and sorting on $n$ if the radical values are equal, we get:</p> <table class="center"> <tr> <th colspan="2">Unsorted</th> <td class="w25"> </td> <th colspan="3">Sorted</th> </tr> <tr> <th class="w50"><i>n</i></th> <th class="w50">rad(<i>n</i>)</th> <td> </td> <th class="w50"><i>n</i></th> <th class="w50">rad(<i>n</i>)</th> <th class="w50">k</th> </tr> <tr> <td>1</td><td>1</td> <td> </td> <td>1</td><td>1</td><td>1</td> </tr> <tr> <td>2</td><td>2</td> <td> </td> <td>2</td><td>2</td><td>2</td> </tr> <tr> <td>3</td><td>3</td> <td> </td> <td>4</td><td>2</td><td>3</td> </tr> <tr> <td>4</td><td>2</td> <td> </td> <td>8</td><td>2</td><td>4</td> </tr> <tr> <td>5</td><td>5</td> <td> </td> <td>3</td><td>3</td><td>5</td> </tr> <tr> <td>6</td><td>6</td> <td> </td> <td>9</td><td>3</td><td>6</td> </tr> <tr> <td>7</td><td>7</td> <td> </td> <td>5</td><td>5</td><td>7</td> </tr> <tr> <td>8</td><td>2</td> <td> </td> <td>6</td><td>6</td><td>8</td> </tr> <tr> <td>9</td><td>3</td> <td> </td> <td>7</td><td>7</td><td>9</td> </tr> <tr> <td>10</td><td>10</td> <td> </td> <td>10</td><td>10</td><td>10</td> </tr> </table> <p>Let $E(k)$ be the $k$-th element in the sorted $n$ column; for example, $E(4) = 8$ and $E(6) = 9$.</p> <p>If $\operatorname{rad}(n)$ is sorted for $1 \le n \le 100000$, find $E(10000)$.</p>
21417
Friday, 14th July 2006, 06:00 pm
15011
25%
easy
302
Strong Achilles Numbers
A positive integer $n$ is powerful if $p^2$ is a divisor of $n$ for every prime factor $p$ in $n$. A positive integer $n$ is a perfect power if $n$ can be expressed as a power of another positive integer. A positive integer $n$ is an Achilles number if $n$ is powerful but not a perfect power. For example, $864$ and $1800$ are Achilles numbers: $864 = 2^5 \cdot 3^3$ and $1800 = 2^3 \cdot 3^2 \cdot 5^2$. We shall call a positive integer $S$ a Strong Achilles number if both $S$ and $\phi(S)$ are Achilles numbers.1 For example, $864$ is a Strong Achilles number: $\phi(864) = 288 = 2^5 \cdot 3^2$. However, $1800$ isn't a Strong Achilles number because: $\phi(1800) = 480 = 2^5 \cdot 3^1 \cdot 5^1$. There are $7$ Strong Achilles numbers below $10^4$ and $656$ below $10^8$. How many Strong Achilles numbers are there below $10^{18}$? 1 $\phi$ denotes Euler's totient function.
A positive integer $n$ is powerful if $p^2$ is a divisor of $n$ for every prime factor $p$ in $n$. A positive integer $n$ is a perfect power if $n$ can be expressed as a power of another positive integer. A positive integer $n$ is an Achilles number if $n$ is powerful but not a perfect power. For example, $864$ and $1800$ are Achilles numbers: $864 = 2^5 \cdot 3^3$ and $1800 = 2^3 \cdot 3^2 \cdot 5^2$. We shall call a positive integer $S$ a Strong Achilles number if both $S$ and $\phi(S)$ are Achilles numbers.1 For example, $864$ is a Strong Achilles number: $\phi(864) = 288 = 2^5 \cdot 3^2$. However, $1800$ isn't a Strong Achilles number because: $\phi(1800) = 480 = 2^5 \cdot 3^1 \cdot 5^1$. There are $7$ Strong Achilles numbers below $10^4$ and $656$ below $10^8$. How many Strong Achilles numbers are there below $10^{18}$? 1 $\phi$ denotes Euler's totient function.
<p> A positive integer $n$ is <strong>powerful</strong> if $p^2$ is a divisor of $n$ for every prime factor $p$ in $n$. </p> <p> A positive integer $n$ is a <strong>perfect power</strong> if $n$ can be expressed as a power of another positive integer. </p> <p> A positive integer $n$ is an <strong>Achilles number</strong> if $n$ is powerful but not a perfect power. For example, $864$ and $1800$ are Achilles numbers: $864 = 2^5 \cdot 3^3$ and $1800 = 2^3 \cdot 3^2 \cdot 5^2$. </p> <p> We shall call a positive integer $S$ a <dfn>Strong Achilles number</dfn> if both $S$ and $\phi(S)$ are Achilles numbers.<sup>1</sup><br/> For example, $864$ is a Strong Achilles number: $\phi(864) = 288 = 2^5 \cdot 3^2$. However, $1800$ isn't a Strong Achilles number because: $\phi(1800) = 480 = 2^5 \cdot 3^1 \cdot 5^1$. </p> <p>There are $7$ Strong Achilles numbers below $10^4$ and $656$ below $10^8$. </p> <p> How many Strong Achilles numbers are there below $10^{18}$? </p> <p> <sup>1</sup> $\phi$ denotes <strong>Euler's totient function</strong>. </p>
1170060
Saturday, 18th September 2010, 07:00 pm
837
60%
hard
616
Creative Numbers
Alice plays the following game, she starts with a list of integers $L$ and on each step she can either: remove two elements $a$ and $b$ from $L$ and add $a^b$ to $L$ or conversely remove an element $c$ from $L$ that can be written as $a^b$, with $a$ and $b$ being two integers such that $a, b > 1$, and add both $a$ and $b$ to $L$ For example starting from the list $L=\{8\}$, Alice can remove $8$ and add $2$ and $3$ resulting in $L=\{2,3\}$ in a first step. Then she can obtain $L=\{9\}$ in a second step. Note that the same integer is allowed to appear multiple times in the list. An integer $n>1$ is said to be creative if for any integer $m \gt 1$ Alice can obtain a list that contains $m$ starting from $L=\{n\}$. Find the sum of all creative integers less than or equal to $10^{12}$.
Alice plays the following game, she starts with a list of integers $L$ and on each step she can either: remove two elements $a$ and $b$ from $L$ and add $a^b$ to $L$ or conversely remove an element $c$ from $L$ that can be written as $a^b$, with $a$ and $b$ being two integers such that $a, b > 1$, and add both $a$ and $b$ to $L$ For example starting from the list $L=\{8\}$, Alice can remove $8$ and add $2$ and $3$ resulting in $L=\{2,3\}$ in a first step. Then she can obtain $L=\{9\}$ in a second step. Note that the same integer is allowed to appear multiple times in the list. An integer $n>1$ is said to be creative if for any integer $m \gt 1$ Alice can obtain a list that contains $m$ starting from $L=\{n\}$. Find the sum of all creative integers less than or equal to $10^{12}$.
<p>Alice plays the following game, she starts with a list of integers $L$ and on each step she can either: </p><ul><li>remove two elements $a$ and $b$ from $L$ and add $a^b$ to $L$</li> <li>or conversely remove an element $c$ from $L$ that can be written as $a^b$, with $a$ and $b$ being two integers such that $a, b &gt; 1$, and add both $a$ and $b$ to $L$</li></ul> <p>For example starting from the list $L=\{8\}$, Alice can remove $8$ and add $2$ and $3$ resulting in $L=\{2,3\}$ in a first step. Then she can obtain $L=\{9\}$ in a second step.</p> <p>Note that the same integer is allowed to appear multiple times in the list.</p> <p>An integer $n&gt;1$ is said to be <dfn>creative</dfn> if for any integer $m \gt 1$ Alice can obtain a list that contains $m$ starting from $L=\{n\}$. </p><p>Find the sum of all creative integers less than or equal to $10^{12}$.</p>
310884668312456458
Saturday, 16th December 2017, 01:00 pm
529
40%
medium
603
Substring Sums of Prime Concatenations
Let $S(n)$ be the sum of all contiguous integer-substrings that can be formed from the integer $n$. The substrings need not be distinct. For example, $S(2024) = 2 + 0 + 2 + 4 + 20 + 02 + 24 + 202 + 024 + 2024 = 2304$. Let $P(n)$ be the integer formed by concatenating the first $n$ primes together. For example, $P(7) = 2357111317$. Let $C(n, k)$ be the integer formed by concatenating $k$ copies of $P(n)$ together. For example, $C(7, 3) = 235711131723571113172357111317$. Evaluate $S(C(10^6, 10^{12})) \bmod (10^9 + 7)$.
Let $S(n)$ be the sum of all contiguous integer-substrings that can be formed from the integer $n$. The substrings need not be distinct. For example, $S(2024) = 2 + 0 + 2 + 4 + 20 + 02 + 24 + 202 + 024 + 2024 = 2304$. Let $P(n)$ be the integer formed by concatenating the first $n$ primes together. For example, $P(7) = 2357111317$. Let $C(n, k)$ be the integer formed by concatenating $k$ copies of $P(n)$ together. For example, $C(7, 3) = 235711131723571113172357111317$. Evaluate $S(C(10^6, 10^{12})) \bmod (10^9 + 7)$.
<p>Let $S(n)$ be the sum of all contiguous integer-substrings that can be formed from the integer $n$. The substrings need not be distinct. </p> <p>For example, $S(2024) = 2 + 0 + 2 + 4 + 20 + 02 + 24 + 202 + 024 + 2024 = 2304$.</p> <p>Let $P(n)$ be the integer formed by concatenating the first $n$ primes together. For example, $P(7) = 2357111317$.</p> <p>Let $C(n, k)$ be the integer formed by concatenating $k$ copies of $P(n)$ together. For example, $C(7, 3) = 235711131723571113172357111317$.</p> <p>Evaluate $S(C(10^6, 10^{12})) \bmod (10^9 + 7)$.</p>
879476477
Sunday, 14th May 2017, 01:00 am
470
45%
medium
712
Exponent Difference
For any integer $n>0$ and prime number $p,$ define $\nu_p(n)$ as the greatest integer $r$ such that $p^r$ divides $n$. Define $$D(n, m) = \sum_{p \text{ prime}} \left| \nu_p(n) - \nu_p(m)\right|.$$ For example, $D(14,24) = 4$. Furthermore, define $$S(N) = \sum_{1 \le n, m \le N} D(n, m).$$ You are given $S(10) = 210$ and $S(10^2) = 37018$. Find $S(10^{12})$. Give your answer modulo $1\,000\,000\,007$.
For any integer $n>0$ and prime number $p,$ define $\nu_p(n)$ as the greatest integer $r$ such that $p^r$ divides $n$. Define $$D(n, m) = \sum_{p \text{ prime}} \left| \nu_p(n) - \nu_p(m)\right|.$$ For example, $D(14,24) = 4$. Furthermore, define $$S(N) = \sum_{1 \le n, m \le N} D(n, m).$$ You are given $S(10) = 210$ and $S(10^2) = 37018$. Find $S(10^{12})$. Give your answer modulo $1\,000\,000\,007$.
<p> For any integer $n&gt;0$ and prime number $p,$ define $\nu_p(n)$ as the greatest integer $r$ such that $p^r$ divides $n$. </p> <p> Define $$D(n, m) = \sum_{p \text{ prime}} \left| \nu_p(n) - \nu_p(m)\right|.$$ For example, $D(14,24) = 4$. </p> <p> Furthermore, define $$S(N) = \sum_{1 \le n, m \le N} D(n, m).$$ You are given $S(10) = 210$ and $S(10^2) = 37018$. </p> <p> Find $S(10^{12})$. Give your answer modulo $1\,000\,000\,007$. </p>
413876461
Saturday, 18th April 2020, 11:00 pm
554
25%
easy
787
Bézout's Game
Two players play a game with two piles of stones. They take alternating turns. If there are currently $a$ stones in the first pile and $b$ stones in the second, a turn consists of removing $c\geq 0$ stones from the first pile and $d\geq 0$ from the second in such a way that $ad-bc=\pm1$. The winner is the player who first empties one of the piles. Note that the game is only playable if the sizes of the two piles are coprime. A game state $(a, b)$ is a winning position if the next player can guarantee a win with optimal play. Define $H(N)$ to be the number of winning positions $(a, b)$ with $\gcd(a,b)=1$, $a > 0$, $b > 0$ and $a+b \leq N$. Note the order matters, so for example $(2,1)$ and $(1,2)$ are distinct positions. You are given $H(4)=5$ and $H(100)=2043$. Find $H(10^9)$.
Two players play a game with two piles of stones. They take alternating turns. If there are currently $a$ stones in the first pile and $b$ stones in the second, a turn consists of removing $c\geq 0$ stones from the first pile and $d\geq 0$ from the second in such a way that $ad-bc=\pm1$. The winner is the player who first empties one of the piles. Note that the game is only playable if the sizes of the two piles are coprime. A game state $(a, b)$ is a winning position if the next player can guarantee a win with optimal play. Define $H(N)$ to be the number of winning positions $(a, b)$ with $\gcd(a,b)=1$, $a > 0$, $b > 0$ and $a+b \leq N$. Note the order matters, so for example $(2,1)$ and $(1,2)$ are distinct positions. You are given $H(4)=5$ and $H(100)=2043$. Find $H(10^9)$.
<p>Two players play a game with two piles of stones. They take alternating turns. If there are currently $a$ stones in the first pile and $b$ stones in the second, a turn consists of removing $c\geq 0$ stones from the first pile and $d\geq 0$ from the second in such a way that $ad-bc=\pm1$. The winner is the player who first empties one of the piles.</p> <p>Note that the game is only playable if the sizes of the two piles are coprime.</p> <p>A game state $(a, b)$ is a winning position if the next player can guarantee a win with optimal play. Define $H(N)$ to be the number of winning positions $(a, b)$ with $\gcd(a,b)=1$, $a &gt; 0$, $b &gt; 0$ and $a+b \leq N$. Note the order matters, so for example $(2,1)$ and $(1,2)$ are distinct positions.</p> <p>You are given $H(4)=5$ and $H(100)=2043$.</p> <p>Find $H(10^9)$.</p>
202642367520564145
Saturday, 26th February 2022, 01:00 pm
208
45%
medium
843
Periodic Circles
This problem involves an iterative procedure that begins with a circle of $n\ge 3$ integers. At each step every number is simultaneously replaced with the absolute difference of its two neighbours. For any initial values, the procedure eventually becomes periodic. Let $S(N)$ be the sum of all possible periods for $3\le n \leq N$. For example, $S(6) = 6$, because the possible periods for $3\le n \leq 6$ are $1, 2, 3$. Specifically, $n=3$ and $n=4$ can each have period $1$ only, while $n=5$ can have period $1$ or $3$, and $n=6$ can have period $1$ or $2$. You are also given $S(30) = 20381$. Find $S(100)$.
This problem involves an iterative procedure that begins with a circle of $n\ge 3$ integers. At each step every number is simultaneously replaced with the absolute difference of its two neighbours. For any initial values, the procedure eventually becomes periodic. Let $S(N)$ be the sum of all possible periods for $3\le n \leq N$. For example, $S(6) = 6$, because the possible periods for $3\le n \leq 6$ are $1, 2, 3$. Specifically, $n=3$ and $n=4$ can each have period $1$ only, while $n=5$ can have period $1$ or $3$, and $n=6$ can have period $1$ or $2$. You are also given $S(30) = 20381$. Find $S(100)$.
<p> This problem involves an iterative procedure that begins with a circle of $n\ge 3$ integers. At each step every number is simultaneously replaced with the absolute difference of its two neighbours.</p> <p> For any initial values, the procedure eventually becomes periodic.</p> <p> Let $S(N)$ be the sum of all possible periods for $3\le n \leq N$. For example, $S(6) = 6$, because the possible periods for $3\le n \leq 6$ are $1, 2, 3$. Specifically, $n=3$ and $n=4$ can each have period $1$ only, while $n=5$ can have period $1$ or $3$, and $n=6$ can have period $1$ or $2$.</p> <p> You are also given $S(30) = 20381$.</p> <p> Find $S(100)$.</p>
2816775424692
Sunday, 14th May 2023, 11:00 am
133
80%
hard
509
Divisor Nim
Anton and Bertrand love to play three pile Nim. However, after a lot of games of Nim they got bored and changed the rules somewhat. They may only take a number of stones from a pile that is a proper divisora proper divisor of $n$ is a divisor of $n$ smaller than $n$ of the number of stones present in the pile. E.g. if a pile at a certain moment contains $24$ stones they may take only $1,2,3,4,6,8$ or $12$ stones from that pile. So if a pile contains one stone they can't take the last stone from it as $1$ isn't a proper divisor of $1$. The first player that can't make a valid move loses the game. Of course both Anton and Bertrand play optimally. The triple $(a, b, c)$ indicates the number of stones in the three piles. Let $S(n)$ be the number of winning positions for the next player for $1 \le a, b, c \le n$.$S(10) = 692$ and $S(100) = 735494$. Find $S(123456787654321)$ modulo $1234567890$.
Anton and Bertrand love to play three pile Nim. However, after a lot of games of Nim they got bored and changed the rules somewhat. They may only take a number of stones from a pile that is a proper divisora proper divisor of $n$ is a divisor of $n$ smaller than $n$ of the number of stones present in the pile. E.g. if a pile at a certain moment contains $24$ stones they may take only $1,2,3,4,6,8$ or $12$ stones from that pile. So if a pile contains one stone they can't take the last stone from it as $1$ isn't a proper divisor of $1$. The first player that can't make a valid move loses the game. Of course both Anton and Bertrand play optimally. The triple $(a, b, c)$ indicates the number of stones in the three piles. Let $S(n)$ be the number of winning positions for the next player for $1 \le a, b, c \le n$.$S(10) = 692$ and $S(100) = 735494$. Find $S(123456787654321)$ modulo $1234567890$.
<p> Anton and Bertrand love to play three pile Nim.<br/> However, after a lot of games of Nim they got bored and changed the rules somewhat.<br/> They may only take a number of stones from a pile that is a <dfn class="tooltip">proper divisor<span class="tooltiptext">a proper divisor of $n$ is a divisor of $n$ smaller than $n$</span></dfn> of the number of stones present in the pile.<br/> E.g. if a pile at a certain moment contains $24$ stones they may take only $1,2,3,4,6,8$ or $12$ stones from that pile.<br/> So if a pile contains one stone they can't take the last stone from it as $1$ isn't a proper divisor of $1$.<br/> The first player that can't make a valid move loses the game.<br/> Of course both Anton and Bertrand play optimally.</p> <p> The triple $(a, b, c)$ indicates the number of stones in the three piles.<br/> Let $S(n)$ be the number of winning positions for the next player for $1 \le a, b, c \le n$.<br/>$S(10) = 692$ and $S(100) = 735494$.</p> <p> Find $S(123456787654321)$ modulo $1234567890$. </p>
151725678
Saturday, 28th March 2015, 01:00 pm
664
45%
medium
719
Number Splitting
We define an $S$-number to be a natural number, $n$, that is a perfect square and its square root can be obtained by splitting the decimal representation of $n$ into $2$ or more numbers then adding the numbers. For example, $81$ is an $S$-number because $\sqrt{81} = 8+1$. $6724$ is an $S$-number: $\sqrt{6724} = 6+72+4$. $8281$ is an $S$-number: $\sqrt{8281} = 8+2+81 = 82+8+1$. $9801$ is an $S$-number: $\sqrt{9801}=98+0+1$. Further we define $T(N)$ to be the sum of all $S$ numbers $n\le N$. You are given $T(10^4) = 41333$. Find $T(10^{12})$.
We define an $S$-number to be a natural number, $n$, that is a perfect square and its square root can be obtained by splitting the decimal representation of $n$ into $2$ or more numbers then adding the numbers. For example, $81$ is an $S$-number because $\sqrt{81} = 8+1$. $6724$ is an $S$-number: $\sqrt{6724} = 6+72+4$. $8281$ is an $S$-number: $\sqrt{8281} = 8+2+81 = 82+8+1$. $9801$ is an $S$-number: $\sqrt{9801}=98+0+1$. Further we define $T(N)$ to be the sum of all $S$ numbers $n\le N$. You are given $T(10^4) = 41333$. Find $T(10^{12})$.
<p> We define an $S$-number to be a natural number, $n$, that is a perfect square and its square root can be obtained by splitting the decimal representation of $n$ into $2$ or more numbers then adding the numbers. </p> <p> For example, $81$ is an $S$-number because $\sqrt{81} = 8+1$.<br/> $6724$ is an $S$-number: $\sqrt{6724} = 6+72+4$. <br/> $8281$ is an $S$-number: $\sqrt{8281} = 8+2+81 = 82+8+1$.<br/> $9801$ is an $S$-number: $\sqrt{9801}=98+0+1$. </p> <p> Further we define $T(N)$ to be the sum of all $S$ numbers $n\le N$. You are given $T(10^4) = 41333$. </p> <p> Find $T(10^{12})$. </p>
128088830547982
Saturday, 6th June 2020, 08:00 pm
4460
5%
easy
600
Integer Sided Equiangular Hexagons
Let $H(n)$ be the number of distinct integer sided equiangular convex hexagons with perimeter not exceeding $n$. Hexagons are distinct if and only if they are not congruent. You are given $H(6) = 1$, $H(12) = 10$, $H(100) = 31248$. Find $H(55106)$. Equiangular hexagons with perimeter not exceeding $12$
Let $H(n)$ be the number of distinct integer sided equiangular convex hexagons with perimeter not exceeding $n$. Hexagons are distinct if and only if they are not congruent. You are given $H(6) = 1$, $H(12) = 10$, $H(100) = 31248$. Find $H(55106)$. Equiangular hexagons with perimeter not exceeding $12$
<p>Let $H(n)$ be the number of distinct integer sided <strong>equiangular</strong> convex hexagons with perimeter not exceeding $n$.<br/> Hexagons are distinct if and only if they are not <strong>congruent</strong>.</p> <p>You are given $H(6) = 1$, $H(12) = 10$, $H(100) = 31248$.<br/> Find $H(55106)$.</p> <div class="center"> <img alt="p600-equiangular-hexagons.png" border="5" src="resources/images/0600_equiangular_hexagons.png?1678992054"/> <p><i>Equiangular hexagons with perimeter not exceeding $12$</i></p> </div>
2668608479740672
Saturday, 22nd April 2017, 04:00 pm
673
35%
medium
222
Sphere Packing
What is the length of the shortest pipe, of internal radius $\pu{50 mm}$, that can fully contain $21$ balls of radii $\pu{30 mm}, \pu{31 mm}, \dots, \pu{50 mm}$? Give your answer in micrometres ($\pu{10^{-6} m}$) rounded to the nearest integer.
What is the length of the shortest pipe, of internal radius $\pu{50 mm}$, that can fully contain $21$ balls of radii $\pu{30 mm}, \pu{31 mm}, \dots, \pu{50 mm}$? Give your answer in micrometres ($\pu{10^{-6} m}$) rounded to the nearest integer.
<p>What is the length of the shortest pipe, of internal radius $\pu{50 mm}$, that can fully contain $21$ balls of radii $\pu{30 mm}, \pu{31 mm}, \dots, \pu{50 mm}$?</p> <p>Give your answer in micrometres ($\pu{10^{-6} m}$) rounded to the nearest integer.</p>
1590933
Friday, 19th December 2008, 01:00 pm
2310
60%
hard
655
Divisible Palindromes
The numbers $545$, $5\,995$ and $15\,151$ are the three smallest palindromes divisible by $109$. There are nine palindromes less than $100\,000$ which are divisible by $109$. How many palindromes less than $10^{32}$ are divisible by $10\,000\,019\,$ ?
The numbers $545$, $5\,995$ and $15\,151$ are the three smallest palindromes divisible by $109$. There are nine palindromes less than $100\,000$ which are divisible by $109$. How many palindromes less than $10^{32}$ are divisible by $10\,000\,019\,$ ?
<p>The numbers $545$, $5\,995$ and $15\,151$ are the three smallest <b>palindromes</b> divisible by $109$. There are nine palindromes less than $100\,000$ which are divisible by $109$.</p> <p>How many palindromes less than $10^{32}$ are divisible by $10\,000\,019\,$ ?</p>
2000008332
Sunday, 10th February 2019, 07:00 am
610
30%
easy
112
Bouncy Numbers
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, $134468$. Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, $66420$. We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, $155349$. Clearly there cannot be any bouncy numbers below one-hundred, but just over half of the numbers below one-thousand ($525$) are bouncy. In fact, the least number for which the proportion of bouncy numbers first reaches $50\%$ is $538$. Surprisingly, bouncy numbers become more and more common and by the time we reach $21780$ the proportion of bouncy numbers is equal to $90\%$. Find the least number for which the proportion of bouncy numbers is exactly $99\%$.
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, $134468$. Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, $66420$. We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, $155349$. Clearly there cannot be any bouncy numbers below one-hundred, but just over half of the numbers below one-thousand ($525$) are bouncy. In fact, the least number for which the proportion of bouncy numbers first reaches $50\%$ is $538$. Surprisingly, bouncy numbers become more and more common and by the time we reach $21780$ the proportion of bouncy numbers is equal to $90\%$. Find the least number for which the proportion of bouncy numbers is exactly $99\%$.
<p>Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, $134468$.</p> <p>Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, $66420$.</p> <p>We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, $155349$.</p> <p>Clearly there cannot be any bouncy numbers below one-hundred, but just over half of the numbers below one-thousand ($525$) are bouncy. In fact, the least number for which the proportion of bouncy numbers first reaches $50\%$ is $538$.</p> <p>Surprisingly, bouncy numbers become more and more common and by the time we reach $21780$ the proportion of bouncy numbers is equal to $90\%$.</p> <p>Find the least number for which the proportion of bouncy numbers is exactly $99\%$.</p>
1587000
Friday, 30th December 2005, 06:00 pm
26945
15%
easy
476
Circle Packing II
Let $R(a, b, c)$ be the maximum area covered by three non-overlapping circles inside a triangle with edge lengths $a$, $b$ and $c$. Let $S(n)$ be the average value of $R(a, b, c)$ over all integer triplets $(a, b, c)$ such that $1 \le a \le b \le c \lt a + b \le n$. You are given $S(2) = R(1, 1, 1) \approx 0.31998$, $S(5) \approx 1.25899$. Find $S(1803)$ rounded to $5$ decimal places behind the decimal point.
Let $R(a, b, c)$ be the maximum area covered by three non-overlapping circles inside a triangle with edge lengths $a$, $b$ and $c$. Let $S(n)$ be the average value of $R(a, b, c)$ over all integer triplets $(a, b, c)$ such that $1 \le a \le b \le c \lt a + b \le n$. You are given $S(2) = R(1, 1, 1) \approx 0.31998$, $S(5) \approx 1.25899$. Find $S(1803)$ rounded to $5$ decimal places behind the decimal point.
<p>Let $R(a, b, c)$ be the maximum area covered by three non-overlapping circles inside a triangle with edge lengths $a$, $b$ and $c$.</p> <p>Let $S(n)$ be the average value of $R(a, b, c)$ over all integer triplets $(a, b, c)$ such that $1 \le a \le b \le c \lt a + b \le n$.</p> <p>You are given $S(2) = R(1, 1, 1) \approx 0.31998$, $S(5) \approx 1.25899$.</p> <p>Find $S(1803)$ rounded to $5$ decimal places behind the decimal point.</p>
110242.87794
Saturday, 14th June 2014, 01:00 pm
453
45%
medium
485
Maximum Number of Divisors
Let $d(n)$ be the number of divisors of $n$. Let $M(n,k)$ be the maximum value of $d(j)$ for $n \le j \le n+k-1$. Let $S(u,k)$ be the sum of $M(n,k)$ for $1 \le n \le u-k+1$. You are given that $S(1000,10)=17176$. Find $S(100\,000\,000, 100\,000)$.
Let $d(n)$ be the number of divisors of $n$. Let $M(n,k)$ be the maximum value of $d(j)$ for $n \le j \le n+k-1$. Let $S(u,k)$ be the sum of $M(n,k)$ for $1 \le n \le u-k+1$. You are given that $S(1000,10)=17176$. Find $S(100\,000\,000, 100\,000)$.
<p> Let $d(n)$ be the number of divisors of $n$.<br/> Let $M(n,k)$ be the maximum value of $d(j)$ for $n \le j \le n+k-1$.<br/> Let $S(u,k)$ be the sum of $M(n,k)$ for $1 \le n \le u-k+1$. </p> <p> You are given that $S(1000,10)=17176$. </p> <p> Find $S(100\,000\,000, 100\,000)$. </p>
51281274340
Saturday, 18th October 2014, 04:00 pm
1293
30%
easy
330
Euler's Number
An infinite sequence of real numbers $a(n)$ is defined for all integers $n$ as follows: $$a(n) = \begin{cases} 1 & n \lt 0\\ \sum \limits_{i = 1}^{\infty}{\dfrac{a(n - i)}{i!}} & n \ge 0 \end{cases}$$ For example, $a(0) = \dfrac{1}{1!} + \dfrac{1}{2!} + \dfrac{1}{3!} + \cdots = e - 1$ $a(1) = \dfrac{e - 1}{1!} + \dfrac{1}{2!} + \dfrac{1}{3!} + \cdots = 2e - 3$ $a(2) = \dfrac{2e - 3}{1!} + \dfrac{e - 1}{2!} + \dfrac{1}{3!} + \cdots = \dfrac{7}{2}e - 6$ with $e = 2.7182818...$ being Euler's constant. It can be shown that $a(n)$ is of the form $\dfrac{A(n)e + B(n)}{n!}$ for integers $A(n)$ and $B(n)$. For example, $a(10) = \dfrac{328161643e - 652694486}{10!}$. Find $A(10^9) + B(10^9)$ and give your answer mod $77\,777\,777$.
An infinite sequence of real numbers $a(n)$ is defined for all integers $n$ as follows: $$a(n) = \begin{cases} 1 & n \lt 0\\ \sum \limits_{i = 1}^{\infty}{\dfrac{a(n - i)}{i!}} & n \ge 0 \end{cases}$$ For example, $a(0) = \dfrac{1}{1!} + \dfrac{1}{2!} + \dfrac{1}{3!} + \cdots = e - 1$ $a(1) = \dfrac{e - 1}{1!} + \dfrac{1}{2!} + \dfrac{1}{3!} + \cdots = 2e - 3$ $a(2) = \dfrac{2e - 3}{1!} + \dfrac{e - 1}{2!} + \dfrac{1}{3!} + \cdots = \dfrac{7}{2}e - 6$ with $e = 2.7182818...$ being Euler's constant. It can be shown that $a(n)$ is of the form $\dfrac{A(n)e + B(n)}{n!}$ for integers $A(n)$ and $B(n)$. For example, $a(10) = \dfrac{328161643e - 652694486}{10!}$. Find $A(10^9) + B(10^9)$ and give your answer mod $77\,777\,777$.
An infinite sequence of real numbers $a(n)$ is defined for all integers $n$ as follows: $$a(n) = \begin{cases} 1 & n \lt 0\\ \sum \limits_{i = 1}^{\infty}{\dfrac{a(n - i)}{i!}} & n \ge 0 \end{cases}$$ <p>For example,<br/></p> <p>$a(0) = \dfrac{1}{1!} + \dfrac{1}{2!} + \dfrac{1}{3!} + \cdots = e - 1$<br/> $a(1) = \dfrac{e - 1}{1!} + \dfrac{1}{2!} + \dfrac{1}{3!} + \cdots = 2e - 3$<br/> $a(2) = \dfrac{2e - 3}{1!} + \dfrac{e - 1}{2!} + \dfrac{1}{3!} + \cdots = \dfrac{7}{2}e - 6$</p> <p>with $e = 2.7182818...$ being Euler's constant.</p> <p>It can be shown that $a(n)$ is of the form $\dfrac{A(n)e + B(n)}{n!}$ for integers $A(n)$ and $B(n)$.</p> <p>For example, $a(10) = \dfrac{328161643e - 652694486}{10!}$.</p> <p>Find $A(10^9) + B(10^9)$ and give your answer mod $77\,777\,777$.</p>
15955822
Sunday, 27th March 2011, 05:00 am
587
70%
hard
280
Ant and Seeds
A laborious ant walks randomly on a $5 \times 5$ grid. The walk starts from the central square. At each step, the ant moves to an adjacent square at random, without leaving the grid; thus there are $2$, $3$ or $4$ possible moves at each step depending on the ant's position. At the start of the walk, a seed is placed on each square of the lower row. When the ant isn't carrying a seed and reaches a square of the lower row containing a seed, it will start to carry the seed. The ant will drop the seed on the first empty square of the upper row it eventually reaches. What's the expected number of steps until all seeds have been dropped in the top row? Give your answer rounded to $6$ decimal places.
A laborious ant walks randomly on a $5 \times 5$ grid. The walk starts from the central square. At each step, the ant moves to an adjacent square at random, without leaving the grid; thus there are $2$, $3$ or $4$ possible moves at each step depending on the ant's position. At the start of the walk, a seed is placed on each square of the lower row. When the ant isn't carrying a seed and reaches a square of the lower row containing a seed, it will start to carry the seed. The ant will drop the seed on the first empty square of the upper row it eventually reaches. What's the expected number of steps until all seeds have been dropped in the top row? Give your answer rounded to $6$ decimal places.
<p>A laborious ant walks randomly on a $5 \times 5$ grid. The walk starts from the central square. At each step, the ant moves to an adjacent square at random, without leaving the grid; thus there are $2$, $3$ or $4$ possible moves at each step depending on the ant's position.</p> <p>At the start of the walk, a seed is placed on each square of the lower row. When the ant isn't carrying a seed and reaches a square of the lower row containing a seed, it will start to carry the seed. The ant will drop the seed on the first empty square of the upper row it eventually reaches.</p> <p>What's the expected number of steps until all seeds have been dropped in the top row? <br/> Give your answer rounded to $6$ decimal places.</p>
430.088247
Saturday, 27th February 2010, 01:00 pm
1169
65%
hard
278
Linear Combinations of Semiprimes
Given the values of integers $1 < a_1 < a_2 < \dots < a_n$, consider the linear combination $q_1 a_1+q_2 a_2 + \dots + q_n a_n=b$, using only integer values $q_k \ge 0$. Note that for a given set of $a_k$, it may be that not all values of $b$ are possible. For instance, if $a_1=5$ and $a_2=7$, there are no $q_1 \ge 0$ and $q_2 \ge 0$ such that $b$ could be $1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18$ or $23$. In fact, $23$ is the largest impossible value of $b$ for $a_1=5$ and $a_2=7$. We therefore call $f(5, 7) = 23$. Similarly, it can be shown that $f(6, 10, 15)=29$ and $f(14, 22, 77) = 195$. Find $\displaystyle \sum f( p\, q,p \, r, q \, r)$, where $p$, $q$ and $r$ are prime numbers and $p < q < r < 5000$.
Given the values of integers $1 < a_1 < a_2 < \dots < a_n$, consider the linear combination $q_1 a_1+q_2 a_2 + \dots + q_n a_n=b$, using only integer values $q_k \ge 0$. Note that for a given set of $a_k$, it may be that not all values of $b$ are possible. For instance, if $a_1=5$ and $a_2=7$, there are no $q_1 \ge 0$ and $q_2 \ge 0$ such that $b$ could be $1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18$ or $23$. In fact, $23$ is the largest impossible value of $b$ for $a_1=5$ and $a_2=7$. We therefore call $f(5, 7) = 23$. Similarly, it can be shown that $f(6, 10, 15)=29$ and $f(14, 22, 77) = 195$. Find $\displaystyle \sum f( p\, q,p \, r, q \, r)$, where $p$, $q$ and $r$ are prime numbers and $p < q < r < 5000$.
<p> Given the values of integers $1 &lt; a_1 &lt; a_2 &lt; \dots &lt; a_n$, consider the linear combination<br> $q_1 a_1+q_2 a_2 + \dots + q_n a_n=b$, using only integer values $q_k \ge 0$. </br></p> <p> Note that for a given set of $a_k$, it may be that not all values of $b$ are possible.<br/> For instance, if $a_1=5$ and $a_2=7$, there are no $q_1 \ge 0$ and $q_2 \ge 0$ such that $b$ could be<br/> $1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18$ or $23$. <br/> In fact, $23$ is the largest impossible value of $b$ for $a_1=5$ and $a_2=7$.<br/> We therefore call $f(5, 7) = 23$.<br/> Similarly, it can be shown that $f(6, 10, 15)=29$ and $f(14, 22, 77) = 195$. </p> <p> Find $\displaystyle \sum f( p\, q,p \, r, q \, r)$, where $p$, $q$ and $r$ are prime numbers and $p &lt; q &lt; r &lt; 5000$. </p>
1228215747273908452
Saturday, 13th February 2010, 05:00 am
1161
50%
medium
350
Constraining the Least Greatest and the Greatest Least
A list of size $n$ is a sequence of $n$ natural numbers. Examples are $(2,4,6)$, $(2,6,4)$, $(10,6,15,6)$, and $(11)$. The greatest common divisor, or $\gcd$, of a list is the largest natural number that divides all entries of the list. Examples: $\gcd(2,6,4) = 2$, $\gcd(10,6,15,6) = 1$ and $\gcd(11) = 11$. The least common multiple, or $\operatorname{lcm}$, of a list is the smallest natural number divisible by each entry of the list. Examples: $\operatorname{lcm}(2,6,4) = 12$, $\operatorname{lcm}(10,6,15,6) = 30$ and $\operatorname{lcm}(11) = 11$. Let $f(G, L, N)$ be the number of lists of size $N$ with $\gcd \ge G$ and $\operatorname{lcm} \le L$. For example: $f(10, 100, 1) = 91$. $f(10, 100, 2) = 327$. $f(10, 100, 3) = 1135$. $f(10, 100, 1000) \bmod 101^4 = 3286053$. Find $f(10^6, 10^{12}, 10^{18}) \bmod 101^4$.
A list of size $n$ is a sequence of $n$ natural numbers. Examples are $(2,4,6)$, $(2,6,4)$, $(10,6,15,6)$, and $(11)$. The greatest common divisor, or $\gcd$, of a list is the largest natural number that divides all entries of the list. Examples: $\gcd(2,6,4) = 2$, $\gcd(10,6,15,6) = 1$ and $\gcd(11) = 11$. The least common multiple, or $\operatorname{lcm}$, of a list is the smallest natural number divisible by each entry of the list. Examples: $\operatorname{lcm}(2,6,4) = 12$, $\operatorname{lcm}(10,6,15,6) = 30$ and $\operatorname{lcm}(11) = 11$. Let $f(G, L, N)$ be the number of lists of size $N$ with $\gcd \ge G$ and $\operatorname{lcm} \le L$. For example: $f(10, 100, 1) = 91$. $f(10, 100, 2) = 327$. $f(10, 100, 3) = 1135$. $f(10, 100, 1000) \bmod 101^4 = 3286053$. Find $f(10^6, 10^{12}, 10^{18}) \bmod 101^4$.
<p>A <dfn>list of size $n$</dfn> is a sequence of $n$ natural numbers.<br/> Examples are $(2,4,6)$, $(2,6,4)$, $(10,6,15,6)$, and $(11)$. </p><p> The <strong>greatest common divisor</strong>, or $\gcd$, of a list is the largest natural number that divides all entries of the list. <br/>Examples: $\gcd(2,6,4) = 2$, $\gcd(10,6,15,6) = 1$ and $\gcd(11) = 11$. </p><p> The <strong>least common multiple</strong>, or $\operatorname{lcm}$, of a list is the smallest natural number divisible by each entry of the list. <br/>Examples: $\operatorname{lcm}(2,6,4) = 12$, $\operatorname{lcm}(10,6,15,6) = 30$ and $\operatorname{lcm}(11) = 11$. </p><p> Let $f(G, L, N)$ be the number of lists of size $N$ with $\gcd \ge G$ and $\operatorname{lcm} \le L$. For example: </p><p> $f(10, 100, 1) = 91$.<br/> $f(10, 100, 2) = 327$.<br/> $f(10, 100, 3) = 1135$.<br/> $f(10, 100, 1000) \bmod 101^4 = 3286053$. </p><p> Find $f(10^6, 10^{12}, 10^{18}) \bmod 101^4$. </p>
84664213
Saturday, 10th September 2011, 07:00 pm
531
60%
hard
884
Removing Cubes
Starting from a positive integer $n$, at each step we subtract from $n$ the largest perfect cube not exceeding $n$, until $n$ becomes $0$. For example, with $n = 100$ the procedure ends in $4$ steps: $$100 \xrightarrow{-4^3} 36 \xrightarrow{-3^3} 9 \xrightarrow{-2^3} 1 \xrightarrow{-1^3} 0.$$ Let $D(n)$ denote the number of steps of the procedure. Thus $D(100) = 4$. Let $S(N)$ denote the sum of $D(n)$ for all positive integers $n$ strictly less than $N$. For example, $S(100) = 512$. Find $S(10^{17})$.
Starting from a positive integer $n$, at each step we subtract from $n$ the largest perfect cube not exceeding $n$, until $n$ becomes $0$. For example, with $n = 100$ the procedure ends in $4$ steps: $$100 \xrightarrow{-4^3} 36 \xrightarrow{-3^3} 9 \xrightarrow{-2^3} 1 \xrightarrow{-1^3} 0.$$ Let $D(n)$ denote the number of steps of the procedure. Thus $D(100) = 4$. Let $S(N)$ denote the sum of $D(n)$ for all positive integers $n$ strictly less than $N$. For example, $S(100) = 512$. Find $S(10^{17})$.
<p> Starting from a positive integer $n$, at each step we subtract from $n$ the largest perfect cube not exceeding $n$, until $n$ becomes $0$.<br/> For example, with $n = 100$ the procedure ends in $4$ steps: $$100 \xrightarrow{-4^3} 36 \xrightarrow{-3^3} 9 \xrightarrow{-2^3} 1 \xrightarrow{-1^3} 0.$$ Let $D(n)$ denote the number of steps of the procedure. Thus $D(100) = 4$.</p> <p> Let $S(N)$ denote the sum of $D(n)$ for all positive integers $n$ <b>strictly less</b> than $N$.<br/> For example, $S(100) = 512$.</p> <p> Find $S(10^{17})$.</p>
1105985795684653500
Sunday, 31st March 2024, 08:00 am
588
20%
easy
188
Hyperexponentiation
The hyperexponentiation or tetration of a number $a$ by a positive integer $b$, denoted by $a\mathbin{\uparrow \uparrow}b$ or $^b a$, is recursively defined by: $a \mathbin{\uparrow \uparrow} 1 = a$, $a \mathbin{\uparrow \uparrow} (k+1) = a^{(a \mathbin{\uparrow \uparrow} k)}$. Thus we have e.g. $3 \mathbin{\uparrow \uparrow} 2 = 3^3 = 27$, hence $3 \mathbin{\uparrow \uparrow} 3 = 3^{27} = 7625597484987$ and $3 \mathbin{\uparrow \uparrow} 4$ is roughly $10^{3.6383346400240996 \cdot 10^{12}}$. Find the last $8$ digits of $1777 \mathbin{\uparrow \uparrow} 1855$.
The hyperexponentiation or tetration of a number $a$ by a positive integer $b$, denoted by $a\mathbin{\uparrow \uparrow}b$ or $^b a$, is recursively defined by: $a \mathbin{\uparrow \uparrow} 1 = a$, $a \mathbin{\uparrow \uparrow} (k+1) = a^{(a \mathbin{\uparrow \uparrow} k)}$. Thus we have e.g. $3 \mathbin{\uparrow \uparrow} 2 = 3^3 = 27$, hence $3 \mathbin{\uparrow \uparrow} 3 = 3^{27} = 7625597484987$ and $3 \mathbin{\uparrow \uparrow} 4$ is roughly $10^{3.6383346400240996 \cdot 10^{12}}$. Find the last $8$ digits of $1777 \mathbin{\uparrow \uparrow} 1855$.
<p>The <strong>hyperexponentiation</strong> or <strong>tetration</strong> of a number $a$ by a positive integer $b$, denoted by $a\mathbin{\uparrow \uparrow}b$ or $^b a$, is recursively defined by:<br/><br/> $a \mathbin{\uparrow \uparrow} 1 = a$,<br/> $a \mathbin{\uparrow \uparrow} (k+1) = a^{(a \mathbin{\uparrow \uparrow} k)}$.</p> <p> Thus we have e.g. $3 \mathbin{\uparrow \uparrow} 2 = 3^3 = 27$, hence $3 \mathbin{\uparrow \uparrow} 3 = 3^{27} = 7625597484987$ and $3 \mathbin{\uparrow \uparrow} 4$ is roughly $10^{3.6383346400240996 \cdot 10^{12}}$.</p> <p>Find the last $8$ digits of $1777 \mathbin{\uparrow \uparrow} 1855$.</p>
95962097
Friday, 4th April 2008, 02:00 pm
6985
35%
medium
66
Diophantine Equation
Consider quadratic Diophantine equations of the form: $$x^2 - Dy^2 = 1$$ For example, when $D=13$, the minimal solution in $x$ is $649^2 - 13 \times 180^2 = 1$. It can be assumed that there are no solutions in positive integers when $D$ is square. By finding minimal solutions in $x$ for $D = \{2, 3, 5, 6, 7\}$, we obtain the following: \begin{align} 3^2 - 2 \times 2^2 &= 1\\ 2^2 - 3 \times 1^2 &= 1\\ {\color{red}{\mathbf 9}}^2 - 5 \times 4^2 &= 1\\ 5^2 - 6 \times 2^2 &= 1\\ 8^2 - 7 \times 3^2 &= 1 \end{align} Hence, by considering minimal solutions in $x$ for $D \le 7$, the largest $x$ is obtained when $D=5$. Find the value of $D \le 1000$ in minimal solutions of $x$ for which the largest value of $x$ is obtained.
Consider quadratic Diophantine equations of the form: $$x^2 - Dy^2 = 1$$ For example, when $D=13$, the minimal solution in $x$ is $649^2 - 13 \times 180^2 = 1$. It can be assumed that there are no solutions in positive integers when $D$ is square. By finding minimal solutions in $x$ for $D = \{2, 3, 5, 6, 7\}$, we obtain the following: \begin{align} 3^2 - 2 \times 2^2 &= 1\\ 2^2 - 3 \times 1^2 &= 1\\ {\color{red}{\mathbf 9}}^2 - 5 \times 4^2 &= 1\\ 5^2 - 6 \times 2^2 &= 1\\ 8^2 - 7 \times 3^2 &= 1 \end{align} Hence, by considering minimal solutions in $x$ for $D \le 7$, the largest $x$ is obtained when $D=5$. Find the value of $D \le 1000$ in minimal solutions of $x$ for which the largest value of $x$ is obtained.
<p>Consider quadratic Diophantine equations of the form: $$x^2 - Dy^2 = 1$$</p> <p>For example, when $D=13$, the minimal solution in $x$ is $649^2 - 13 \times 180^2 = 1$.</p> <p>It can be assumed that there are no solutions in positive integers when $D$ is square.</p> <p>By finding minimal solutions in $x$ for $D = \{2, 3, 5, 6, 7\}$, we obtain the following:</p> \begin{align} 3^2 - 2 \times 2^2 &= 1\\ 2^2 - 3 \times 1^2 &= 1\\ {\color{red}{\mathbf 9}}^2 - 5 \times 4^2 &= 1\\ 5^2 - 6 \times 2^2 &= 1\\ 8^2 - 7 \times 3^2 &= 1 \end{align} <p>Hence, by considering minimal solutions in $x$ for $D \le 7$, the largest $x$ is obtained when $D=5$.</p> <p>Find the value of $D \le 1000$ in minimal solutions of $x$ for which the largest value of $x$ is obtained.</p>
661
Friday, 26th March 2004, 06:00 pm
22183
25%
easy
902
Permutation Powers
A permutation $\pi$ of $\{1, \dots, n\}$ can be represented in one-line notation as $\pi(1),\ldots,\pi(n) $. If all $n!$ permutations are written in lexicographic order then $\textrm{rank}(\pi)$ is the position of $\pi$ in this 1-based list. For example, $\text{rank}(2,1,3) = 3$ because the six permutations of $\{1, 2, 3\}$ in lexicographic order are: $$1, 2, 3\quad 1, 3, 2 \quad 2, 1, 3 \quad 2, 3, 1 \quad 3, 1, 2 \quad 3, 2, 1$$ For a positive integer $m$, we define the following permutation of $\{1, \dots, n\}$ with $n = \frac{m(m+1)}2$: $$ \begin{align} \sigma(i) &= \begin{cases} \frac{k(k-1)}2 + 1 & \textrm{if } i = \frac{k(k + 1)}2\textrm{ for }k\in\{1, \dots, m\};\\i + 1 & \textrm{otherwise};\end{cases}\\ \tau(i) &= ((10^9 + 7)i \bmod n) + 1\\ \pi(i) &= \tau^{-1}(\sigma(\tau(i))) \end{align} $$ where $\tau^{-1}$ is the inverse permutation of $\tau$. Define $\displaystyle P(m) = \sum_{k=1}^{m!} \text{rank}(\pi^k)$, where $\pi^k$ is the permutation arising from applying $\pi$ $k$ times. For example, $P(2) = 4$, $P(3) = 780$ and $P(4) = 38810300$. Find $P(100)$. Give your answer modulo $(10^9 + 7)$.
A permutation $\pi$ of $\{1, \dots, n\}$ can be represented in one-line notation as $\pi(1),\ldots,\pi(n) $. If all $n!$ permutations are written in lexicographic order then $\textrm{rank}(\pi)$ is the position of $\pi$ in this 1-based list. For example, $\text{rank}(2,1,3) = 3$ because the six permutations of $\{1, 2, 3\}$ in lexicographic order are: $$1, 2, 3\quad 1, 3, 2 \quad 2, 1, 3 \quad 2, 3, 1 \quad 3, 1, 2 \quad 3, 2, 1$$ For a positive integer $m$, we define the following permutation of $\{1, \dots, n\}$ with $n = \frac{m(m+1)}2$: $$ \begin{align} \sigma(i) &= \begin{cases} \frac{k(k-1)}2 + 1 & \textrm{if } i = \frac{k(k + 1)}2\textrm{ for }k\in\{1, \dots, m\};\\i + 1 & \textrm{otherwise};\end{cases}\\ \tau(i) &= ((10^9 + 7)i \bmod n) + 1\\ \pi(i) &= \tau^{-1}(\sigma(\tau(i))) \end{align} $$ where $\tau^{-1}$ is the inverse permutation of $\tau$. Define $\displaystyle P(m) = \sum_{k=1}^{m!} \text{rank}(\pi^k)$, where $\pi^k$ is the permutation arising from applying $\pi$ $k$ times. For example, $P(2) = 4$, $P(3) = 780$ and $P(4) = 38810300$. Find $P(100)$. Give your answer modulo $(10^9 + 7)$.
<p>A permutation $\pi$ of $\{1, \dots, n\}$ can be represented in <b>one-line notation</b> as $\pi(1),\ldots,\pi(n) $. If all $n!$ permutations are written in lexicographic order then $\textrm{rank}(\pi)$ is the position of $\pi$ in this 1-based list.</p> <p>For example, $\text{rank}(2,1,3) = 3$ because the six permutations of $\{1, 2, 3\}$ in lexicographic order are: $$1, 2, 3\quad 1, 3, 2 \quad 2, 1, 3 \quad 2, 3, 1 \quad 3, 1, 2 \quad 3, 2, 1$$ </p> <p>For a positive integer $m$, we define the following permutation of $\{1, \dots, n\}$ with $n = \frac{m(m+1)}2$: $$ \begin{align} \sigma(i) &amp;= \begin{cases} \frac{k(k-1)}2 + 1 &amp; \textrm{if } i = \frac{k(k + 1)}2\textrm{ for }k\in\{1, \dots, m\};\\i + 1 &amp; \textrm{otherwise};\end{cases}\\ \tau(i) &amp;= ((10^9 + 7)i \bmod n) + 1\\ \pi(i) &amp;= \tau^{-1}(\sigma(\tau(i))) \end{align} $$ where $\tau^{-1}$ is the inverse permutation of $\tau$. </p> <p>Define $\displaystyle P(m) = \sum_{k=1}^{m!} \text{rank}(\pi^k)$, where $\pi^k$ is the permutation arising from applying $\pi$ $k$ times.<br/> For example, $P(2) = 4$, $P(3) = 780$ and $P(4) = 38810300$.</p> <p> Find $P(100)$. Give your answer modulo $(10^9 + 7)$. </p>
343557869
Sunday, 28th July 2024, 11:00 am
165
50%
medium
612
Friend Numbers
Let's call two numbers friend numbers if their representation in base $10$ has at least one common digit. E.g. $1123$ and $3981$ are friend numbers. Let $f(n)$ be the number of pairs $(p,q)$ with $1\le p \lt q \lt n$ such that $p$ and $q$ are friend numbers. $f(100)=1539$. Find $f(10^{18}) \bmod 1000267129$.
Let's call two numbers friend numbers if their representation in base $10$ has at least one common digit. E.g. $1123$ and $3981$ are friend numbers. Let $f(n)$ be the number of pairs $(p,q)$ with $1\le p \lt q \lt n$ such that $p$ and $q$ are friend numbers. $f(100)=1539$. Find $f(10^{18}) \bmod 1000267129$.
<p> Let's call two numbers <dfn>friend numbers</dfn> if their representation in base $10$ has at least one common digit.<br/> E.g. $1123$ and $3981$ are friend numbers. </p> <p> Let $f(n)$ be the number of pairs $(p,q)$ with $1\le p \lt q \lt n$ such that $p$ and $q$ are friend numbers.<br/> $f(100)=1539$. </p> <p> Find $f(10^{18}) \bmod 1000267129$. </p>
819963842
Sunday, 22nd October 2017, 01:00 am
758
30%
easy
584
Birthday Problem Revisited
A long long time ago in a galaxy far far away, the Wimwians, inhabitants of planet WimWi, discovered an unmanned drone that had landed on their planet. On examining the drone, they uncovered a device that sought the answer for the so called "Birthday Problem". The description of the problem was as follows: If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find 3 people with Birthdays within 1 day from each other. The description further instructed them to enter the answer into the device and send the drone into space again. Startled by this turn of events, the Wimwians consulted their best mathematicians. Each year on Wimwi has 10 days and the mathematicians assumed equally likely birthdays and ignored leap years (leap years in Wimwi have 11 days), and found 5.78688636 to be the required answer. As such, the Wimwians entered this answer and sent the drone back into space. After traveling light years away, the drone then landed on planet Joka. The same events ensued except this time, the numbers in the device had changed due to some unknown technical issues. The description read: If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find 3 people with Birthdays within 7 days from each other. With a 100-day year on the planet, the Jokars (inhabitants of Joka) found the answer to be 8.48967364 (rounded to 8 decimal places because the device allowed only 8 places after the decimal point) assuming equally likely birthdays. They too entered the answer into the device and launched the drone into space again. This time the drone landed on planet Earth. As before the numbers in the problem description had changed. It read: If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find 4 people with Birthdays within 7 days from each other. What would be the answer (rounded to eight places after the decimal point) the people of Earth have to enter into the device for a year with 365 days? Ignore leap years. Also assume that all birthdays are equally likely and independent of each other.
A long long time ago in a galaxy far far away, the Wimwians, inhabitants of planet WimWi, discovered an unmanned drone that had landed on their planet. On examining the drone, they uncovered a device that sought the answer for the so called "Birthday Problem". The description of the problem was as follows: If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find 3 people with Birthdays within 1 day from each other. The description further instructed them to enter the answer into the device and send the drone into space again. Startled by this turn of events, the Wimwians consulted their best mathematicians. Each year on Wimwi has 10 days and the mathematicians assumed equally likely birthdays and ignored leap years (leap years in Wimwi have 11 days), and found 5.78688636 to be the required answer. As such, the Wimwians entered this answer and sent the drone back into space. After traveling light years away, the drone then landed on planet Joka. The same events ensued except this time, the numbers in the device had changed due to some unknown technical issues. The description read: If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find 3 people with Birthdays within 7 days from each other. With a 100-day year on the planet, the Jokars (inhabitants of Joka) found the answer to be 8.48967364 (rounded to 8 decimal places because the device allowed only 8 places after the decimal point) assuming equally likely birthdays. They too entered the answer into the device and launched the drone into space again. This time the drone landed on planet Earth. As before the numbers in the problem description had changed. It read: If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find 4 people with Birthdays within 7 days from each other. What would be the answer (rounded to eight places after the decimal point) the people of Earth have to enter into the device for a year with 365 days? Ignore leap years. Also assume that all birthdays are equally likely and independent of each other.
<p>A long long time ago in a galaxy far far away, the Wimwians, inhabitants of planet WimWi, discovered an unmanned drone that had landed on their planet. On examining the drone, they uncovered a device that sought the answer for the so called "<b>Birthday Problem</b>". The description of the problem was as follows:</p> <p><i>If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find <b>3 people with Birthdays within 1 day from each other</b>.</i></p> <p>The description further instructed them to enter the answer into the device and send the drone into space again. Startled by this turn of events, the Wimwians consulted their best mathematicians. Each year on Wimwi has 10 days and the mathematicians assumed equally likely birthdays and ignored leap years (leap years in Wimwi have 11 days), and found 5.78688636 to be the required answer. As such, the Wimwians entered this answer and sent the drone back into space.</p> <p>After traveling light years away, the drone then landed on planet Joka. The same events ensued except this time, the numbers in the device had changed due to some unknown technical issues. The description read:</p> <p><i>If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find <b>3 people with Birthdays within 7 days from each other</b>.</i></p> <p>With a 100-day year on the planet, the Jokars (inhabitants of Joka) found the answer to be 8.48967364 (rounded to 8 decimal places because the device allowed only 8 places after the decimal point) assuming equally likely birthdays. They too entered the answer into the device and launched the drone into space again.</p> <p>This time the drone landed on planet Earth. As before the numbers in the problem description had changed. It read:</p> <p><i>If people on your planet were to enter a very large room one by one, what will be the expected number of people in the room when you first find <b>4 people with Birthdays within 7 days from each other</b>.</i></p> <p>What would be the answer (rounded to eight places after the decimal point) the people of Earth have to enter into the device for a year with 365 days? Ignore leap years. Also assume that all birthdays are equally likely and independent of each other.</p>
32.83822408
Saturday, 31st December 2016, 04:00 pm
234
100%
hard
875
Quadruple Congruence
For a positive integer $n$ we define $q(n)$ to be the number of solutions to: $$a_1^2+a_2^2+a_3^2+a_4^2 \equiv b_1^2+b_2^2+b_3^2+b_4^2 \pmod n$$ where $0 \leq a_i, b_i \lt n$. For example, $q(4)= 18432$. Define $\displaystyle Q(n)=\sum_{i=1}^{n}q(i)$. You are given $Q(10)=18573381$. Find $Q(12345678)$. Give your answer modulo $1001961001$.
For a positive integer $n$ we define $q(n)$ to be the number of solutions to: $$a_1^2+a_2^2+a_3^2+a_4^2 \equiv b_1^2+b_2^2+b_3^2+b_4^2 \pmod n$$ where $0 \leq a_i, b_i \lt n$. For example, $q(4)= 18432$. Define $\displaystyle Q(n)=\sum_{i=1}^{n}q(i)$. You are given $Q(10)=18573381$. Find $Q(12345678)$. Give your answer modulo $1001961001$.
<p> For a positive integer $n$ we define $q(n)$ to be the number of solutions to:</p> $$a_1^2+a_2^2+a_3^2+a_4^2 \equiv b_1^2+b_2^2+b_3^2+b_4^2 \pmod n$$ <p>where $0 \leq a_i, b_i \lt n$. For example, $q(4)= 18432$.</p> <p> Define $\displaystyle Q(n)=\sum_{i=1}^{n}q(i)$. You are given $Q(10)=18573381$.</p> <p> Find $Q(12345678)$. Give your answer modulo $1001961001$.</p>
79645946
Sunday, 4th February 2024, 07:00 am
218
35%
medium
70
Totient Permutation
Euler's totient function, $\phi(n)$ [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to $n$ which are relatively prime to $n$. For example, as $1, 2, 4, 5, 7$, and $8$, are all less than nine and relatively prime to nine, $\phi(9)=6$.The number $1$ is considered to be relatively prime to every positive number, so $\phi(1)=1$. Interestingly, $\phi(87109)=79180$, and it can be seen that $87109$ is a permutation of $79180$. Find the value of $n$, $1 \lt n \lt 10^7$, for which $\phi(n)$ is a permutation of $n$ and the ratio $n/\phi(n)$ produces a minimum.
Euler's totient function, $\phi(n)$ [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to $n$ which are relatively prime to $n$. For example, as $1, 2, 4, 5, 7$, and $8$, are all less than nine and relatively prime to nine, $\phi(9)=6$.The number $1$ is considered to be relatively prime to every positive number, so $\phi(1)=1$. Interestingly, $\phi(87109)=79180$, and it can be seen that $87109$ is a permutation of $79180$. Find the value of $n$, $1 \lt n \lt 10^7$, for which $\phi(n)$ is a permutation of $n$ and the ratio $n/\phi(n)$ produces a minimum.
<p>Euler's totient function, $\phi(n)$ [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to $n$ which are relatively prime to $n$. For example, as $1, 2, 4, 5, 7$, and $8$, are all less than nine and relatively prime to nine, $\phi(9)=6$.<br/>The number $1$ is considered to be relatively prime to every positive number, so $\phi(1)=1$. </p> <p>Interestingly, $\phi(87109)=79180$, and it can be seen that $87109$ is a permutation of $79180$.</p> <p>Find the value of $n$, $1 \lt n \lt 10^7$, for which $\phi(n)$ is a permutation of $n$ and the ratio $n/\phi(n)$ produces a minimum.</p>
8319823
Friday, 21st May 2004, 06:00 pm
24976
20%
easy
411
Uphill Paths
Let $n$ be a positive integer. Suppose there are stations at the coordinates $(x, y) = (2^i \bmod n, 3^i \bmod n)$ for $0 \leq i \leq 2n$. We will consider stations with the same coordinates as the same station. We wish to form a path from $(0, 0)$ to $(n, n)$ such that the $x$ and $y$ coordinates never decrease. Let $S(n)$ be the maximum number of stations such a path can pass through. For example, if $n = 22$, there are $11$ distinct stations, and a valid path can pass through at most $5$ stations. Therefore, $S(22) = 5$. The case is illustrated below, with an example of an optimal path: It can also be verified that $S(123) = 14$ and $S(10000) = 48$. Find $\sum S(k^5)$ for $1 \leq k \leq 30$.
Let $n$ be a positive integer. Suppose there are stations at the coordinates $(x, y) = (2^i \bmod n, 3^i \bmod n)$ for $0 \leq i \leq 2n$. We will consider stations with the same coordinates as the same station. We wish to form a path from $(0, 0)$ to $(n, n)$ such that the $x$ and $y$ coordinates never decrease. Let $S(n)$ be the maximum number of stations such a path can pass through. For example, if $n = 22$, there are $11$ distinct stations, and a valid path can pass through at most $5$ stations. Therefore, $S(22) = 5$. The case is illustrated below, with an example of an optimal path: It can also be verified that $S(123) = 14$ and $S(10000) = 48$. Find $\sum S(k^5)$ for $1 \leq k \leq 30$.
<p> Let $n$ be a positive integer. Suppose there are stations at the coordinates $(x, y) = (2^i \bmod n, 3^i \bmod n)$ for $0 \leq i \leq 2n$. We will consider stations with the same coordinates as the same station. </p><p> We wish to form a path from $(0, 0)$ to $(n, n)$ such that the $x$ and $y$ coordinates never decrease.<br/> Let $S(n)$ be the maximum number of stations such a path can pass through. </p><p> For example, if $n = 22$, there are $11$ distinct stations, and a valid path can pass through at most $5$ stations. Therefore, $S(22) = 5$. The case is illustrated below, with an example of an optimal path: </p> <p align="center"><img alt="0411_longpath.png" src="resources/images/0411_longpath.png?1678992053"/></p> <p> It can also be verified that $S(123) = 14$ and $S(10000) = 48$. </p><p> Find $\sum S(k^5)$ for $1 \leq k \leq 30$. </p>
9936352
Saturday, 19th January 2013, 10:00 pm
747
45%
medium
690
Tom and Jerry
Tom (the cat) and Jerry (the mouse) are playing on a simple graph $G$. Every vertex of $G$ is a mousehole, and every edge of $G$ is a tunnel connecting two mouseholes. Originally, Jerry is hiding in one of the mouseholes. Every morning, Tom can check one (and only one) of the mouseholes. If Jerry happens to be hiding there then Tom catches Jerry and the game is over. Every evening, if the game continues, Jerry moves to a mousehole which is adjacent (i.e. connected by a tunnel, if there is one available) to his current hiding place. The next morning Tom checks again and the game continues like this. Let us call a graph $G$ a Tom graph, if our super-smart Tom, who knows the configuration of the graph but does not know the location of Jerry, can guarantee to catch Jerry in finitely many days. For example consider all graphs on 3 nodes: For graphs 1 and 2, Tom will catch Jerry in at most three days. For graph 3 Tom can check the middle connection on two consecutive days and hence guarantee to catch Jerry in at most two days. These three graphs are therefore Tom Graphs. However, graph 4 is not a Tom Graph because the game could potentially continue forever. Let $T(n)$ be the number of different Tom graphs with $n$ vertices. Two graphs are considered the same if there is a bijection $f$ between their vertices, such that $(v,w)$ is an edge if and only if $(f(v),f(w))$ is an edge. We have $T(3) = 3$, $T(7) = 37$, $T(10) = 328$ and $T(20) = 1416269$. Find $T(2019)$ giving your answer modulo $1\,000\,000\,007$.
Tom (the cat) and Jerry (the mouse) are playing on a simple graph $G$. Every vertex of $G$ is a mousehole, and every edge of $G$ is a tunnel connecting two mouseholes. Originally, Jerry is hiding in one of the mouseholes. Every morning, Tom can check one (and only one) of the mouseholes. If Jerry happens to be hiding there then Tom catches Jerry and the game is over. Every evening, if the game continues, Jerry moves to a mousehole which is adjacent (i.e. connected by a tunnel, if there is one available) to his current hiding place. The next morning Tom checks again and the game continues like this. Let us call a graph $G$ a Tom graph, if our super-smart Tom, who knows the configuration of the graph but does not know the location of Jerry, can guarantee to catch Jerry in finitely many days. For example consider all graphs on 3 nodes: For graphs 1 and 2, Tom will catch Jerry in at most three days. For graph 3 Tom can check the middle connection on two consecutive days and hence guarantee to catch Jerry in at most two days. These three graphs are therefore Tom Graphs. However, graph 4 is not a Tom Graph because the game could potentially continue forever. Let $T(n)$ be the number of different Tom graphs with $n$ vertices. Two graphs are considered the same if there is a bijection $f$ between their vertices, such that $(v,w)$ is an edge if and only if $(f(v),f(w))$ is an edge. We have $T(3) = 3$, $T(7) = 37$, $T(10) = 328$ and $T(20) = 1416269$. Find $T(2019)$ giving your answer modulo $1\,000\,000\,007$.
<p> Tom (the cat) and Jerry (the mouse) are playing on a simple graph $G$. </p> <p> Every vertex of $G$ is a mousehole, and every edge of $G$ is a tunnel connecting two mouseholes. </p> <p> Originally, Jerry is hiding in one of the mouseholes.<br/> Every morning, Tom can check one (and only one) of the mouseholes. If Jerry happens to be hiding there then Tom catches Jerry and the game is over.<br/> Every evening, if the game continues, Jerry moves to a mousehole which is adjacent (i.e. connected by a tunnel, if there is one available) to his current hiding place. The next morning Tom checks again and the game continues like this. </p> <p> Let us call a graph $G$ a <dfn>Tom graph</dfn>, if our super-smart Tom, who knows the configuration of the graph but does not know the location of Jerry, can <i>guarantee</i> to catch Jerry in finitely many days. For example consider all graphs on 3 nodes: </p> <div class="center"> <img alt="Graphs on 3 nodes" src="resources/images/0690_graphs.jpg?1678992054"/> </div> <p> For graphs 1 and 2, Tom will catch Jerry in at most three days. For graph 3 Tom can check the middle connection on two consecutive days and hence guarantee to catch Jerry in at most two days. These three graphs are therefore Tom Graphs. However, graph 4 is not a Tom Graph because the game could potentially continue forever. </p> <p> Let $T(n)$ be the number of different Tom graphs with $n$ vertices. Two graphs are considered the same if there is a bijection $f$ between their vertices, such that $(v,w)$ is an edge if and only if $(f(v),f(w))$ is an edge. </p> <p> We have $T(3) = 3$, $T(7) = 37$, $T(10) = 328$ and $T(20) = 1416269$. </p> <p> Find $T(2019)$ giving your answer modulo $1\,000\,000\,007$. </p>
415157690
Sunday, 24th November 2019, 07:00 am
233
60%
hard
638
Weighted Lattice Paths
Let $P_{a,b}$ denote a path in a $a\times b$ lattice grid with following properties: The path begins at $(0,0)$ and ends at $(a,b)$. The path consists only of unit moves upwards or to the right; that is the coordinates are increasing with every move. Denote $A(P_{a,b})$ to be the area under the path. For the example of a $P_{4,3}$ path given below, the area equals $6$. Define $G(P_{a,b},k)=k^{A(P_{a,b})}$. Let $C(a,b,k)$ equal the sum of $G(P_{a,b},k)$ over all valid paths in a $a\times b$ lattice grid. You are given that $C(2,2,1)=6$ $C(2,2,2)=35$ $C(10,10,1)=184\,756$ $C(15,10,3) \equiv 880\,419\,838 \mod 1\,000\,000\,007$ $C(10\,000,10\,000,4) \equiv 395\,913\,804 \mod 1\,000\,000\,007$ Calculate $\displaystyle\sum_{k=1}^7 C(10^k+k, 10^k+k,k)$. Give your answer modulo $1\,000\,000\,007$
Let $P_{a,b}$ denote a path in a $a\times b$ lattice grid with following properties: The path begins at $(0,0)$ and ends at $(a,b)$. The path consists only of unit moves upwards or to the right; that is the coordinates are increasing with every move. Denote $A(P_{a,b})$ to be the area under the path. For the example of a $P_{4,3}$ path given below, the area equals $6$. Define $G(P_{a,b},k)=k^{A(P_{a,b})}$. Let $C(a,b,k)$ equal the sum of $G(P_{a,b},k)$ over all valid paths in a $a\times b$ lattice grid. You are given that $C(2,2,1)=6$ $C(2,2,2)=35$ $C(10,10,1)=184\,756$ $C(15,10,3) \equiv 880\,419\,838 \mod 1\,000\,000\,007$ $C(10\,000,10\,000,4) \equiv 395\,913\,804 \mod 1\,000\,000\,007$ Calculate $\displaystyle\sum_{k=1}^7 C(10^k+k, 10^k+k,k)$. Give your answer modulo $1\,000\,000\,007$
Let $P_{a,b}$ denote a path in a $a\times b$ lattice grid with following properties: <ul> <li>The path begins at $(0,0)$ and ends at $(a,b)$.</li> <li>The path consists only of unit moves upwards or to the right; that is the coordinates are increasing with every move.</li> </ul> Denote $A(P_{a,b})$ to be the area under the path. For the example of a $P_{4,3}$ path given below, the area equals $6$. <div class="center"> <img alt="crossed lines" src="resources/images/0638_lattice_area.png?1678992054"/> </div> <p> Define $G(P_{a,b},k)=k^{A(P_{a,b})}$. Let $C(a,b,k)$ equal the sum of $G(P_{a,b},k)$ over all valid paths in a $a\times b$ lattice grid. </p> <p> You are given that </p> <ul> <li>$C(2,2,1)=6$</li> <li>$C(2,2,2)=35$</li> <li>$C(10,10,1)=184\,756$</li> <li>$C(15,10,3) \equiv 880\,419\,838 \mod 1\,000\,000\,007$</li> <li>$C(10\,000,10\,000,4) \equiv 395\,913\,804 \mod 1\,000\,000\,007$</li> </ul> Calculate $\displaystyle\sum_{k=1}^7 C(10^k+k, 10^k+k,k)$. Give your answer modulo $1\,000\,000\,007$
18423394
Sunday, 7th October 2018, 04:00 am
417
40%
medium
178
Step Numbers
Consider the number $45656$. It can be seen that each pair of consecutive digits of $45656$ has a difference of one. A number for which every pair of consecutive digits has a difference of one is called a step number. A pandigital number contains every decimal digit from $0$ to $9$ at least once. How many pandigital step numbers less than $10^{40}$ are there?
Consider the number $45656$. It can be seen that each pair of consecutive digits of $45656$ has a difference of one. A number for which every pair of consecutive digits has a difference of one is called a step number. A pandigital number contains every decimal digit from $0$ to $9$ at least once. How many pandigital step numbers less than $10^{40}$ are there?
Consider the number $45656$. <br/> It can be seen that each pair of consecutive digits of $45656$ has a difference of one.<br/> A number for which every pair of consecutive digits has a difference of one is called a step number.<br/> A pandigital number contains every decimal digit from $0$ to $9$ at least once.<br/> How many pandigital step numbers less than $10^{40}$ are there?
126461847755
Saturday, 19th January 2008, 01:00 am
3806
55%
medium
737
Coin Loops
A game is played with many identical, round coins on a flat table. Consider a line perpendicular to the table. The first coin is placed on the table touching the line. Then, one by one, the coins are placed horizontally on top of the previous coin and touching the line. The complete stack of coins must be balanced after every placement. The diagram below [not to scale] shows a possible placement of 8 coins where point $P$ represents the line. It is found that a minimum of $31$ coins are needed to form a coin loop around the line, i.e. if in the projection of the coins on the table the centre of the $n$th coin is rotated $\theta_n$, about the line, from the centre of the $(n-1)$th coin then the sum of $\displaystyle\sum_{k=2}^n \theta_k$ is first larger than $360^\circ$ when $n=31$. In general, to loop $k$ times, $n$ is the smallest number for which the sum is greater than $360^\circ k$. Also, $154$ coins are needed to loop two times around the line, and $6947$ coins to loop ten times. Calculate the number of coins needed to loop $2020$ times around the line.
A game is played with many identical, round coins on a flat table. Consider a line perpendicular to the table. The first coin is placed on the table touching the line. Then, one by one, the coins are placed horizontally on top of the previous coin and touching the line. The complete stack of coins must be balanced after every placement. The diagram below [not to scale] shows a possible placement of 8 coins where point $P$ represents the line. It is found that a minimum of $31$ coins are needed to form a coin loop around the line, i.e. if in the projection of the coins on the table the centre of the $n$th coin is rotated $\theta_n$, about the line, from the centre of the $(n-1)$th coin then the sum of $\displaystyle\sum_{k=2}^n \theta_k$ is first larger than $360^\circ$ when $n=31$. In general, to loop $k$ times, $n$ is the smallest number for which the sum is greater than $360^\circ k$. Also, $154$ coins are needed to loop two times around the line, and $6947$ coins to loop ten times. Calculate the number of coins needed to loop $2020$ times around the line.
<p> A game is played with many identical, round coins on a flat table. </p> <p> Consider a line perpendicular to the table.<br> The first coin is placed on the table touching the line.<br/> Then, one by one, the coins are placed horizontally on top of the previous coin and touching the line.<br/> The complete stack of coins must be balanced after every placement. </br></p> <p> The diagram below [not to scale] shows a possible placement of 8 coins where point $P$ represents the line. </p> <div style="text-align:center;"> <img alt="" class="dark_img" src="project/images/p737_coinloop.jpg"/></div> <p> It is found that a minimum of $31$ coins are needed to form a <i>coin loop</i> around the line, i.e. if in the projection of the coins on the table the centre of the $n$th coin is rotated $\theta_n$, about the line, from the centre of the $(n-1)$th coin then the sum of $\displaystyle\sum_{k=2}^n \theta_k$ is first larger than $360^\circ$ when $n=31$. In general, to loop $k$ times, $n$ is the smallest number for which the sum is greater than $360^\circ k$. </p> <p> Also, $154$ coins are needed to loop two times around the line, and $6947$ coins to loop ten times. </p> <p> Calculate the number of coins needed to loop $2020$ times around the line. </p>
757794899
Sunday, 6th December 2020, 04:00 am
405
30%
easy
912
Where are the Odds?
Let $s_n$ be the $n$-th positive integer that does not contain three consecutive ones in its binary representation. For example, $s_1 = 1$ and $s_7 = 8$. Define $F(N)$ to be the sum of $n^2$ for all $n\leq N$ where $s_n$ is odd. You are given $F(10)=199$. Find $F(10^{16})$ giving your answer modulo $10^9+7$.
Let $s_n$ be the $n$-th positive integer that does not contain three consecutive ones in its binary representation. For example, $s_1 = 1$ and $s_7 = 8$. Define $F(N)$ to be the sum of $n^2$ for all $n\leq N$ where $s_n$ is odd. You are given $F(10)=199$. Find $F(10^{16})$ giving your answer modulo $10^9+7$.
<p> Let $s_n$ be the $n$-th positive integer that does not contain three consecutive ones in its binary representation.<br/> For example, $s_1 = 1$ and $s_7 = 8$. </p> <p> Define $F(N)$ to be the sum of $n^2$ for all $n\leq N$ where $s_n$ is odd. You are given $F(10)=199$. </p> <p> Find $F(10^{16})$ giving your answer modulo $10^9+7$. </p>
674045136
Sunday, 13th October 2024, 11:00 am
192
50%
medium
118
Pandigital Prime Sets
Using all of the digits $1$ through $9$ and concatenating them freely to form decimal integers, different sets can be formed. Interestingly with the set $\{2,5,47,89,631\}$, all of the elements belonging to it are prime. How many distinct sets containing each of the digits one through nine exactly once contain only prime elements?
Using all of the digits $1$ through $9$ and concatenating them freely to form decimal integers, different sets can be formed. Interestingly with the set $\{2,5,47,89,631\}$, all of the elements belonging to it are prime. How many distinct sets containing each of the digits one through nine exactly once contain only prime elements?
<p>Using all of the digits $1$ through $9$ and concatenating them freely to form decimal integers, different sets can be formed. Interestingly with the set $\{2,5,47,89,631\}$, all of the elements belonging to it are prime.</p> <p>How many distinct sets containing each of the digits one through nine exactly once contain only prime elements?</p>
44680
Friday, 24th March 2006, 06:00 pm
7907
45%
medium
587
Concave Triangle
A square is drawn around a circle as shown in the diagram below on the left. We shall call the blue shaded region the L-section. A line is drawn from the bottom left of the square to the top right as shown in the diagram on the right. We shall call the orange shaded region a concave triangle. It should be clear that the concave triangle occupies exactly half of the L-section. Two circles are placed next to each other horizontally, a rectangle is drawn around both circles, and a line is drawn from the bottom left to the top right as shown in the diagram below. This time the concave triangle occupies approximately 36.46% of the L-section. If $n$ circles are placed next to each other horizontally, a rectangle is drawn around the n circles, and a line is drawn from the bottom left to the top right, then it can be shown that the least value of n for which the concave triangle occupies less than 10% of the L-section is $n = 15$. What is the least value of $n$ for which the concave triangle occupies less than 0.1% of the L-section?
A square is drawn around a circle as shown in the diagram below on the left. We shall call the blue shaded region the L-section. A line is drawn from the bottom left of the square to the top right as shown in the diagram on the right. We shall call the orange shaded region a concave triangle. It should be clear that the concave triangle occupies exactly half of the L-section. Two circles are placed next to each other horizontally, a rectangle is drawn around both circles, and a line is drawn from the bottom left to the top right as shown in the diagram below. This time the concave triangle occupies approximately 36.46% of the L-section. If $n$ circles are placed next to each other horizontally, a rectangle is drawn around the n circles, and a line is drawn from the bottom left to the top right, then it can be shown that the least value of n for which the concave triangle occupies less than 10% of the L-section is $n = 15$. What is the least value of $n$ for which the concave triangle occupies less than 0.1% of the L-section?
<p> A square is drawn around a circle as shown in the diagram below on the left.<br/> We shall call the blue shaded region the L-section.<br/> A line is drawn from the bottom left of the square to the top right as shown in the diagram on the right.<br/> We shall call the orange shaded region a <dfn>concave triangle</dfn>. </p> <div class="center"> <img alt="0587_concave_triangle_1.png" class="dark_img" src="resources/images/0587_concave_triangle_1.png?1678992053"/> </div> <p> It should be clear that the concave triangle occupies exactly half of the L-section. </p> <p> Two circles are placed next to each other horizontally, a rectangle is drawn around both circles, and a line is drawn from the bottom left to the top right as shown in the diagram below. </p> <div class="center"> <img alt="0587_concave_triangle_2.png" class="dark_img" src="resources/images/0587_concave_triangle_2.png?1678992053"/> </div> <p> This time the concave triangle occupies approximately 36.46% of the L-section. </p> <p> If $n$ circles are placed next to each other horizontally, a rectangle is drawn around the <var>n</var> circles, and a line is drawn from the bottom left to the top right, then it can be shown that the least value of <var>n</var> for which the concave triangle occupies less than 10% of the L-section is $n = 15$. </p> <p> What is the least value of $n$ for which the concave triangle occupies less than 0.1% of the L-section? </p>
2240
Sunday, 22nd January 2017, 01:00 am
3471
20%
easy
373
Circumscribed Circles
Every triangle has a circumscribed circle that goes through the three vertices. Consider all integer sided triangles for which the radius of the circumscribed circle is integral as well. Let $S(n)$ be the sum of the radii of the circumscribed circles of all such triangles for which the radius does not exceed $n$. $S(100)=4950$ and $S(1200)=1653605$. Find $S(10^7)$.
Every triangle has a circumscribed circle that goes through the three vertices. Consider all integer sided triangles for which the radius of the circumscribed circle is integral as well. Let $S(n)$ be the sum of the radii of the circumscribed circles of all such triangles for which the radius does not exceed $n$. $S(100)=4950$ and $S(1200)=1653605$. Find $S(10^7)$.
<p> Every triangle has a circumscribed circle that goes through the three vertices. Consider all integer sided triangles for which the radius of the circumscribed circle is integral as well. </p> <p> Let $S(n)$ be the sum of the radii of the circumscribed circles of all such triangles for which the radius does not exceed $n$. </p> <p>$S(100)=4950$ and $S(1200)=1653605$. </p> <p> Find $S(10^7)$. </p>
727227472448913
Saturday, 25th February 2012, 04:00 pm
387
75%
hard
11
Largest Product in a Grid
In the $20 \times 20$ grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50 32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70 67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21 24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72 21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95 78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92 16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57 86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58 19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40 04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66 88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69 04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36 20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16 20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54 01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48 The product of these numbers is $26 \times 63 \times 78 \times 14 = 1788696$. What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the $20 \times 20$ grid?
In the $20 \times 20$ grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50 32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70 67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21 24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72 21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95 78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92 16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57 86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58 19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40 04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66 88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69 04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36 20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16 20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54 01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48 The product of these numbers is $26 \times 63 \times 78 \times 14 = 1788696$. What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the $20 \times 20$ grid?
<p>In the $20 \times 20$ grid below, four numbers along a diagonal line have been marked in red.</p> <p class="monospace center"> 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08<br/> 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00<br/> 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65<br/> 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91<br/> 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80<br/> 24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50<br/> 32 98 81 28 64 23 67 10 <span class="red"><b>26</b></span> 38 40 67 59 54 70 66 18 38 64 70<br/> 67 26 20 68 02 62 12 20 95 <span class="red"><b>63</b></span> 94 39 63 08 40 91 66 49 94 21<br/> 24 55 58 05 66 73 99 26 97 17 <span class="red"><b>78</b></span> 78 96 83 14 88 34 89 63 72<br/> 21 36 23 09 75 00 76 44 20 45 35 <span class="red"><b>14</b></span> 00 61 33 97 34 31 33 95<br/> 78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92<br/> 16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57<br/> 86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58<br/> 19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40<br/> 04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66<br/> 88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69<br/> 04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36<br/> 20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16<br/> 20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54<br/> 01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48<br/></p> <p>The product of these numbers is $26 \times 63 \times 78 \times 14 = 1788696$.</p> <p>What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in the $20 \times 20$ grid?</p>
70600674
Friday, 22nd February 2002, 06:00 pm
252014
5%
easy
629
Scatterstone Nim
Alice and Bob are playing a modified game of Nim called Scatterstone Nim, with Alice going first, alternating turns with Bob. The game begins with an arbitrary set of stone piles with a total number of stones equal to $n$. During a player's turn, he/she must pick a pile having at least $2$ stones and perform a split operation, dividing the pile into an arbitrary set of $p$ non-empty, arbitrarily-sized piles where $2 \leq p \leq k$ for some fixed constant $k$. For example, a pile of size $4$ can be split into $\{1, 3\}$ or $\{2, 2\}$, or $\{1, 1, 2\}$ if $k = 3$ and in addition $\{1, 1, 1, 1\}$ if $k = 4$. If no valid move is possible on a given turn, then the other player wins the game. A winning position is defined as a set of stone piles where a player can ultimately ensure victory no matter what the other player does. Let $f(n,k)$ be the number of winning positions for Alice on her first turn, given parameters $n$ and $k$. For example, $f(5, 2) = 3$ with winning positions $\{1, 1, 1, 2\}, \{1, 4\}, \{2, 3\}$. In contrast, $f(5, 3) = 5$ with winning positions $\{1, 1, 1, 2\}, \{1, 1, 3\}, \{1, 4\}, \{2, 3\}, \{5\}$. Let $g(n)$ be the sum of $f(n,k)$ over all $2 \leq k \leq n$. For example, $g(7)=66$ and $g(10)=291$. Find $g(200) \bmod (10^9 + 7)$.
Alice and Bob are playing a modified game of Nim called Scatterstone Nim, with Alice going first, alternating turns with Bob. The game begins with an arbitrary set of stone piles with a total number of stones equal to $n$. During a player's turn, he/she must pick a pile having at least $2$ stones and perform a split operation, dividing the pile into an arbitrary set of $p$ non-empty, arbitrarily-sized piles where $2 \leq p \leq k$ for some fixed constant $k$. For example, a pile of size $4$ can be split into $\{1, 3\}$ or $\{2, 2\}$, or $\{1, 1, 2\}$ if $k = 3$ and in addition $\{1, 1, 1, 1\}$ if $k = 4$. If no valid move is possible on a given turn, then the other player wins the game. A winning position is defined as a set of stone piles where a player can ultimately ensure victory no matter what the other player does. Let $f(n,k)$ be the number of winning positions for Alice on her first turn, given parameters $n$ and $k$. For example, $f(5, 2) = 3$ with winning positions $\{1, 1, 1, 2\}, \{1, 4\}, \{2, 3\}$. In contrast, $f(5, 3) = 5$ with winning positions $\{1, 1, 1, 2\}, \{1, 1, 3\}, \{1, 4\}, \{2, 3\}, \{5\}$. Let $g(n)$ be the sum of $f(n,k)$ over all $2 \leq k \leq n$. For example, $g(7)=66$ and $g(10)=291$. Find $g(200) \bmod (10^9 + 7)$.
<p>Alice and Bob are playing a modified game of Nim called Scatterstone Nim, with Alice going first, alternating turns with Bob. The game begins with an arbitrary set of stone piles with a total number of stones equal to $n$.</p> <p>During a player's turn, he/she must pick a pile having at least $2$ stones and perform a split operation, dividing the pile into an arbitrary set of $p$ non-empty, arbitrarily-sized piles where $2 \leq p \leq k$ for some fixed constant $k$. For example, a pile of size $4$ can be split into $\{1, 3\}$ or $\{2, 2\}$, or $\{1, 1, 2\}$ if $k = 3$ and in addition $\{1, 1, 1, 1\}$ if $k = 4$.</p> <p>If no valid move is possible on a given turn, then the other player wins the game.</p> <p>A winning position is defined as a set of stone piles where a player can ultimately ensure victory no matter what the other player does.</p> <p>Let $f(n,k)$ be the number of winning positions for Alice on her first turn, given parameters $n$ and $k$. For example, $f(5, 2) = 3$ with winning positions $\{1, 1, 1, 2\}, \{1, 4\}, \{2, 3\}$. In contrast, $f(5, 3) = 5$ with winning positions $\{1, 1, 1, 2\}, \{1, 1, 3\}, \{1, 4\}, \{2, 3\}, \{5\}$.</p> <p>Let $g(n)$ be the sum of $f(n,k)$ over all $2 \leq k \leq n$. For example, $g(7)=66$ and $g(10)=291$.</p> <p>Find $g(200) \bmod (10^9 + 7)$.</p>
626616617
Sunday, 17th June 2018, 04:00 am
272
55%
medium
853
Pisano Periods 1
For every positive integer $n$ the Fibonacci sequence modulo $n$ is periodic. The period depends on the value of $n$. This period is called the Pisano period for $n$, often shortened to $\pi(n)$. There are three values of $n$ for which $\pi(n)$ equals $18$: $19$, $38$ and $76$. The sum of those smaller than $50$ is $57$. Find the sum of the values of $n$ smaller than $1\,000\,000\,000$ for which $\pi(n)$ equals $120$.
For every positive integer $n$ the Fibonacci sequence modulo $n$ is periodic. The period depends on the value of $n$. This period is called the Pisano period for $n$, often shortened to $\pi(n)$. There are three values of $n$ for which $\pi(n)$ equals $18$: $19$, $38$ and $76$. The sum of those smaller than $50$ is $57$. Find the sum of the values of $n$ smaller than $1\,000\,000\,000$ for which $\pi(n)$ equals $120$.
<p> For every positive integer $n$ the Fibonacci sequence modulo $n$ is periodic. The period depends on the value of $n$. This period is called the <strong>Pisano period</strong> for $n$, often shortened to $\pi(n)$.</p> <p> There are three values of $n$ for which $\pi(n)$ equals $18$: $19$, $38$ and $76$. The sum of those smaller than $50$ is $57$. </p> <p> Find the sum of the values of $n$ smaller than $1\,000\,000\,000$ for which $\pi(n)$ equals $120$. </p>
44511058204
Saturday, 9th September 2023, 05:00 pm
1469
5%
easy
670
Colouring a Strip
A certain type of tile comes in three different sizes - $1 \times 1$, $1 \times 2$, and $1 \times 3$ - and in four different colours: blue, green, red and yellow. There is an unlimited number of tiles available in each combination of size and colour. These are used to tile a $2\times n$ rectangle, where $n$ is a positive integer, subject to the following conditions: The rectangle must be fully covered by non-overlapping tiles. It is not permitted for four tiles to have their corners meeting at a single point. Adjacent tiles must be of different colours. For example, the following is an acceptable tiling of a $2\times 12$ rectangle: but the following is not an acceptable tiling, because it violates the "no four corners meeting at a point" rule: Let $F(n)$ be the number of ways the $2\times n$ rectangle can be tiled subject to these rules. Where reflecting horizontally or vertically would give a different tiling, these tilings are to be counted separately. For example, $F(2) = 120$, $F(5) = 45876$, and $F(100)\equiv 53275818 \pmod{1\,000\,004\,321}$. Find $F(10^{16}) \bmod 1\,000\,004\,321$.
A certain type of tile comes in three different sizes - $1 \times 1$, $1 \times 2$, and $1 \times 3$ - and in four different colours: blue, green, red and yellow. There is an unlimited number of tiles available in each combination of size and colour. These are used to tile a $2\times n$ rectangle, where $n$ is a positive integer, subject to the following conditions: The rectangle must be fully covered by non-overlapping tiles. It is not permitted for four tiles to have their corners meeting at a single point. Adjacent tiles must be of different colours. For example, the following is an acceptable tiling of a $2\times 12$ rectangle: but the following is not an acceptable tiling, because it violates the "no four corners meeting at a point" rule: Let $F(n)$ be the number of ways the $2\times n$ rectangle can be tiled subject to these rules. Where reflecting horizontally or vertically would give a different tiling, these tilings are to be counted separately. For example, $F(2) = 120$, $F(5) = 45876$, and $F(100)\equiv 53275818 \pmod{1\,000\,004\,321}$. Find $F(10^{16}) \bmod 1\,000\,004\,321$.
<p>A certain type of tile comes in three different sizes - $1 \times 1$, $1 \times 2$, and $1 \times 3$ - and in four different colours: blue, green, red and yellow. There is an unlimited number of tiles available in each combination of size and colour.</p> <p>These are used to tile a $2\times n$ rectangle, where $n$ is a positive integer, subject to the following conditions:</p> <ul> <li>The rectangle must be fully covered by non-overlapping tiles.</li> <li>It is <i>not</i> permitted for four tiles to have their corners meeting at a single point.</li> <li>Adjacent tiles must be of different colours.</li> </ul> <p>For example, the following is an acceptable tiling of a $2\times 12$ rectangle:</p> <div class="center"> <img alt="Acceptable colouring" src="resources/images/0670_strip_acceptable.png?1678992054"/> </div> <p>but the following is not an acceptable tiling, because it violates the "no four corners meeting at a point" rule:</p> <div class="center"> <img alt="Unacceptable colouring" src="resources/images/0670_strip_unacceptable.png?1678992054"/> </div> <p>Let $F(n)$ be the number of ways the $2\times n$ rectangle can be tiled subject to these rules. Where reflecting horizontally or vertically would give a different tiling, these tilings are to be counted separately.</p> <p>For example, $F(2) = 120$, $F(5) = 45876$, and $F(100)\equiv 53275818 \pmod{1\,000\,004\,321}$.</p> <p>Find $F(10^{16}) \bmod 1\,000\,004\,321$.</p>
551055065
Sunday, 19th May 2019, 01:00 am
375
40%
medium
64
Odd Period Square Roots
All square roots are periodic when written as continued fractions and can be written in the form: $\displaystyle \quad \quad \sqrt{N}=a_0+\frac 1 {a_1+\frac 1 {a_2+ \frac 1 {a_3+ \dots}}}$ For example, let us consider $\sqrt{23}:$ $\quad \quad \sqrt{23}=4+\sqrt{23}-4=4+\frac 1 {\frac 1 {\sqrt{23}-4}}=4+\frac 1 {1+\frac{\sqrt{23}-3}7}$ If we continue we would get the following expansion: $\displaystyle \quad \quad \sqrt{23}=4+\frac 1 {1+\frac 1 {3+ \frac 1 {1+\frac 1 {8+ \dots}}}}$ The process can be summarised as follows: $\quad \quad a_0=4, \frac 1 {\sqrt{23}-4}=\frac {\sqrt{23}+4} 7=1+\frac {\sqrt{23}-3} 7$ $\quad \quad a_1=1, \frac 7 {\sqrt{23}-3}=\frac {7(\sqrt{23}+3)} {14}=3+\frac {\sqrt{23}-3} 2$ $\quad \quad a_2=3, \frac 2 {\sqrt{23}-3}=\frac {2(\sqrt{23}+3)} {14}=1+\frac {\sqrt{23}-4} 7$ $\quad \quad a_3=1, \frac 7 {\sqrt{23}-4}=\frac {7(\sqrt{23}+4)} 7=8+\sqrt{23}-4$ $\quad \quad a_4=8, \frac 1 {\sqrt{23}-4}=\frac {\sqrt{23}+4} 7=1+\frac {\sqrt{23}-3} 7$ $\quad \quad a_5=1, \frac 7 {\sqrt{23}-3}=\frac {7 (\sqrt{23}+3)} {14}=3+\frac {\sqrt{23}-3} 2$ $\quad \quad a_6=3, \frac 2 {\sqrt{23}-3}=\frac {2(\sqrt{23}+3)} {14}=1+\frac {\sqrt{23}-4} 7$ $\quad \quad a_7=1, \frac 7 {\sqrt{23}-4}=\frac {7(\sqrt{23}+4)} {7}=8+\sqrt{23}-4$ It can be seen that the sequence is repeating. For conciseness, we use the notation $\sqrt{23}=[4;(1,3,1,8)]$, to indicate that the block (1,3,1,8) repeats indefinitely. The first ten continued fraction representations of (irrational) square roots are: $\quad \quad \sqrt{2}=[1;(2)]$, period=$1$ $\quad \quad \sqrt{3}=[1;(1,2)]$, period=$2$ $\quad \quad \sqrt{5}=[2;(4)]$, period=$1$ $\quad \quad \sqrt{6}=[2;(2,4)]$, period=$2$ $\quad \quad \sqrt{7}=[2;(1,1,1,4)]$, period=$4$ $\quad \quad \sqrt{8}=[2;(1,4)]$, period=$2$ $\quad \quad \sqrt{10}=[3;(6)]$, period=$1$ $\quad \quad \sqrt{11}=[3;(3,6)]$, period=$2$ $\quad \quad \sqrt{12}=[3;(2,6)]$, period=$2$ $\quad \quad \sqrt{13}=[3;(1,1,1,1,6)]$, period=$5$ Exactly four continued fractions, for $N \le 13$, have an odd period. How many continued fractions for $N \le 10\,000$ have an odd period?
All square roots are periodic when written as continued fractions and can be written in the form: $\displaystyle \quad \quad \sqrt{N}=a_0+\frac 1 {a_1+\frac 1 {a_2+ \frac 1 {a_3+ \dots}}}$ For example, let us consider $\sqrt{23}:$ $\quad \quad \sqrt{23}=4+\sqrt{23}-4=4+\frac 1 {\frac 1 {\sqrt{23}-4}}=4+\frac 1 {1+\frac{\sqrt{23}-3}7}$ If we continue we would get the following expansion: $\displaystyle \quad \quad \sqrt{23}=4+\frac 1 {1+\frac 1 {3+ \frac 1 {1+\frac 1 {8+ \dots}}}}$ The process can be summarised as follows: $\quad \quad a_0=4, \frac 1 {\sqrt{23}-4}=\frac {\sqrt{23}+4} 7=1+\frac {\sqrt{23}-3} 7$ $\quad \quad a_1=1, \frac 7 {\sqrt{23}-3}=\frac {7(\sqrt{23}+3)} {14}=3+\frac {\sqrt{23}-3} 2$ $\quad \quad a_2=3, \frac 2 {\sqrt{23}-3}=\frac {2(\sqrt{23}+3)} {14}=1+\frac {\sqrt{23}-4} 7$ $\quad \quad a_3=1, \frac 7 {\sqrt{23}-4}=\frac {7(\sqrt{23}+4)} 7=8+\sqrt{23}-4$ $\quad \quad a_4=8, \frac 1 {\sqrt{23}-4}=\frac {\sqrt{23}+4} 7=1+\frac {\sqrt{23}-3} 7$ $\quad \quad a_5=1, \frac 7 {\sqrt{23}-3}=\frac {7 (\sqrt{23}+3)} {14}=3+\frac {\sqrt{23}-3} 2$ $\quad \quad a_6=3, \frac 2 {\sqrt{23}-3}=\frac {2(\sqrt{23}+3)} {14}=1+\frac {\sqrt{23}-4} 7$ $\quad \quad a_7=1, \frac 7 {\sqrt{23}-4}=\frac {7(\sqrt{23}+4)} {7}=8+\sqrt{23}-4$ It can be seen that the sequence is repeating. For conciseness, we use the notation $\sqrt{23}=[4;(1,3,1,8)]$, to indicate that the block (1,3,1,8) repeats indefinitely. The first ten continued fraction representations of (irrational) square roots are: $\quad \quad \sqrt{2}=[1;(2)]$, period=$1$ $\quad \quad \sqrt{3}=[1;(1,2)]$, period=$2$ $\quad \quad \sqrt{5}=[2;(4)]$, period=$1$ $\quad \quad \sqrt{6}=[2;(2,4)]$, period=$2$ $\quad \quad \sqrt{7}=[2;(1,1,1,4)]$, period=$4$ $\quad \quad \sqrt{8}=[2;(1,4)]$, period=$2$ $\quad \quad \sqrt{10}=[3;(6)]$, period=$1$ $\quad \quad \sqrt{11}=[3;(3,6)]$, period=$2$ $\quad \quad \sqrt{12}=[3;(2,6)]$, period=$2$ $\quad \quad \sqrt{13}=[3;(1,1,1,1,6)]$, period=$5$ Exactly four continued fractions, for $N \le 13$, have an odd period. How many continued fractions for $N \le 10\,000$ have an odd period?
<p>All square roots are periodic when written as continued fractions and can be written in the form:</p> $\displaystyle \quad \quad \sqrt{N}=a_0+\frac 1 {a_1+\frac 1 {a_2+ \frac 1 {a_3+ \dots}}}$ <p>For example, let us consider $\sqrt{23}:$</p> $\quad \quad \sqrt{23}=4+\sqrt{23}-4=4+\frac 1 {\frac 1 {\sqrt{23}-4}}=4+\frac 1 {1+\frac{\sqrt{23}-3}7}$ <p>If we continue we would get the following expansion:</p> $\displaystyle \quad \quad \sqrt{23}=4+\frac 1 {1+\frac 1 {3+ \frac 1 {1+\frac 1 {8+ \dots}}}}$ <p>The process can be summarised as follows:</p> <p> $\quad \quad a_0=4, \frac 1 {\sqrt{23}-4}=\frac {\sqrt{23}+4} 7=1+\frac {\sqrt{23}-3} 7$<br/> $\quad \quad a_1=1, \frac 7 {\sqrt{23}-3}=\frac {7(\sqrt{23}+3)} {14}=3+\frac {\sqrt{23}-3} 2$<br/> $\quad \quad a_2=3, \frac 2 {\sqrt{23}-3}=\frac {2(\sqrt{23}+3)} {14}=1+\frac {\sqrt{23}-4} 7$<br/> $\quad \quad a_3=1, \frac 7 {\sqrt{23}-4}=\frac {7(\sqrt{23}+4)} 7=8+\sqrt{23}-4$<br/> $\quad \quad a_4=8, \frac 1 {\sqrt{23}-4}=\frac {\sqrt{23}+4} 7=1+\frac {\sqrt{23}-3} 7$<br/> $\quad \quad a_5=1, \frac 7 {\sqrt{23}-3}=\frac {7 (\sqrt{23}+3)} {14}=3+\frac {\sqrt{23}-3} 2$<br/> $\quad \quad a_6=3, \frac 2 {\sqrt{23}-3}=\frac {2(\sqrt{23}+3)} {14}=1+\frac {\sqrt{23}-4} 7$<br/> $\quad \quad a_7=1, \frac 7 {\sqrt{23}-4}=\frac {7(\sqrt{23}+4)} {7}=8+\sqrt{23}-4$<br/> </p> <p>It can be seen that the sequence is repeating. For conciseness, we use the notation $\sqrt{23}=[4;(1,3,1,8)]$, to indicate that the block (1,3,1,8) repeats indefinitely.</p> <p>The first ten continued fraction representations of (irrational) square roots are:</p> <p> $\quad \quad \sqrt{2}=[1;(2)]$, period=$1$<br/> $\quad \quad \sqrt{3}=[1;(1,2)]$, period=$2$<br/> $\quad \quad \sqrt{5}=[2;(4)]$, period=$1$<br/> $\quad \quad \sqrt{6}=[2;(2,4)]$, period=$2$<br/> $\quad \quad \sqrt{7}=[2;(1,1,1,4)]$, period=$4$<br/> $\quad \quad \sqrt{8}=[2;(1,4)]$, period=$2$<br/> $\quad \quad \sqrt{10}=[3;(6)]$, period=$1$<br/> $\quad \quad \sqrt{11}=[3;(3,6)]$, period=$2$<br/> $\quad \quad \sqrt{12}=[3;(2,6)]$, period=$2$<br/> $\quad \quad \sqrt{13}=[3;(1,1,1,1,6)]$, period=$5$ </p> <p>Exactly four continued fractions, for $N \le 13$, have an odd period.</p> <p>How many continued fractions for $N \le 10\,000$ have an odd period?</p>
1322
Friday, 27th February 2004, 06:00 pm
24796
20%
easy
736
Paths to Equality
Define two functions on lattice points: $r(x,y) = (x+1,2y)$ $s(x,y) = (2x,y+1)$ A path to equality of length $n$ for a pair $(a,b)$ is a sequence $\Big((a_1,b_1),(a_2,b_2),\ldots,(a_n,b_n)\Big)$, where: $(a_1,b_1) = (a,b)$ $(a_k,b_k) = r(a_{k-1},b_{k-1})$ or $(a_k,b_k) = s(a_{k-1},b_{k-1})$ for $k > 1$ $a_k \ne b_k$ for $k < n$ $a_n = b_n$ $a_n = b_n$ is called the final value. For example, $(45,90)\xrightarrow{r} (46,180)\xrightarrow{s}(92,181)\xrightarrow{s}(184,182)\xrightarrow{s}(368,183)\xrightarrow{s}(736,184)\xrightarrow{r}$ $(737,368)\xrightarrow{s}(1474,369)\xrightarrow{r}(1475,738)\xrightarrow{r}(1476,1476)$ This is a path to equality for $(45,90)$ and is of length 10 with final value 1476. There is no path to equality of $(45,90)$ with smaller length. Find the unique path to equality for $(45,90)$ with smallest odd length. Enter the final value as your answer.
Define two functions on lattice points: $r(x,y) = (x+1,2y)$ $s(x,y) = (2x,y+1)$ A path to equality of length $n$ for a pair $(a,b)$ is a sequence $\Big((a_1,b_1),(a_2,b_2),\ldots,(a_n,b_n)\Big)$, where: $(a_1,b_1) = (a,b)$ $(a_k,b_k) = r(a_{k-1},b_{k-1})$ or $(a_k,b_k) = s(a_{k-1},b_{k-1})$ for $k > 1$ $a_k \ne b_k$ for $k < n$ $a_n = b_n$ $a_n = b_n$ is called the final value. For example, $(45,90)\xrightarrow{r} (46,180)\xrightarrow{s}(92,181)\xrightarrow{s}(184,182)\xrightarrow{s}(368,183)\xrightarrow{s}(736,184)\xrightarrow{r}$ $(737,368)\xrightarrow{s}(1474,369)\xrightarrow{r}(1475,738)\xrightarrow{r}(1476,1476)$ This is a path to equality for $(45,90)$ and is of length 10 with final value 1476. There is no path to equality of $(45,90)$ with smaller length. Find the unique path to equality for $(45,90)$ with smallest odd length. Enter the final value as your answer.
<p>Define two functions on lattice points:</p> <center>$r(x,y) = (x+1,2y)$</center> <center>$s(x,y) = (2x,y+1)$</center> <p>A <i>path to equality</i> of length $n$ for a pair $(a,b)$ is a sequence $\Big((a_1,b_1),(a_2,b_2),\ldots,(a_n,b_n)\Big)$, where:</p> <ul><li>$(a_1,b_1) = (a,b)$</li> <li>$(a_k,b_k) = r(a_{k-1},b_{k-1})$ or $(a_k,b_k) = s(a_{k-1},b_{k-1})$ for $k &gt; 1$</li> <li>$a_k \ne b_k$ for $k &lt; n$</li> <li>$a_n = b_n$</li> </ul><p>$a_n = b_n$ is called the <i>final value</i>.</p> <p>For example,</p> <center>$(45,90)\xrightarrow{r} (46,180)\xrightarrow{s}(92,181)\xrightarrow{s}(184,182)\xrightarrow{s}(368,183)\xrightarrow{s}(736,184)\xrightarrow{r}$</center> <center>$(737,368)\xrightarrow{s}(1474,369)\xrightarrow{r}(1475,738)\xrightarrow{r}(1476,1476)$</center> <p>This is a path to equality for $(45,90)$ and is of length 10 with final value 1476. There is no path to equality of $(45,90)$ with smaller length.</p> <p>Find the unique path to equality for $(45,90)$ with smallest <b>odd</b> length. Enter the final value as your answer.</p>
25332747903959376
Sunday, 29th November 2020, 01:00 am
243
50%
medium
501
Eight Divisors
The eight divisors of $24$ are $1, 2, 3, 4, 6, 8, 12$ and $24$. The ten numbers not exceeding $100$ having exactly eight divisors are $24, 30, 40, 42, 54, 56, 66, 70, 78$ and $88$. Let $f(n)$ be the count of numbers not exceeding $n$ with exactly eight divisors. You are given $f(100) = 10$, $f(1000) = 180$ and $f(10^6) = 224427$. Find $f(10^{12})$.
The eight divisors of $24$ are $1, 2, 3, 4, 6, 8, 12$ and $24$. The ten numbers not exceeding $100$ having exactly eight divisors are $24, 30, 40, 42, 54, 56, 66, 70, 78$ and $88$. Let $f(n)$ be the count of numbers not exceeding $n$ with exactly eight divisors. You are given $f(100) = 10$, $f(1000) = 180$ and $f(10^6) = 224427$. Find $f(10^{12})$.
<p>The eight divisors of $24$ are $1, 2, 3, 4, 6, 8, 12$ and $24$. The ten numbers not exceeding $100$ having exactly eight divisors are $24, 30, 40, 42, 54, 56, 66, 70, 78$ and $88$. Let $f(n)$ be the count of numbers not exceeding $n$ with exactly eight divisors.<br/> You are given $f(100) = 10$, $f(1000) = 180$ and $f(10^6) = 224427$.<br/> Find $f(10^{12})$.</p>
197912312715
Saturday, 31st January 2015, 01:00 pm
1521
40%
medium
2
Even Fibonacci Numbers
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with $1$ and $2$, the first $10$ terms will be: $$1, 2, 3, 5, 8, 13, 21, 34, 55, 89, \dots$$ By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with $1$ and $2$, the first $10$ terms will be: $$1, 2, 3, 5, 8, 13, 21, 34, 55, 89, \dots$$ By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
<p>Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with $1$ and $2$, the first $10$ terms will be: $$1, 2, 3, 5, 8, 13, 21, 34, 55, 89, \dots$$</p> <p>By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.</p>
4613732
Friday, 19th October 2001, 06:00 pm
816741
5%
easy
43
Sub-string Divisibility
The number, $1406357289$, is a $0$ to $9$ pandigital number because it is made up of each of the digits $0$ to $9$ in some order, but it also has a rather interesting sub-string divisibility property. Let $d_1$ be the $1$st digit, $d_2$ be the $2$nd digit, and so on. In this way, we note the following: $d_2d_3d_4=406$ is divisible by $2$ $d_3d_4d_5=063$ is divisible by $3$ $d_4d_5d_6=635$ is divisible by $5$ $d_5d_6d_7=357$ is divisible by $7$ $d_6d_7d_8=572$ is divisible by $11$ $d_7d_8d_9=728$ is divisible by $13$ $d_8d_9d_{10}=289$ is divisible by $17$ Find the sum of all $0$ to $9$ pandigital numbers with this property.
The number, $1406357289$, is a $0$ to $9$ pandigital number because it is made up of each of the digits $0$ to $9$ in some order, but it also has a rather interesting sub-string divisibility property. Let $d_1$ be the $1$st digit, $d_2$ be the $2$nd digit, and so on. In this way, we note the following: $d_2d_3d_4=406$ is divisible by $2$ $d_3d_4d_5=063$ is divisible by $3$ $d_4d_5d_6=635$ is divisible by $5$ $d_5d_6d_7=357$ is divisible by $7$ $d_6d_7d_8=572$ is divisible by $11$ $d_7d_8d_9=728$ is divisible by $13$ $d_8d_9d_{10}=289$ is divisible by $17$ Find the sum of all $0$ to $9$ pandigital numbers with this property.
<p>The number, $1406357289$, is a $0$ to $9$ pandigital number because it is made up of each of the digits $0$ to $9$ in some order, but it also has a rather interesting sub-string divisibility property.</p> <p>Let $d_1$ be the $1$<sup>st</sup> digit, $d_2$ be the $2$<sup>nd</sup> digit, and so on. In this way, we note the following:</p> <ul><li>$d_2d_3d_4=406$ is divisible by $2$</li> <li>$d_3d_4d_5=063$ is divisible by $3$</li> <li>$d_4d_5d_6=635$ is divisible by $5$</li> <li>$d_5d_6d_7=357$ is divisible by $7$</li> <li>$d_6d_7d_8=572$ is divisible by $11$</li> <li>$d_7d_8d_9=728$ is divisible by $13$</li> <li>$d_8d_9d_{10}=289$ is divisible by $17$</li> </ul><p>Find the sum of all $0$ to $9$ pandigital numbers with this property.</p>
16695334890
Friday, 9th May 2003, 06:00 pm
65767
5%
easy
635
Subset Sums
Let $A_q(n)$ be the number of subsets, $B$, of the set $\{1, 2, ..., q \cdot n\}$ that satisfy two conditions: 1) $B$ has exactly $n$ elements; 2) the sum of the elements of $B$ is divisible by $n$. E.g. $A_2(5)=52$ and $A_3(5)=603$. Let $S_q(L)$ be $\sum A_q(p)$ where the sum is taken over all primes $p \le L$. E.g. $S_2(10)=554$, $S_2(100)$ mod $1\,000\,000\,009=100433628$ and $S_3(100)$ mod $1\,000\,000\,009=855618282$. Find $S_2(10^8)+S_3(10^8)$. Give your answer modulo $1\,000\,000\,009$.
Let $A_q(n)$ be the number of subsets, $B$, of the set $\{1, 2, ..., q \cdot n\}$ that satisfy two conditions: 1) $B$ has exactly $n$ elements; 2) the sum of the elements of $B$ is divisible by $n$. E.g. $A_2(5)=52$ and $A_3(5)=603$. Let $S_q(L)$ be $\sum A_q(p)$ where the sum is taken over all primes $p \le L$. E.g. $S_2(10)=554$, $S_2(100)$ mod $1\,000\,000\,009=100433628$ and $S_3(100)$ mod $1\,000\,000\,009=855618282$. Find $S_2(10^8)+S_3(10^8)$. Give your answer modulo $1\,000\,000\,009$.
<p> Let $A_q(n)$ be the number of subsets, $B$, of the set $\{1, 2, ..., q \cdot n\}$ that satisfy two conditions:<br/> 1) $B$ has exactly $n$ elements;<br/> 2) the sum of the elements of $B$ is divisible by $n$. </p> <p> E.g. $A_2(5)=52$ and $A_3(5)=603$. </p> Let $S_q(L)$ be $\sum A_q(p)$ where the sum is taken over all primes $p \le L$.<br/> E.g. $S_2(10)=554$, $S_2(100)$ mod $1\,000\,000\,009=100433628$ and<br/> $S_3(100)$ mod $1\,000\,000\,009=855618282$. <p> Find $S_2(10^8)+S_3(10^8)$. Give your answer modulo $1\,000\,000\,009$. </p>
689294705
Saturday, 25th August 2018, 07:00 pm
387
40%
medium
530
GCD of Divisors
Every divisor $d$ of a number $n$ has a complementary divisor $n/d$. Let $f(n)$ be the sum of the greatest common divisor of $d$ and $n/d$ over all positive divisors $d$ of $n$, that is $f(n)=\displaystyle\sum_{d\mid n}\gcd(d,\frac n d)$. Let $F$ be the summatory function of $f$, that is $F(k)=\displaystyle\sum_{n=1}^k f(n)$. You are given that $F(10)=32$ and $F(1000)=12776$. Find $F(10^{15})$.
Every divisor $d$ of a number $n$ has a complementary divisor $n/d$. Let $f(n)$ be the sum of the greatest common divisor of $d$ and $n/d$ over all positive divisors $d$ of $n$, that is $f(n)=\displaystyle\sum_{d\mid n}\gcd(d,\frac n d)$. Let $F$ be the summatory function of $f$, that is $F(k)=\displaystyle\sum_{n=1}^k f(n)$. You are given that $F(10)=32$ and $F(1000)=12776$. Find $F(10^{15})$.
<p>Every divisor $d$ of a number $n$ has a <strong>complementary divisor</strong> $n/d$.</p> <p>Let $f(n)$ be the sum of the <strong>greatest common divisor</strong> of $d$ and $n/d$ over all positive divisors $d$ of $n$, that is $f(n)=\displaystyle\sum_{d\mid n}\gcd(d,\frac n d)$.</p> <p>Let $F$ be the summatory function of $f$, that is $F(k)=\displaystyle\sum_{n=1}^k f(n)$.</p> <p>You are given that $F(10)=32$ and $F(1000)=12776$.</p> <p>Find $F(10^{15})$.</p>
207366437157977206
Sunday, 18th October 2015, 01:00 am
507
60%
hard
168
Number Rotations
Consider the number $142857$. We can right-rotate this number by moving the last digit ($7$) to the front of it, giving us $714285$. It can be verified that $714285 = 5 \times 142857$. This demonstrates an unusual property of $142857$: it is a divisor of its right-rotation. Find the last $5$ digits of the sum of all integers $n$, $10 \lt n \lt 10^{100}$, that have this property.
Consider the number $142857$. We can right-rotate this number by moving the last digit ($7$) to the front of it, giving us $714285$. It can be verified that $714285 = 5 \times 142857$. This demonstrates an unusual property of $142857$: it is a divisor of its right-rotation. Find the last $5$ digits of the sum of all integers $n$, $10 \lt n \lt 10^{100}$, that have this property.
<p>Consider the number $142857$. We can right-rotate this number by moving the last digit ($7$) to the front of it, giving us $714285$.<br/> It can be verified that $714285 = 5 \times 142857$.<br/> This demonstrates an unusual property of $142857$: it is a divisor of its right-rotation.</p> <p>Find the last $5$ digits of the sum of all integers $n$, $10 \lt n \lt 10^{100}$, that have this property.</p>
59206
Friday, 16th November 2007, 05:00 pm
2992
65%
hard
810
XOR-Primes
We use $x\oplus y$ for the bitwise XOR of $x$ and $y$. Define the XOR-product of $x$ and $y$, denoted by $x \otimes y$, similar to a long multiplication in base $2$, except that the intermediate results are XORed instead of the usual integer addition. For example, $7 \otimes 3 = 9$, or in base $2$, $111_2 \otimes 11_2 = 1001_2$: $$ \begin{align*} \phantom{\otimes 111} 111_2 \\ \otimes \phantom{1111} 11_2 \\ \hline \phantom{\otimes 111} 111_2 \\ \oplus \phantom{11} 111_2 \phantom{9} \\ \hline \phantom{\otimes 11} 1001_2 \\ \end{align*} $$ An XOR-prime is an integer $n$ greater than $1$ that is not an XOR-product of two integers greater than $1$. The above example shows that $9$ is not an XOR-prime. Similarly, $5 = 3 \otimes 3$ is not an XOR-prime. The first few XOR-primes are $2, 3, 7, 11, 13, ...$ and the 10th XOR-prime is $41$. Find the $5\,000\,000$th XOR-prime.
We use $x\oplus y$ for the bitwise XOR of $x$ and $y$. Define the XOR-product of $x$ and $y$, denoted by $x \otimes y$, similar to a long multiplication in base $2$, except that the intermediate results are XORed instead of the usual integer addition. For example, $7 \otimes 3 = 9$, or in base $2$, $111_2 \otimes 11_2 = 1001_2$: $$ \begin{align*} \phantom{\otimes 111} 111_2 \\ \otimes \phantom{1111} 11_2 \\ \hline \phantom{\otimes 111} 111_2 \\ \oplus \phantom{11} 111_2 \phantom{9} \\ \hline \phantom{\otimes 11} 1001_2 \\ \end{align*} $$ An XOR-prime is an integer $n$ greater than $1$ that is not an XOR-product of two integers greater than $1$. The above example shows that $9$ is not an XOR-prime. Similarly, $5 = 3 \otimes 3$ is not an XOR-prime. The first few XOR-primes are $2, 3, 7, 11, 13, ...$ and the 10th XOR-prime is $41$. Find the $5\,000\,000$th XOR-prime.
<p>We use $x\oplus y$ for the bitwise XOR of $x$ and $y$.</p> <p>Define the <dfn>XOR-product</dfn> of $x$ and $y$, denoted by $x \otimes y$, similar to a long multiplication in base $2$, except that the intermediate results are XORed instead of the usual integer addition.</p> <p>For example, $7 \otimes 3 = 9$, or in base $2$, $111_2 \otimes 11_2 = 1001_2$:</p> $$ \begin{align*} \phantom{\otimes 111} 111_2 \\ \otimes \phantom{1111} 11_2 \\ \hline \phantom{\otimes 111} 111_2 \\ \oplus \phantom{11} 111_2 \phantom{9} \\ \hline \phantom{\otimes 11} 1001_2 \\ \end{align*} $$ <p>An <dfn>XOR-prime</dfn> is an integer $n$ greater than $1$ that is not an XOR-product of two integers greater than $1$. The above example shows that $9$ is not an XOR-prime. Similarly, $5 = 3 \otimes 3$ is not an XOR-prime. The first few XOR-primes are $2, 3, 7, 11, 13, ...$ and the 10th XOR-prime is $41$.</p> <p>Find the $5\,000\,000$th XOR-prime.</p>
124136381
Sunday, 2nd October 2022, 11:00 am
794
20%
easy
822
Square the Smallest
A list initially contains the numbers $2, 3, \dots, n$. At each round, the smallest number in the list is replaced by its square. If there is more than one such number, then only one of them is replaced. For example, below are the first three rounds for $n = 5$: $$[2, 3, 4, 5] \xrightarrow{(1)} [4, 3, 4, 5] \xrightarrow{(2)} [4, 9, 4, 5] \xrightarrow{(3)} [16, 9, 4, 5].$$ Let $S(n, m)$ be the sum of all numbers in the list after $m$ rounds. For example, $S(5, 3) = 16 + 9 + 4 + 5 = 34$. Also $S(10, 100) \equiv 845339386 \pmod{1234567891}$. Find $S(10^4, 10^{16})$. Give your answer modulo $1234567891$.
A list initially contains the numbers $2, 3, \dots, n$. At each round, the smallest number in the list is replaced by its square. If there is more than one such number, then only one of them is replaced. For example, below are the first three rounds for $n = 5$: $$[2, 3, 4, 5] \xrightarrow{(1)} [4, 3, 4, 5] \xrightarrow{(2)} [4, 9, 4, 5] \xrightarrow{(3)} [16, 9, 4, 5].$$ Let $S(n, m)$ be the sum of all numbers in the list after $m$ rounds. For example, $S(5, 3) = 16 + 9 + 4 + 5 = 34$. Also $S(10, 100) \equiv 845339386 \pmod{1234567891}$. Find $S(10^4, 10^{16})$. Give your answer modulo $1234567891$.
<p> A list initially contains the numbers $2, 3, \dots, n$.<br> At each round, the smallest number in the list is replaced by its square. If there is more than one such number, then only one of them is replaced. </br></p> <p> For example, below are the first three rounds for $n = 5$: $$[2, 3, 4, 5] \xrightarrow{(1)} [4, 3, 4, 5] \xrightarrow{(2)} [4, 9, 4, 5] \xrightarrow{(3)} [16, 9, 4, 5].$$ </p> <p> Let $S(n, m)$ be the sum of all numbers in the list after $m$ rounds.<br/><br/> For example, $S(5, 3) = 16 + 9 + 4 + 5 = 34$. Also $S(10, 100) \equiv 845339386 \pmod{1234567891}$. </p> <p> Find $S(10^4, 10^{16})$. Give your answer modulo $1234567891$. </p>
950591530
Saturday, 24th December 2022, 10:00 pm
876
15%
easy
77
Prime Summations
It is possible to write ten as the sum of primes in exactly five different ways: \begin{align} &7 + 3\\ &5 + 5\\ &5 + 3 + 2\\ &3 + 3 + 2 + 2\\ &2 + 2 + 2 + 2 + 2 \end{align} What is the first value which can be written as the sum of primes in over five thousand different ways?
It is possible to write ten as the sum of primes in exactly five different ways: \begin{align} &7 + 3\\ &5 + 5\\ &5 + 3 + 2\\ &3 + 3 + 2 + 2\\ &2 + 2 + 2 + 2 + 2 \end{align} What is the first value which can be written as the sum of primes in over five thousand different ways?
<p>It is possible to write ten as the sum of primes in exactly five different ways:</p> \begin{align} &7 + 3\\ &5 + 5\\ &5 + 3 + 2\\ &3 + 3 + 2 + 2\\ &2 + 2 + 2 + 2 + 2 \end{align} <p>What is the first value which can be written as the sum of primes in over five thousand different ways?</p>
71
Friday, 27th August 2004, 06:00 pm
21578
25%
easy
314
The Mouse on the Moon
The moon has been opened up, and land can be obtained for free, but there is a catch. You have to build a wall around the land that you stake out, and building a wall on the moon is expensive. Every country has been allotted a $\pu{500 m}$ by $\pu{500 m}$ square area, but they will possess only that area which they wall in. $251001$ posts have been placed in a rectangular grid with $1$ meter spacing. The wall must be a closed series of straight lines, each line running from post to post. The bigger countries of course have built a $\pu{2000 m}$ wall enclosing the entire $\pu{250 000 m^2}$ area. The Duchy of Grand Fenwick, has a tighter budget, and has asked you (their Royal Programmer) to compute what shape would get best maximum enclosed-area/wall-length ratio. You have done some preliminary calculations on a sheet of paper. For a $2000$ meter wall enclosing the $\pu{250 000 m^2}$ area the enclosed-area/wall-length ratio is $125$. Although not allowed , but to get an idea if this is anything better: if you place a circle inside the square area touching the four sides the area will be equal to $\pi \times \pu{250^2 m^2}$ and the perimeter will be $\pi \times \pu{500 m}$, so the enclosed-area/wall-length ratio will also be $125$. However, if you cut off from the square four triangles with sides $\pu{75 m}$, $\pu{75 m}$ and $75\pu{\sqrt 2 m}$ the total area becomes $\pu{238750 m^2}$ and the perimeter becomes $1400+300\pu{\sqrt 2 m}$. So this gives an enclosed-area/wall-length ratio of $130.87$, which is significantly better. Find the maximum enclosed-area/wall-length ratio. Give your answer rounded to $8$ places behind the decimal point in the form abc.defghijk.
The moon has been opened up, and land can be obtained for free, but there is a catch. You have to build a wall around the land that you stake out, and building a wall on the moon is expensive. Every country has been allotted a $\pu{500 m}$ by $\pu{500 m}$ square area, but they will possess only that area which they wall in. $251001$ posts have been placed in a rectangular grid with $1$ meter spacing. The wall must be a closed series of straight lines, each line running from post to post. The bigger countries of course have built a $\pu{2000 m}$ wall enclosing the entire $\pu{250 000 m^2}$ area. The Duchy of Grand Fenwick, has a tighter budget, and has asked you (their Royal Programmer) to compute what shape would get best maximum enclosed-area/wall-length ratio. You have done some preliminary calculations on a sheet of paper. For a $2000$ meter wall enclosing the $\pu{250 000 m^2}$ area the enclosed-area/wall-length ratio is $125$. Although not allowed , but to get an idea if this is anything better: if you place a circle inside the square area touching the four sides the area will be equal to $\pi \times \pu{250^2 m^2}$ and the perimeter will be $\pi \times \pu{500 m}$, so the enclosed-area/wall-length ratio will also be $125$. However, if you cut off from the square four triangles with sides $\pu{75 m}$, $\pu{75 m}$ and $75\pu{\sqrt 2 m}$ the total area becomes $\pu{238750 m^2}$ and the perimeter becomes $1400+300\pu{\sqrt 2 m}$. So this gives an enclosed-area/wall-length ratio of $130.87$, which is significantly better. Find the maximum enclosed-area/wall-length ratio. Give your answer rounded to $8$ places behind the decimal point in the form abc.defghijk.
<p> The moon has been opened up, and land can be obtained for free, but there is a catch. You have to build a wall around the land that you stake out, and building a wall on the moon is expensive. Every country has been allotted a $\pu{500 m}$ by $\pu{500 m}$ square area, but they will possess only that area which they wall in. $251001$ posts have been placed in a rectangular grid with $1$ meter spacing. The wall must be a closed series of straight lines, each line running from post to post. </p> <p> The bigger countries of course have built a $\pu{2000 m}$ wall enclosing the entire $\pu{250 000 m^2}$ area. The <a href="http://en.wikipedia.org/wiki/Grand_Fenwick">Duchy of Grand Fenwick</a>, has a tighter budget, and has asked you (their Royal Programmer) to compute what shape would get best maximum enclosed-area/wall-length ratio. </p> <p> You have done some preliminary calculations on a sheet of paper. For a $2000$ meter wall enclosing the $\pu{250 000 m^2}$ area the enclosed-area/wall-length ratio is $125$.<br/> Although not allowed , but to get an idea if this is anything better: if you place a circle inside the square area touching the four sides the area will be equal to $\pi \times \pu{250^2 m^2}$ and the perimeter will be $\pi \times \pu{500 m}$, so the enclosed-area/wall-length ratio will also be $125$. </p> <p> However, if you cut off from the square four triangles with sides $\pu{75 m}$, $\pu{75 m}$ and $75\pu{\sqrt 2 m}$ the total area becomes $\pu{238750 m^2}$ and the perimeter becomes $1400+300\pu{\sqrt 2 m}$. So this gives an enclosed-area/wall-length ratio of $130.87$, which is significantly better. </p> <div align="center"><img alt="0314_landgrab.gif" class="dark_img" src="resources/images/0314_landgrab.gif?1678992056"/></div> <p> Find the maximum enclosed-area/wall-length ratio.<br/> Give your answer rounded to $8$ places behind the decimal point in the form abc.defghijk. </p>
132.52756426
Sunday, 12th December 2010, 07:00 am
579
80%
hard
297
Zeckendorf Representation
Each new term in the Fibonacci sequence is generated by adding the previous two terms. Starting with $1$ and $2$, the first $10$ terms will be: $1, 2, 3, 5, 8, 13, 21, 34, 55, 89$. Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, $100 = 3 + 8 + 89$. Such a sum is called the Zeckendorf representation of the number. For any integer $n \gt 0$, let $z(n)$ be the number of terms in the Zeckendorf representation of $n$. Thus, $z(5) = 1$, $z(14) = 2$, $z(100) = 3$ etc. Also, for $0 \lt n \lt 10^6$, $\sum z(n) = 7894453$. Find $\sum z(n)$ for $0 \lt n \lt 10^{17}$.
Each new term in the Fibonacci sequence is generated by adding the previous two terms. Starting with $1$ and $2$, the first $10$ terms will be: $1, 2, 3, 5, 8, 13, 21, 34, 55, 89$. Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, $100 = 3 + 8 + 89$. Such a sum is called the Zeckendorf representation of the number. For any integer $n \gt 0$, let $z(n)$ be the number of terms in the Zeckendorf representation of $n$. Thus, $z(5) = 1$, $z(14) = 2$, $z(100) = 3$ etc. Also, for $0 \lt n \lt 10^6$, $\sum z(n) = 7894453$. Find $\sum z(n)$ for $0 \lt n \lt 10^{17}$.
<p>Each new term in the Fibonacci sequence is generated by adding the previous two terms.<br/> Starting with $1$ and $2$, the first $10$ terms will be: $1, 2, 3, 5, 8, 13, 21, 34, 55, 89$.</p> <p>Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, $100 = 3 + 8 + 89$.<br/> Such a sum is called the <strong>Zeckendorf representation</strong> of the number.</p> <p>For any integer $n \gt 0$, let $z(n)$ be the number of terms in the Zeckendorf representation of $n$.<br/> Thus, $z(5) = 1$, $z(14) = 2$, $z(100) = 3$ etc.<br/> Also, for $0 \lt n \lt 10^6$, $\sum z(n) = 7894453$.</p> <p>Find $\sum z(n)$ for $0 \lt n \lt 10^{17}$.</p>
2252639041804718029
Friday, 18th June 2010, 05:00 pm
3045
35%
medium
503
Compromise or Persist
Alice is playing a game with $n$ cards numbered $1$ to $n$. A game consists of iterations of the following steps. (1) Alice picks one of the cards at random. (2) Alice cannot see the number on it. Instead, Bob, one of her friends, sees the number and tells Alice how many previously-seen numbers are bigger than the number which he is seeing. (3) Alice can end or continue the game. If she decides to end, the number becomes her score. If she decides to continue, the card is removed from the game and she returns to (1). If there is no card left, she is forced to end the game. Let $F(n)$ be Alice's expected score if she takes the optimized strategy to minimize her score. For example, $F(3) = 5/3$. At the first iteration, she should continue the game. At the second iteration, she should end the game if Bob says that one previously-seen number is bigger than the number which he is seeing, otherwise she should continue the game. We can also verify that $F(4) = 15/8$ and $F(10) \approx 2.5579365079$. Find $F(10^6)$. Give your answer rounded to $10$ decimal places behind the decimal point.
Alice is playing a game with $n$ cards numbered $1$ to $n$. A game consists of iterations of the following steps. (1) Alice picks one of the cards at random. (2) Alice cannot see the number on it. Instead, Bob, one of her friends, sees the number and tells Alice how many previously-seen numbers are bigger than the number which he is seeing. (3) Alice can end or continue the game. If she decides to end, the number becomes her score. If she decides to continue, the card is removed from the game and she returns to (1). If there is no card left, she is forced to end the game. Let $F(n)$ be Alice's expected score if she takes the optimized strategy to minimize her score. For example, $F(3) = 5/3$. At the first iteration, she should continue the game. At the second iteration, she should end the game if Bob says that one previously-seen number is bigger than the number which he is seeing, otherwise she should continue the game. We can also verify that $F(4) = 15/8$ and $F(10) \approx 2.5579365079$. Find $F(10^6)$. Give your answer rounded to $10$ decimal places behind the decimal point.
<p>Alice is playing a game with $n$ cards numbered $1$ to $n$.</p> <p>A game consists of iterations of the following steps.<br/> (1) Alice picks one of the cards at random.<br/> (2) Alice cannot see the number on it. Instead, Bob, one of her friends, sees the number and tells Alice how many previously-seen numbers are bigger than the number which he is seeing.<br/> (3) Alice can end or continue the game. If she decides to end, the number becomes her score. If she decides to continue, the card is removed from the game and she returns to (1). If there is no card left, she is forced to end the game.<br/></p> <p>Let $F(n)$ be Alice's expected score if she takes the optimized strategy to <b>minimize</b> her score.</p> <p>For example, $F(3) = 5/3$. At the first iteration, she should continue the game. At the second iteration, she should end the game if Bob says that one previously-seen number is bigger than the number which he is seeing, otherwise she should continue the game.</p> <p>We can also verify that $F(4) = 15/8$ and $F(10) \approx 2.5579365079$.</p> <p>Find $F(10^6)$. Give your answer rounded to $10$ decimal places behind the decimal point.</p>
3.8694550145
Saturday, 14th February 2015, 07:00 pm
359
60%
hard
491
Double Pandigital Number Divisible by $11$
We call a positive integer double pandigital if it uses all the digits $0$ to $9$ exactly twice (with no leading zero). For example, $40561817703823564929$ is one such number. How many double pandigital numbers are divisible by $11$?
We call a positive integer double pandigital if it uses all the digits $0$ to $9$ exactly twice (with no leading zero). For example, $40561817703823564929$ is one such number. How many double pandigital numbers are divisible by $11$?
<p>We call a positive integer <dfn>double pandigital</dfn> if it uses all the digits $0$ to $9$ exactly twice (with no leading zero). For example, $40561817703823564929$ is one such number.</p> <p>How many double pandigital numbers are divisible by $11$?</p>
194505988824000
Sunday, 30th November 2014, 10:00 am
2368
20%
easy
721
High Powers of Irrational Numbers
Given is the function $f(a,n)=\lfloor (\lceil \sqrt a \rceil + \sqrt a)^n \rfloor$. $\lfloor \cdot \rfloor$ denotes the floor function and $\lceil \cdot \rceil$ denotes the ceiling function. $f(5,2)=27$ and $f(5,5)=3935$. $G(n) = \displaystyle \sum_{a=1}^n f(a, a^2).$ $G(1000) \bmod 999\,999\,937=163861845. $ Find $G(5\,000\,000).$ Give your answer modulo $999\,999\,937$.
Given is the function $f(a,n)=\lfloor (\lceil \sqrt a \rceil + \sqrt a)^n \rfloor$. $\lfloor \cdot \rfloor$ denotes the floor function and $\lceil \cdot \rceil$ denotes the ceiling function. $f(5,2)=27$ and $f(5,5)=3935$. $G(n) = \displaystyle \sum_{a=1}^n f(a, a^2).$ $G(1000) \bmod 999\,999\,937=163861845. $ Find $G(5\,000\,000).$ Give your answer modulo $999\,999\,937$.
<p> Given is the function $f(a,n)=\lfloor (\lceil \sqrt a \rceil + \sqrt a)^n \rfloor$.<br/> $\lfloor \cdot \rfloor$ denotes the floor function and $\lceil \cdot \rceil$ denotes the ceiling function.<br/> $f(5,2)=27$ and $f(5,5)=3935$. </p> <p> $G(n) = \displaystyle \sum_{a=1}^n f(a, a^2).$<br/> $G(1000) \bmod 999\,999\,937=163861845. $<br/> Find $G(5\,000\,000).$ Give your answer modulo $999\,999\,937$. </p>
700792959
Sunday, 21st June 2020, 02:00 am
472
30%
easy
838
Not Coprime
Let $f(N)$ be the smallest positive integer that is not coprime to any positive integer $n \le N$ whose least significant digit is $3$. For example $f(40)$ equals to $897 = 3 \cdot 13 \cdot 23$ since it is not coprime to any of $3,13,23,33$. By taking the natural logarithm (log to base $e$) we obtain $\ln f(40) = \ln 897 \approx 6.799056$ when rounded to six digits after the decimal point. You are also given $\ln f(2800) \approx 715.019337$. Find $f(10^6)$. Enter its natural logarithm rounded to six digits after the decimal point.
Let $f(N)$ be the smallest positive integer that is not coprime to any positive integer $n \le N$ whose least significant digit is $3$. For example $f(40)$ equals to $897 = 3 \cdot 13 \cdot 23$ since it is not coprime to any of $3,13,23,33$. By taking the natural logarithm (log to base $e$) we obtain $\ln f(40) = \ln 897 \approx 6.799056$ when rounded to six digits after the decimal point. You are also given $\ln f(2800) \approx 715.019337$. Find $f(10^6)$. Enter its natural logarithm rounded to six digits after the decimal point.
<p>Let $f(N)$ be the smallest positive integer that is not coprime to any positive integer $n \le N$ whose least significant digit is $3$.</p> <p>For example $f(40)$ equals to $897 = 3 \cdot 13 \cdot 23$ since it is not coprime to any of $3,13,23,33$. By taking the <b><a href="https://en.wikipedia.org/wiki/Natural_logarithm">natural logarithm</a></b> (log to base $e$) we obtain $\ln f(40) = \ln 897 \approx 6.799056$ when rounded to six digits after the decimal point.</p> <p>You are also given $\ln f(2800) \approx 715.019337$.</p> <p>Find $f(10^6)$. Enter its natural logarithm rounded to six digits after the decimal point.</p>
250591.442792
Saturday, 8th April 2023, 08:00 pm
640
20%
easy
544
Chromatic Conundrum
Let $F(r, c, n)$ be the number of ways to colour a rectangular grid with $r$ rows and $c$ columns using at most $n$ colours such that no two adjacent cells share the same colour. Cells that are diagonal to each other are not considered adjacent. For example, $F(2,2,3) = 18$, $F(2,2,20) = 130340$, and $F(3,4,6) = 102923670$. Let $S(r, c, n) = \sum_{k=1}^{n} F(r, c, k)$. For example, $S(4,4,15) \bmod 10^9+7 = 325951319$. Find $S(9,10,1112131415) \bmod 10^9+7$.
Let $F(r, c, n)$ be the number of ways to colour a rectangular grid with $r$ rows and $c$ columns using at most $n$ colours such that no two adjacent cells share the same colour. Cells that are diagonal to each other are not considered adjacent. For example, $F(2,2,3) = 18$, $F(2,2,20) = 130340$, and $F(3,4,6) = 102923670$. Let $S(r, c, n) = \sum_{k=1}^{n} F(r, c, k)$. For example, $S(4,4,15) \bmod 10^9+7 = 325951319$. Find $S(9,10,1112131415) \bmod 10^9+7$.
<p>Let $F(r, c, n)$ be the number of ways to colour a rectangular grid with $r$ rows and $c$ columns using at most $n$ colours such that no two adjacent cells share the same colour. Cells that are diagonal to each other are not considered adjacent.</p> <p>For example, $F(2,2,3) = 18$, $F(2,2,20) = 130340$, and $F(3,4,6) = 102923670$.</p> <p>Let $S(r, c, n) = \sum_{k=1}^{n} F(r, c, k)$.</p> <p>For example, $S(4,4,15) \bmod 10^9+7 = 325951319$.</p> <p>Find $S(9,10,1112131415) \bmod 10^9+7$.</p>
640432376
Saturday, 23rd January 2016, 07:00 pm
291
90%
hard
642
Sum of Largest Prime Factors
Let $f(n)$ be the largest prime factor of $n$ and $\displaystyle F(n) = \sum_{i=2}^n f(i)$. For example $F(10)=32$, $F(100)=1915$ and $F(10000)=10118280$. Find $F(201820182018)$. Give your answer modulus $10^9$.
Let $f(n)$ be the largest prime factor of $n$ and $\displaystyle F(n) = \sum_{i=2}^n f(i)$. For example $F(10)=32$, $F(100)=1915$ and $F(10000)=10118280$. Find $F(201820182018)$. Give your answer modulus $10^9$.
<p>Let $f(n)$ be the largest prime factor of $n$ and $\displaystyle F(n) = \sum_{i=2}^n f(i)$.<br/> For example $F(10)=32$, $F(100)=1915$ and $F(10000)=10118280$.</p> <p> Find $F(201820182018)$. Give your answer modulus $10^9$.</p>
631499044
Saturday, 10th November 2018, 04:00 pm
402
45%
medium
866
Tidying Up B
A small child has a “number caterpillar” consisting of $N$ jigsaw pieces, each with one number on it, which, when connected together in a line, reveal the numbers $1$ to $N$ in order. Every night, the child's father has to pick up the pieces of the caterpillar that have been scattered across the play room. He picks up the pieces at random and places them in the correct order. As the caterpillar is built up in this way, it forms distinct segments that gradually merge together. Any time the father places a new piece in its correct position, a segment of length $k$ is formed and he writes down the $k$th hexagonal number $k\cdot(2k-1)$. Once all pieces have been placed and the full caterpillar constructed he calculates the product of all the numbers written down. Interestingly, the expected value of this product is always an integer. For example if $N=4$ then the expected value is $994$. Find the expected value of the product for a caterpillar of $N=100$ pieces. Give your answer modulo $987654319$.
A small child has a “number caterpillar” consisting of $N$ jigsaw pieces, each with one number on it, which, when connected together in a line, reveal the numbers $1$ to $N$ in order. Every night, the child's father has to pick up the pieces of the caterpillar that have been scattered across the play room. He picks up the pieces at random and places them in the correct order. As the caterpillar is built up in this way, it forms distinct segments that gradually merge together. Any time the father places a new piece in its correct position, a segment of length $k$ is formed and he writes down the $k$th hexagonal number $k\cdot(2k-1)$. Once all pieces have been placed and the full caterpillar constructed he calculates the product of all the numbers written down. Interestingly, the expected value of this product is always an integer. For example if $N=4$ then the expected value is $994$. Find the expected value of the product for a caterpillar of $N=100$ pieces. Give your answer modulo $987654319$.
<p> A small child has a “number caterpillar” consisting of $N$ jigsaw pieces, each with one number on it, which, when connected together in a line, reveal the numbers $1$ to $N$ in order.</p> <p> Every night, the child's father has to pick up the pieces of the caterpillar that have been scattered across the play room. He picks up the pieces at random and places them in the correct order.<br/> As the caterpillar is built up in this way, it forms distinct segments that gradually merge together.</p> <p> Any time the father places a new piece in its correct position, a segment of length $k$ is formed and he writes down the $k$<sup>th</sup> hexagonal number $k\cdot(2k-1)$. Once all pieces have been placed and the full caterpillar constructed he calculates the product of all the numbers written down. Interestingly, the expected value of this product is always an integer. For example if $N=4$ then the expected value is $994$.</p> <p> Find the expected value of the product for a caterpillar of $N=100$ pieces. Give your answer modulo $987654319$.</p>
492401720
Sunday, 3rd December 2023, 04:00 am
423
20%
easy
618
Numbers with a Given Prime Factor Sum
Consider the numbers $15$, $16$ and $18$: $15=3\times 5$ and $3+5=8$. $16 = 2\times 2\times 2\times 2$ and $2+2+2+2=8$. $18 = 2\times 3\times 3$ and $2+3+3=8$. $15$, $16$ and $18$ are the only numbers that have $8$ as sum of the prime factors (counted with multiplicity). We define $S(k)$ to be the sum of all numbers $n$ where the sum of the prime factors (with multiplicity) of $n$ is $k$. Hence $S(8) = 15+16+18 = 49$. Other examples: $S(1) = 0$, $S(2) = 2$, $S(3) = 3$, $S(5) = 5 + 6 = 11$. The Fibonacci sequence is $F_1 = 1$, $F_2 = 1$, $F_3 = 2$, $F_4 = 3$, $F_5 = 5$, .... Find the last nine digits of $\displaystyle\sum_{k=2}^{24}S(F_k)$.
Consider the numbers $15$, $16$ and $18$: $15=3\times 5$ and $3+5=8$. $16 = 2\times 2\times 2\times 2$ and $2+2+2+2=8$. $18 = 2\times 3\times 3$ and $2+3+3=8$. $15$, $16$ and $18$ are the only numbers that have $8$ as sum of the prime factors (counted with multiplicity). We define $S(k)$ to be the sum of all numbers $n$ where the sum of the prime factors (with multiplicity) of $n$ is $k$. Hence $S(8) = 15+16+18 = 49$. Other examples: $S(1) = 0$, $S(2) = 2$, $S(3) = 3$, $S(5) = 5 + 6 = 11$. The Fibonacci sequence is $F_1 = 1$, $F_2 = 1$, $F_3 = 2$, $F_4 = 3$, $F_5 = 5$, .... Find the last nine digits of $\displaystyle\sum_{k=2}^{24}S(F_k)$.
<p>Consider the numbers $15$, $16$ and $18$:<br/> $15=3\times 5$ and $3+5=8$.<br/> $16 = 2\times 2\times 2\times 2$ and $2+2+2+2=8$.<br/> $18 = 2\times 3\times 3$ and $2+3+3=8$.<br/> $15$, $16$ and $18$ are the only numbers that have $8$ as sum of the prime factors (counted with multiplicity).</p> <p> We define $S(k)$ to be the sum of all numbers $n$ where the sum of the prime factors (with multiplicity) of $n$ is $k$.<br/> Hence $S(8) = 15+16+18 = 49$.<br/> Other examples: $S(1) = 0$, $S(2) = 2$, $S(3) = 3$, $S(5) = 5 + 6 = 11$.</p> <p> The Fibonacci sequence is $F_1 = 1$, $F_2 = 1$, $F_3 = 2$, $F_4 = 3$, $F_5 = 5$, ....<br/> Find the last nine digits of $\displaystyle\sum_{k=2}^{24}S(F_k)$.</p>
634212216
Saturday, 13th January 2018, 07:00 pm
1154
20%
easy
291
Panaitopol Primes
A prime number $p$ is called a Panaitopol prime if $p = \dfrac{x^4 - y^4}{x^3 + y^3}$ for some positive integers $x$ and $y$. Find how many Panaitopol primes are less than $5 \times 10^{15}$.
A prime number $p$ is called a Panaitopol prime if $p = \dfrac{x^4 - y^4}{x^3 + y^3}$ for some positive integers $x$ and $y$. Find how many Panaitopol primes are less than $5 \times 10^{15}$.
<p> A prime number $p$ is called a Panaitopol prime if $p = \dfrac{x^4 - y^4}{x^3 + y^3}$ for some positive integers $x$ and $y$.</p> <p> Find how many Panaitopol primes are less than $5 \times 10^{15}$. </p>
4037526
Friday, 7th May 2010, 09:00 pm
1631
45%
medium
780
Toriangulations
For positive real numbers $a,b$, an $a\times b$ torus is a rectangle of width $a$ and height $b$, with left and right sides identified, as well as top and bottom sides identified. In other words, when tracing a path on the rectangle, reaching an edge results in "wrapping round" to the corresponding point on the opposite edge. A tiling of a torus is a way to dissect it into equilateral triangles of edge length 1. For example, the following three diagrams illustrate respectively a $1\times \frac{\sqrt{3}}{2}$ torus with two triangles, a $\sqrt{3}\times 1$ torus with four triangles, and an approximately $2.8432\times 2.1322$ torus with fourteen triangles: Two tilings of an $a\times b$ torus are called equivalent if it is possible to obtain one from the other by continuously moving all triangles so that no gaps appear and no triangles overlap at any stage during the movement. For example, the animation below shows an equivalence between two tilings: Let $F(n)$ be the total number of non-equivalent tilings of all possible tori with exactly $n$ triangles. For example, $F(6)=8$, with the eight non-equivalent tilings with six triangles listed below: Let $G(N)=\sum_{n=1}^N F(n)$. You are given that $G(6)=14$, $G(100)=8090$, and $G(10^5)\equiv 645124048 \pmod{1\,000\,000\,007}$. Find $G(10^9)$. Give your answer modulo $1\,000\,000\,007$.
For positive real numbers $a,b$, an $a\times b$ torus is a rectangle of width $a$ and height $b$, with left and right sides identified, as well as top and bottom sides identified. In other words, when tracing a path on the rectangle, reaching an edge results in "wrapping round" to the corresponding point on the opposite edge. A tiling of a torus is a way to dissect it into equilateral triangles of edge length 1. For example, the following three diagrams illustrate respectively a $1\times \frac{\sqrt{3}}{2}$ torus with two triangles, a $\sqrt{3}\times 1$ torus with four triangles, and an approximately $2.8432\times 2.1322$ torus with fourteen triangles: Two tilings of an $a\times b$ torus are called equivalent if it is possible to obtain one from the other by continuously moving all triangles so that no gaps appear and no triangles overlap at any stage during the movement. For example, the animation below shows an equivalence between two tilings: Let $F(n)$ be the total number of non-equivalent tilings of all possible tori with exactly $n$ triangles. For example, $F(6)=8$, with the eight non-equivalent tilings with six triangles listed below: Let $G(N)=\sum_{n=1}^N F(n)$. You are given that $G(6)=14$, $G(100)=8090$, and $G(10^5)\equiv 645124048 \pmod{1\,000\,000\,007}$. Find $G(10^9)$. Give your answer modulo $1\,000\,000\,007$.
<p>For positive real numbers $a,b$, an $a\times b$ <strong>torus</strong> is a rectangle of width $a$ and height $b$, with left and right sides identified, as well as top and bottom sides identified. In other words, when tracing a path on the rectangle, reaching an edge results in "wrapping round" to the corresponding point on the opposite edge.</p> <p>A <i>tiling</i> of a torus is a way to dissect it into equilateral triangles of edge length 1. For example, the following three diagrams illustrate respectively a $1\times \frac{\sqrt{3}}{2}$ torus with two triangles, a $\sqrt{3}\times 1$ torus with four triangles, and an approximately $2.8432\times 2.1322$ torus with fourteen triangles:</p> <div style="text-align:center;"> <img alt="" class="dark_img" height="160" src="resources/images/0780_sample-small-1.png?1678992054"/> <img alt="" class="dark_img" height="160" src="resources/images/0780_sample-small-2.png?1678992054"/> <img alt="" class="dark_img" height="160" src="resources/images/0780_sample-small-3.png?1678992054"/> </div> <p>Two tilings of an $a\times b$ torus are called <dfn>equivalent</dfn> if it is possible to obtain one from the other by continuously moving all triangles so that no gaps appear and no triangles overlap at any stage during the movement. For example, the animation below shows an equivalence between two tilings:</p> <div style="text-align:center;"> <img alt="" class="dark_img" height="160" src="resources/images/0780_animation.gif?1678992057"/> </div> <p>Let $F(n)$ be the total number of non-equivalent tilings of all possible tori with exactly $n$ triangles. For example, $F(6)=8$, with the eight non-equivalent tilings with six triangles listed below:</p> <div style="text-align:center;"> <img alt="" class="dark_img" height="300" src="resources/images/0780_t6-all.png?1678992054"/> </div> <p>Let $G(N)=\sum_{n=1}^N F(n)$. You are given that $G(6)=14$, $G(100)=8090$, and $G(10^5)\equiv 645124048 \pmod{1\,000\,000\,007}$.</p> <p>Find $G(10^9)$. Give your answer modulo $1\,000\,000\,007$.</p>
613979935
Saturday, 8th January 2022, 04:00 pm
143
100%
hard
213
Flea Circus
A $30 \times 30$ grid of squares contains $900$ fleas, initially one flea per square. When a bell is rung, each flea jumps to an adjacent square at random (usually $4$ possibilities, except for fleas on the edge of the grid or at the corners). What is the expected number of unoccupied squares after $50$ rings of the bell? Give your answer rounded to six decimal places.
A $30 \times 30$ grid of squares contains $900$ fleas, initially one flea per square. When a bell is rung, each flea jumps to an adjacent square at random (usually $4$ possibilities, except for fleas on the edge of the grid or at the corners). What is the expected number of unoccupied squares after $50$ rings of the bell? Give your answer rounded to six decimal places.
<p>A $30 \times 30$ grid of squares contains $900$ fleas, initially one flea per square.<br/> When a bell is rung, each flea jumps to an adjacent square at random (usually $4$ possibilities, except for fleas on the edge of the grid or at the corners).</p> <p>What is the expected number of unoccupied squares after $50$ rings of the bell? Give your answer rounded to six decimal places.</p>
330.721154
Saturday, 18th October 2008, 10:00 am
2617
60%
hard
556
Squarefree Gaussian Integers
A Gaussian integer is a number $z = a + bi$ where $a$, $b$ are integers and $i^2 = -1$. Gaussian integers are a subset of the complex numbers, and the integers are the subset of Gaussian integers for which $b = 0$. A Gaussian integer unit is one for which $a^2 + b^2 = 1$, i.e. one of $1, i, -1, -i$. Let's define a proper Gaussian integer as one for which $a \gt 0$ and $b \ge 0$. A Gaussian integer $z_1 = a_1 + b_1 i$ is said to be divisible by $z_2 = a_2 + b_2 i$ if $z_3 = a_3 + b_3 i = z_1 / z_2$ is a Gaussian integer. $\frac {z_1} {z_2} = \frac {a_1 + b_1 i} {a_2 + b_2 i} = \frac {(a_1 + b_1 i)(a_2 - b_2 i)} {(a_2 + b_2 i)(a_2 - b_2 i)} = \frac {a_1 a_2 + b_1 b_2} {a_2^2 + b_2^2} + \frac {a_2 b_1 - a_1 b_2} {a_2^2 + b_2^2}i = a_3 + b_3 i$ So, $z_1$ is divisible by $z_2$ if $\frac {a_1 a_2 + b_1 b_2} {a_2^2 + b_2^2}$ and $\frac {a_2 b_1 - a_1 b_2} {a_2^2 + b_2^2}$ are integers. For example, $2$ is divisible by $1 + i$ because $2/(1 + i) = 1 - i$ is a Gaussian integer. A Gaussian prime is a Gaussian integer that is divisible only by a unit, itself or itself times a unit. For example, $1 + 2i$ is a Gaussian prime, because it is only divisible by $1$, $i$, $-1$, $-i$, $1 + 2i$, $i(1 + 2i) = i - 2$, $-(1 + 2i) = -1 - 2i$ and $-i(1 + 2i) = 2 - i$. $2$ is not a Gaussian prime as it is divisible by $1 + i$. A Gaussian integer can be uniquely factored as the product of a unit and proper Gaussian primes. For example $2 = -i(1 + i)^2$ and $1 + 3i = (1 + i)(2 + i)$. A Gaussian integer is said to be squarefree if its prime factorization does not contain repeated proper Gaussian primes. So $2$ is not squarefree over the Gaussian integers, but $1 + 3i$ is. Units and Gaussian primes are squarefree by definition. Let $f(n)$ be the count of proper squarefree Gaussian integers with $a^2 + b^2 \le n$. For example $f(10) = 7$ because $1$, $1 + i$, $1 + 2i$, $1 + 3i = (1 + i)(2 + i)$, $2 + i$, $3$ and $3 + i = -i(1 + i)(1 + 2i)$ are squarefree, while $2 = -i(1 + i)^2$ and $2 + 2i = -i(1 + i)^3$ are not. You are given $f(10^2) = 54$, $f(10^4) = 5218$ and $f(10^8) = 52126906$. Find $f(10^{14})$.
A Gaussian integer is a number $z = a + bi$ where $a$, $b$ are integers and $i^2 = -1$. Gaussian integers are a subset of the complex numbers, and the integers are the subset of Gaussian integers for which $b = 0$. A Gaussian integer unit is one for which $a^2 + b^2 = 1$, i.e. one of $1, i, -1, -i$. Let's define a proper Gaussian integer as one for which $a \gt 0$ and $b \ge 0$. A Gaussian integer $z_1 = a_1 + b_1 i$ is said to be divisible by $z_2 = a_2 + b_2 i$ if $z_3 = a_3 + b_3 i = z_1 / z_2$ is a Gaussian integer. $\frac {z_1} {z_2} = \frac {a_1 + b_1 i} {a_2 + b_2 i} = \frac {(a_1 + b_1 i)(a_2 - b_2 i)} {(a_2 + b_2 i)(a_2 - b_2 i)} = \frac {a_1 a_2 + b_1 b_2} {a_2^2 + b_2^2} + \frac {a_2 b_1 - a_1 b_2} {a_2^2 + b_2^2}i = a_3 + b_3 i$ So, $z_1$ is divisible by $z_2$ if $\frac {a_1 a_2 + b_1 b_2} {a_2^2 + b_2^2}$ and $\frac {a_2 b_1 - a_1 b_2} {a_2^2 + b_2^2}$ are integers. For example, $2$ is divisible by $1 + i$ because $2/(1 + i) = 1 - i$ is a Gaussian integer. A Gaussian prime is a Gaussian integer that is divisible only by a unit, itself or itself times a unit. For example, $1 + 2i$ is a Gaussian prime, because it is only divisible by $1$, $i$, $-1$, $-i$, $1 + 2i$, $i(1 + 2i) = i - 2$, $-(1 + 2i) = -1 - 2i$ and $-i(1 + 2i) = 2 - i$. $2$ is not a Gaussian prime as it is divisible by $1 + i$. A Gaussian integer can be uniquely factored as the product of a unit and proper Gaussian primes. For example $2 = -i(1 + i)^2$ and $1 + 3i = (1 + i)(2 + i)$. A Gaussian integer is said to be squarefree if its prime factorization does not contain repeated proper Gaussian primes. So $2$ is not squarefree over the Gaussian integers, but $1 + 3i$ is. Units and Gaussian primes are squarefree by definition. Let $f(n)$ be the count of proper squarefree Gaussian integers with $a^2 + b^2 \le n$. For example $f(10) = 7$ because $1$, $1 + i$, $1 + 2i$, $1 + 3i = (1 + i)(2 + i)$, $2 + i$, $3$ and $3 + i = -i(1 + i)(1 + 2i)$ are squarefree, while $2 = -i(1 + i)^2$ and $2 + 2i = -i(1 + i)^3$ are not. You are given $f(10^2) = 54$, $f(10^4) = 5218$ and $f(10^8) = 52126906$. Find $f(10^{14})$.
<p>A <b>Gaussian integer</b> is a number $z = a + bi$ where $a$, $b$ are integers and $i^2 = -1$.<br/> Gaussian integers are a subset of the complex numbers, and the integers are the subset of Gaussian integers for which $b = 0$.</p> <p>A Gaussian integer <strong>unit</strong> is one for which $a^2 + b^2 = 1$, i.e. one of $1, i, -1, -i$.<br/> Let's define a <dfn>proper</dfn> Gaussian integer as one for which $a \gt 0$ and $b \ge 0$.</p> <p>A Gaussian integer $z_1 = a_1 + b_1 i$ is said to be divisible by $z_2 = a_2 + b_2 i$ if $z_3 = a_3 + b_3 i = z_1 / z_2$ is a Gaussian integer.<br/> $\frac {z_1} {z_2} = \frac {a_1 + b_1 i} {a_2 + b_2 i} = \frac {(a_1 + b_1 i)(a_2 - b_2 i)} {(a_2 + b_2 i)(a_2 - b_2 i)} = \frac {a_1 a_2 + b_1 b_2} {a_2^2 + b_2^2} + \frac {a_2 b_1 - a_1 b_2} {a_2^2 + b_2^2}i = a_3 + b_3 i$<br/> So, $z_1$ is divisible by $z_2$ if $\frac {a_1 a_2 + b_1 b_2} {a_2^2 + b_2^2}$ and $\frac {a_2 b_1 - a_1 b_2} {a_2^2 + b_2^2}$ are integers.<br/> For example, $2$ is divisible by $1 + i$ because $2/(1 + i) = 1 - i$ is a Gaussian integer.</p> <p>A <strong>Gaussian prime</strong> is a Gaussian integer that is divisible only by a unit, itself or itself times a unit.<br/> For example, $1 + 2i$ is a Gaussian prime, because it is only divisible by $1$, $i$, $-1$, $-i$, $1 + 2i$, $i(1 + 2i) = i - 2$, $-(1 + 2i) = -1 - 2i$ and $-i(1 + 2i) = 2 - i$.<br/> $2$ is not a Gaussian prime as it is divisible by $1 + i$.</p> <p>A Gaussian integer can be uniquely factored as the product of a unit and proper Gaussian primes.<br/> For example $2 = -i(1 + i)^2$ and $1 + 3i = (1 + i)(2 + i)$.<br/> A Gaussian integer is said to be squarefree if its prime factorization does not contain repeated proper Gaussian primes.<br/> So $2$ is not squarefree over the Gaussian integers, but $1 + 3i$ is.<br/> Units and Gaussian primes are squarefree by definition.</p> <p>Let $f(n)$ be the count of proper squarefree Gaussian integers with $a^2 + b^2 \le n$.<br/> For example $f(10) = 7$ because $1$, $1 + i$, $1 + 2i$, $1 + 3i = (1 + i)(2 + i)$, $2 + i$, $3$ and $3 + i = -i(1 + i)(1 + 2i)$ are squarefree, while $2 = -i(1 + i)^2$ and $2 + 2i = -i(1 + i)^3$ are not.<br/> You are given $f(10^2) = 54$, $f(10^4) = 5218$ and $f(10^8) = 52126906$.</p> <p>Find $f(10^{14})$.</p>
52126939292957
Sunday, 17th April 2016, 07:00 am
278
85%
hard
894
Spiral of Circles
Consider a unit circlecircle with radius 1 $C_0$ on the plane that does not enclose the origin. For $k\ge 1$, a circle $C_k$ is created by scaling and rotating $C_{k - 1}$ with respect to the origin. That is, both the radius and the distance to the origin are scaled by the same factor, and the centre of rotation is the origin. The scaling factor is positive and strictly less than one. Both it and the rotation angle remain constant for each $k$. It is given that $C_0$ is externally tangent to $C_1$, $C_7$ and $C_8$, as shown in the diagram below, and no two circles overlap. Find the total area of all the circular trianglesA circular triangle is a triangle with circular arc edges in the diagram, i.e. the area painted green above. Give your answer rounded to $10$ places after the decimal point.
Consider a unit circlecircle with radius 1 $C_0$ on the plane that does not enclose the origin. For $k\ge 1$, a circle $C_k$ is created by scaling and rotating $C_{k - 1}$ with respect to the origin. That is, both the radius and the distance to the origin are scaled by the same factor, and the centre of rotation is the origin. The scaling factor is positive and strictly less than one. Both it and the rotation angle remain constant for each $k$. It is given that $C_0$ is externally tangent to $C_1$, $C_7$ and $C_8$, as shown in the diagram below, and no two circles overlap. Find the total area of all the circular trianglesA circular triangle is a triangle with circular arc edges in the diagram, i.e. the area painted green above. Give your answer rounded to $10$ places after the decimal point.
<p>Consider a <strong class="tooltip">unit circle<span class="tooltiptext">circle with radius 1</span></strong> $C_0$ on the plane that does not enclose the origin. For $k\ge 1$, a circle $C_k$ is created by scaling and rotating $C_{k - 1}$ <b>with respect to the origin</b>. That is, both the radius and the distance to the origin are scaled by the same factor, and the centre of rotation is the origin. The scaling factor is positive and strictly less than one. Both it and the rotation angle remain constant for each $k$.</p> <p>It is given that $C_0$ is externally tangent to $C_1$, $C_7$ and $C_8$, as shown in the diagram below, and no two circles overlap.</p> <div style="text-align:center;"><img alt="0894_circle_spiral.jpg" src="resources/images/0894_circle_spiral.jpg?1714305246"/></div> <p>Find the total area of all the <strong class="tooltip">circular triangles<span class="tooltiptext">A circular triangle is a triangle with circular arc edges</span></strong> in the diagram, i.e. the area painted green above.<br/> Give your answer rounded to $10$ places after the decimal point.</p>
0.7718678168
Saturday, 8th June 2024, 02:00 pm
332
35%
medium
673
Beds and Desks
At Euler University, each of the $n$ students (numbered from 1 to $n$) occupies a bed in the dormitory and uses a desk in the classroom. Some of the beds are in private rooms which a student occupies alone, while the others are in double rooms occupied by two students as roommates. Similarly, each desk is either a single desk for the sole use of one student, or a twin desk at which two students sit together as desk partners. We represent the bed and desk sharing arrangements each by a list of pairs of student numbers. For example, with $n=4$, if $(2,3)$ represents the bed pairing and $(1,3)(2,4)$ the desk pairing, then students 2 and 3 are roommates while 1 and 4 have single rooms, and students 1 and 3 are desk partners, as are students 2 and 4. The new chancellor of the university decides to change the organisation of beds and desks: a permutation $\sigma$ of the numbers $1,2,\ldots,n$ will be chosen, and each student $k$ will be given both the bed and the desk formerly occupied by student number $\sigma(k)$. The students agree to this change, under the conditions that: Any two students currently sharing a room will still be roommates. Any two students currently sharing a desk will still be desk partners. In the example above, there are only two ways to satisfy these conditions: either take no action ($\sigma$ is the identity permutation), or reverse the order of the students. With $n=6$, for the bed pairing $(1,2)(3,4)(5,6)$ and the desk pairing $(3,6)(4,5)$, there are 8 permutations which satisfy the conditions. One example is the mapping $(1, 2, 3, 4, 5, 6) \mapsto (1, 2, 5, 6, 3, 4)$. With $n=36$, if we have bed pairing: $(2,13)(4,30)(5,27)(6,16)(10,18)(12,35)(14,19)(15,20)(17,26)(21,32)(22,33)(24,34)(25,28)$ and desk pairing $(1,35)(2,22)(3,36)(4,28)(5,25)(7,18)(9,23)(13,19)(14,33)(15,34)(20,24)(26,29)(27,30)$ then among the $36!$ possible permutations (including the identity permutation), 663552 of them satisfy the conditions stipulated by the students. The downloadable text files beds.txt and desks.txt contain pairings for $n=500$. Each pairing is written on its own line, with the student numbers of the two roommates (or desk partners) separated with a comma. For example, the desk pairing in the $n=4$ example above would be represented in this file format as: 1,3 2,4 With these pairings, find the number of permutations that satisfy the students' conditions. Give your answer modulo $999\,999\,937$.
At Euler University, each of the $n$ students (numbered from 1 to $n$) occupies a bed in the dormitory and uses a desk in the classroom. Some of the beds are in private rooms which a student occupies alone, while the others are in double rooms occupied by two students as roommates. Similarly, each desk is either a single desk for the sole use of one student, or a twin desk at which two students sit together as desk partners. We represent the bed and desk sharing arrangements each by a list of pairs of student numbers. For example, with $n=4$, if $(2,3)$ represents the bed pairing and $(1,3)(2,4)$ the desk pairing, then students 2 and 3 are roommates while 1 and 4 have single rooms, and students 1 and 3 are desk partners, as are students 2 and 4. The new chancellor of the university decides to change the organisation of beds and desks: a permutation $\sigma$ of the numbers $1,2,\ldots,n$ will be chosen, and each student $k$ will be given both the bed and the desk formerly occupied by student number $\sigma(k)$. The students agree to this change, under the conditions that: Any two students currently sharing a room will still be roommates. Any two students currently sharing a desk will still be desk partners. In the example above, there are only two ways to satisfy these conditions: either take no action ($\sigma$ is the identity permutation), or reverse the order of the students. With $n=6$, for the bed pairing $(1,2)(3,4)(5,6)$ and the desk pairing $(3,6)(4,5)$, there are 8 permutations which satisfy the conditions. One example is the mapping $(1, 2, 3, 4, 5, 6) \mapsto (1, 2, 5, 6, 3, 4)$. With $n=36$, if we have bed pairing: $(2,13)(4,30)(5,27)(6,16)(10,18)(12,35)(14,19)(15,20)(17,26)(21,32)(22,33)(24,34)(25,28)$ and desk pairing $(1,35)(2,22)(3,36)(4,28)(5,25)(7,18)(9,23)(13,19)(14,33)(15,34)(20,24)(26,29)(27,30)$ then among the $36!$ possible permutations (including the identity permutation), 663552 of them satisfy the conditions stipulated by the students. The downloadable text files beds.txt and desks.txt contain pairings for $n=500$. Each pairing is written on its own line, with the student numbers of the two roommates (or desk partners) separated with a comma. For example, the desk pairing in the $n=4$ example above would be represented in this file format as: 1,3 2,4 With these pairings, find the number of permutations that satisfy the students' conditions. Give your answer modulo $999\,999\,937$.
<p>At Euler University, each of the $n$ students (numbered from 1 to $n$) occupies a bed in the dormitory and uses a desk in the classroom.</p> <p>Some of the beds are in private rooms which a student occupies alone, while the others are in double rooms occupied by two students as roommates. Similarly, each desk is either a single desk for the sole use of one student, or a twin desk at which two students sit together as desk partners.</p> <p>We represent the bed and desk sharing arrangements each by a list of pairs of student numbers. For example, with $n=4$, if $(2,3)$ represents the bed pairing and $(1,3)(2,4)$ the desk pairing, then students 2 and 3 are roommates while 1 and 4 have single rooms, and students 1 and 3 are desk partners, as are students 2 and 4.</p> <p>The new chancellor of the university decides to change the organisation of beds and desks: a permutation $\sigma$ of the numbers $1,2,\ldots,n$ will be chosen, and each student $k$ will be given both the bed and the desk formerly occupied by student number $\sigma(k)$.</p> <p>The students agree to this change, under the conditions that:</p> <ol> <li>Any two students currently sharing a room will still be roommates.</li> <li>Any two students currently sharing a desk will still be desk partners.</li> </ol> <p>In the example above, there are only two ways to satisfy these conditions: either take no action ($\sigma$ is the <strong>identity permutation</strong>), or reverse the order of the students.</p> <p>With $n=6$, for the bed pairing $(1,2)(3,4)(5,6)$ and the desk pairing $(3,6)(4,5)$, there are 8 permutations which satisfy the conditions. One example is the mapping $(1, 2, 3, 4, 5, 6) \mapsto (1, 2, 5, 6, 3, 4)$.</p> <p>With $n=36$, if we have bed pairing:<br/> $(2,13)(4,30)(5,27)(6,16)(10,18)(12,35)(14,19)(15,20)(17,26)(21,32)(22,33)(24,34)(25,28)$<br/> and desk pairing<br/> $(1,35)(2,22)(3,36)(4,28)(5,25)(7,18)(9,23)(13,19)(14,33)(15,34)(20,24)(26,29)(27,30)$<br/> then among the $36!$ possible permutations (including the identity permutation), 663552 of them satisfy the conditions stipulated by the students.</p> <p>The downloadable text files <a href="resources/documents/0673_beds.txt">beds.txt</a> and <a href="resources/documents/0673_desks.txt">desks.txt</a> contain pairings for $n=500$. Each pairing is written on its own line, with the student numbers of the two roommates (or desk partners) separated with a comma. For example, the desk pairing in the $n=4$ example above would be represented in this file format as:</p> <pre> 1,3 2,4 </pre> <p>With these pairings, find the number of permutations that satisfy the students' conditions. Give your answer modulo $999\,999\,937$.</p>
700325380
Sunday, 2nd June 2019, 07:00 am
347
35%
medium
318
2011 Nines
Consider the real number $\sqrt 2 + \sqrt 3$. When we calculate the even powers of $\sqrt 2 + \sqrt 3$ we get: $(\sqrt 2 + \sqrt 3)^2 = 9.898979485566356 \cdots $ $(\sqrt 2 + \sqrt 3)^4 = 97.98979485566356 \cdots $ $(\sqrt 2 + \sqrt 3)^6 = 969.998969071069263 \cdots $ $(\sqrt 2 + \sqrt 3)^8 = 9601.99989585502907 \cdots $ $(\sqrt 2 + \sqrt 3)^{10} = 95049.999989479221 \cdots $ $(\sqrt 2 + \sqrt 3)^{12} = 940897.9999989371855 \cdots $ $(\sqrt 2 + \sqrt 3)^{14} = 9313929.99999989263 \cdots $ $(\sqrt 2 + \sqrt 3)^{16} = 92198401.99999998915 \cdots $ It looks as if the number of consecutive nines at the beginning of the fractional part of these powers is non-decreasing. In fact it can be proven that the fractional part of $(\sqrt 2 + \sqrt 3)^{2 n}$ approaches $1$ for large $n$. Consider all real numbers of the form $\sqrt p + \sqrt q$ with $p$ and $q$ positive integers and $p < q$, such that the fractional part of $(\sqrt p + \sqrt q)^{ 2 n}$ approaches $1$ for large $n$. Let $C(p,q,n)$ be the number of consecutive nines at the beginning of the fractional part of $(\sqrt p + \sqrt q)^{ 2 n}$. Let $N(p,q)$ be the minimal value of $n$ such that $C(p,q,n) \ge 2011$. Find $\displaystyle \sum N(p,q) \,\, \text{ for } p+q \le 2011$.
Consider the real number $\sqrt 2 + \sqrt 3$. When we calculate the even powers of $\sqrt 2 + \sqrt 3$ we get: $(\sqrt 2 + \sqrt 3)^2 = 9.898979485566356 \cdots $ $(\sqrt 2 + \sqrt 3)^4 = 97.98979485566356 \cdots $ $(\sqrt 2 + \sqrt 3)^6 = 969.998969071069263 \cdots $ $(\sqrt 2 + \sqrt 3)^8 = 9601.99989585502907 \cdots $ $(\sqrt 2 + \sqrt 3)^{10} = 95049.999989479221 \cdots $ $(\sqrt 2 + \sqrt 3)^{12} = 940897.9999989371855 \cdots $ $(\sqrt 2 + \sqrt 3)^{14} = 9313929.99999989263 \cdots $ $(\sqrt 2 + \sqrt 3)^{16} = 92198401.99999998915 \cdots $ It looks as if the number of consecutive nines at the beginning of the fractional part of these powers is non-decreasing. In fact it can be proven that the fractional part of $(\sqrt 2 + \sqrt 3)^{2 n}$ approaches $1$ for large $n$. Consider all real numbers of the form $\sqrt p + \sqrt q$ with $p$ and $q$ positive integers and $p < q$, such that the fractional part of $(\sqrt p + \sqrt q)^{ 2 n}$ approaches $1$ for large $n$. Let $C(p,q,n)$ be the number of consecutive nines at the beginning of the fractional part of $(\sqrt p + \sqrt q)^{ 2 n}$. Let $N(p,q)$ be the minimal value of $n$ such that $C(p,q,n) \ge 2011$. Find $\displaystyle \sum N(p,q) \,\, \text{ for } p+q \le 2011$.
<p> Consider the real number $\sqrt 2 + \sqrt 3$.<br/> When we calculate the even powers of $\sqrt 2 + \sqrt 3$ we get:<br/> $(\sqrt 2 + \sqrt 3)^2 = 9.898979485566356 \cdots $<br/> $(\sqrt 2 + \sqrt 3)^4 = 97.98979485566356 \cdots $<br/> $(\sqrt 2 + \sqrt 3)^6 = 969.998969071069263 \cdots $<br/> $(\sqrt 2 + \sqrt 3)^8 = 9601.99989585502907 \cdots $<br/> $(\sqrt 2 + \sqrt 3)^{10} = 95049.999989479221 \cdots $<br/> $(\sqrt 2 + \sqrt 3)^{12} = 940897.9999989371855 \cdots $<br/> $(\sqrt 2 + \sqrt 3)^{14} = 9313929.99999989263 \cdots $<br/> $(\sqrt 2 + \sqrt 3)^{16} = 92198401.99999998915 \cdots $<br/></p> <p> It looks as if the number of consecutive nines at the beginning of the fractional part of these powers is non-decreasing.<br/> In fact it can be proven that the fractional part of $(\sqrt 2 + \sqrt 3)^{2 n}$ approaches $1$ for large $n$. </p> <p> Consider all real numbers of the form $\sqrt p + \sqrt q$ with $p$ and $q$ positive integers and $p &lt; q$, such that the fractional part of $(\sqrt p + \sqrt q)^{ 2 n}$ approaches $1$ for large $n$. </p> <p> Let $C(p,q,n)$ be the number of consecutive nines at the beginning of the fractional part of $(\sqrt p + \sqrt q)^{ 2 n}$. </p> <p> Let $N(p,q)$ be the minimal value of $n$ such that $C(p,q,n) \ge 2011$. </p> <p> Find $\displaystyle \sum N(p,q) \,\, \text{ for } p+q \le 2011$. </p>
709313889
Saturday, 1st January 2011, 04:00 pm
1051
50%
medium
58
Spiral Primes
Starting with $1$ and spiralling anticlockwise in the following way, a square spiral with side length $7$ is formed. 37 36 35 34 33 32 31 38 17 16 15 14 13 30 39 18  5  4  3 12 29 40 19  6  1  2 11 28 41 20  7  8  9 10 27 42 21 22 23 24 25 2643 44 45 46 47 48 49 It is interesting to note that the odd squares lie along the bottom right diagonal, but what is more interesting is that $8$ out of the $13$ numbers lying along both diagonals are prime; that is, a ratio of $8/13 \approx 62\%$. If one complete new layer is wrapped around the spiral above, a square spiral with side length $9$ will be formed. If this process is continued, what is the side length of the square spiral for which the ratio of primes along both diagonals first falls below $10\%$?
Starting with $1$ and spiralling anticlockwise in the following way, a square spiral with side length $7$ is formed. 37 36 35 34 33 32 31 38 17 16 15 14 13 30 39 18  5  4  3 12 29 40 19  6  1  2 11 28 41 20  7  8  9 10 27 42 21 22 23 24 25 2643 44 45 46 47 48 49 It is interesting to note that the odd squares lie along the bottom right diagonal, but what is more interesting is that $8$ out of the $13$ numbers lying along both diagonals are prime; that is, a ratio of $8/13 \approx 62\%$. If one complete new layer is wrapped around the spiral above, a square spiral with side length $9$ will be formed. If this process is continued, what is the side length of the square spiral for which the ratio of primes along both diagonals first falls below $10\%$?
<p>Starting with $1$ and spiralling anticlockwise in the following way, a square spiral with side length $7$ is formed.</p> <p class="center monospace"><span class="red"><b>37</b></span> 36 35 34 33 32 <span class="red"><b>31</b></span><br/> 38 <span class="red"><b>17</b></span> 16 15 14 <span class="red"><b>13</b></span> 30<br/> 39 18 <span class="red"> <b>5</b></span>  4 <span class="red"> <b>3</b></span> 12 29<br/> 40 19  6  1  2 11 28<br/> 41 20 <span class="red"> <b>7</b></span>  8  9 10 27<br/> 42 21 22 23 24 25 26<br/><span class="red"><b>43</b></span> 44 45 46 47 48 49</p> <p>It is interesting to note that the odd squares lie along the bottom right diagonal, but what is more interesting is that $8$ out of the $13$ numbers lying along both diagonals are prime; that is, a ratio of $8/13 \approx 62\%$.</p> <p>If one complete new layer is wrapped around the spiral above, a square spiral with side length $9$ will be formed. If this process is continued, what is the side length of the square spiral for which the ratio of primes along both diagonals first falls below $10\%$?</p>
26241
Friday, 5th December 2003, 06:00 pm
44286
5%
easy
792
Too Many Twos
We define $\nu_2(n)$ to be the largest integer $r$ such that $2^r$ divides $n$. For example, $\nu_2(24) = 3$. Define $\displaystyle S(n) = \sum_{k = 1}^n (-2)^k\binom{2k}k$ and $u(n) = \nu_2\Big(3S(n)+4\Big)$. For example, when $n = 4$ then $S(4) = 980$ and $3S(4) + 4 = 2944 = 2^7 \cdot 23$, hence $u(4) = 7$. You are also given $u(20) = 24$. Also define $\displaystyle U(N) = \sum_{n = 1}^N u(n^3)$. You are given $U(5) = 241$. Find $U(10^4)$.
We define $\nu_2(n)$ to be the largest integer $r$ such that $2^r$ divides $n$. For example, $\nu_2(24) = 3$. Define $\displaystyle S(n) = \sum_{k = 1}^n (-2)^k\binom{2k}k$ and $u(n) = \nu_2\Big(3S(n)+4\Big)$. For example, when $n = 4$ then $S(4) = 980$ and $3S(4) + 4 = 2944 = 2^7 \cdot 23$, hence $u(4) = 7$. You are also given $u(20) = 24$. Also define $\displaystyle U(N) = \sum_{n = 1}^N u(n^3)$. You are given $U(5) = 241$. Find $U(10^4)$.
<p> We define $\nu_2(n)$ to be the largest integer $r$ such that $2^r$ divides $n$. For example, $\nu_2(24) = 3$. </p> <p> Define $\displaystyle S(n) = \sum_{k = 1}^n (-2)^k\binom{2k}k$ and $u(n) = \nu_2\Big(3S(n)+4\Big)$. </p> <p> For example, when $n = 4$ then $S(4) = 980$ and $3S(4) + 4 = 2944 = 2^7 \cdot 23$, hence $u(4) = 7$.<br> You are also given $u(20) = 24$. </br></p> <p> Also define $\displaystyle U(N) = \sum_{n = 1}^N u(n^3)$. You are given $U(5) = 241$. </p> <p> Find $U(10^4)$. </p>
2500500025183626
Sunday, 3rd April 2022, 05:00 am
157
100%
hard
536
Modulo Power Identity
Let $S(n)$ be the sum of all positive integers $m$ not exceeding $n$ having the following property: $a^{m + 4} \equiv a \pmod m$ for all integers $a$. The values of $m \le 100$ that satisfy this property are $1, 2, 3, 5$ and $21$, thus $S(100) = 1+2+3+5+21 = 32$. You are given $S(10^6) = 22868117$. Find $S(10^{12})$.
Let $S(n)$ be the sum of all positive integers $m$ not exceeding $n$ having the following property: $a^{m + 4} \equiv a \pmod m$ for all integers $a$. The values of $m \le 100$ that satisfy this property are $1, 2, 3, 5$ and $21$, thus $S(100) = 1+2+3+5+21 = 32$. You are given $S(10^6) = 22868117$. Find $S(10^{12})$.
<p> Let $S(n)$ be the sum of all positive integers $m$ not exceeding $n$ having the following property:<br/> $a^{m + 4} \equiv a \pmod m$ for all integers $a$. </p> <p> The values of $m \le 100$ that satisfy this property are $1, 2, 3, 5$ and $21$, thus $S(100) = 1+2+3+5+21 = 32$.<br/> You are given $S(10^6) = 22868117$. </p> <p> Find $S(10^{12})$. </p>
3557005261906288
Saturday, 28th November 2015, 07:00 pm
327
60%
hard
273
Sum of Squares
Consider equations of the form: $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer. For $N=65$ there are two solutions: $a=1$, $b=8$ and $a=4$, $b=7$. We call $S(N)$ the sum of the values of $a$ of all solutions of $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer. Thus $S(65) = 1 + 4 = 5$. Find $\sum S(N)$, for all squarefree $N$ only divisible by primes of the form $4k+1$ with $4k+1 \lt 150$.
Consider equations of the form: $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer. For $N=65$ there are two solutions: $a=1$, $b=8$ and $a=4$, $b=7$. We call $S(N)$ the sum of the values of $a$ of all solutions of $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer. Thus $S(65) = 1 + 4 = 5$. Find $\sum S(N)$, for all squarefree $N$ only divisible by primes of the form $4k+1$ with $4k+1 \lt 150$.
<p>Consider equations of the form: $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer.</p> <p>For $N=65$ there are two solutions:</p> <p>$a=1$, $b=8$ and $a=4$, $b=7$.</p> <p>We call $S(N)$ the sum of the values of $a$ of all solutions of $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer.</p> <p>Thus $S(65) = 1 + 4 = 5$.</p> <p>Find $\sum S(N)$, for all squarefree $N$ only divisible by primes of the form $4k+1$ with $4k+1 \lt 150$.</p>
2032447591196869022
Saturday, 9th January 2010, 01:00 pm
1556
70%
hard
16
Power Digit Sum
$2^{15} = 32768$ and the sum of its digits is $3 + 2 + 7 + 6 + 8 = 26$. What is the sum of the digits of the number $2^{1000}$?
$2^{15} = 32768$ and the sum of its digits is $3 + 2 + 7 + 6 + 8 = 26$. What is the sum of the digits of the number $2^{1000}$?
<p>$2^{15} = 32768$ and the sum of its digits is $3 + 2 + 7 + 6 + 8 = 26$.</p> <p>What is the sum of the digits of the number $2^{1000}$?</p>
1366
Friday, 3rd May 2002, 06:00 pm
246503
5%
easy
433
Steps in Euclid's Algorithm
Let $E(x_0, y_0)$ be the number of steps it takes to determine the greatest common divisor of $x_0$ and $y_0$ with Euclid's algorithm. More formally:$x_1 = y_0$, $y_1 = x_0 \bmod y_0$$x_n = y_{n-1}$, $y_n = x_{n-1} \bmod y_{n-1}$ $E(x_0, y_0)$ is the smallest $n$ such that $y_n = 0$. We have $E(1,1) = 1$, $E(10,6) = 3$ and $E(6,10) = 4$. Define $S(N)$ as the sum of $E(x,y)$ for $1 \leq x,y \leq N$. We have $S(1) = 1$, $S(10) = 221$ and $S(100) = 39826$. Find $S(5\cdot 10^6)$.
Let $E(x_0, y_0)$ be the number of steps it takes to determine the greatest common divisor of $x_0$ and $y_0$ with Euclid's algorithm. More formally:$x_1 = y_0$, $y_1 = x_0 \bmod y_0$$x_n = y_{n-1}$, $y_n = x_{n-1} \bmod y_{n-1}$ $E(x_0, y_0)$ is the smallest $n$ such that $y_n = 0$. We have $E(1,1) = 1$, $E(10,6) = 3$ and $E(6,10) = 4$. Define $S(N)$ as the sum of $E(x,y)$ for $1 \leq x,y \leq N$. We have $S(1) = 1$, $S(10) = 221$ and $S(100) = 39826$. Find $S(5\cdot 10^6)$.
<p> Let $E(x_0, y_0)$ be the number of steps it takes to determine the greatest common divisor of $x_0$ and $y_0$ with <strong>Euclid's algorithm</strong>. More formally:<br/>$x_1 = y_0$, $y_1 = x_0 \bmod y_0$<br/>$x_n = y_{n-1}$, $y_n = x_{n-1} \bmod y_{n-1}$<br/> $E(x_0, y_0)$ is the smallest $n$ such that $y_n = 0$. </p> <p> We have $E(1,1) = 1$, $E(10,6) = 3$ and $E(6,10) = 4$. </p> <p> Define $S(N)$ as the sum of $E(x,y)$ for $1 \leq x,y \leq N$.<br/> We have $S(1) = 1$, $S(10) = 221$ and $S(100) = 39826$. </p> <p> Find $S(5\cdot 10^6)$. </p>
326624372659664
Saturday, 22nd June 2013, 04:00 pm
503
65%
hard
504
Square on the Inside
Let $ABCD$ be a quadrilateral whose vertices are lattice points lying on the coordinate axes as follows: $A(a, 0)$, $B(0, b)$, $C(-c, 0)$, $D(0, -d)$, where $1 \le a, b, c, d \le m$ and $a, b, c, d, m$ are integers. It can be shown that for $m = 4$ there are exactly $256$ valid ways to construct $ABCD$. Of these $256$ quadrilaterals, $42$ of them strictly contain a square number of lattice points. How many quadrilaterals $ABCD$ strictly contain a square number of lattice points for $m = 100$?
Let $ABCD$ be a quadrilateral whose vertices are lattice points lying on the coordinate axes as follows: $A(a, 0)$, $B(0, b)$, $C(-c, 0)$, $D(0, -d)$, where $1 \le a, b, c, d \le m$ and $a, b, c, d, m$ are integers. It can be shown that for $m = 4$ there are exactly $256$ valid ways to construct $ABCD$. Of these $256$ quadrilaterals, $42$ of them strictly contain a square number of lattice points. How many quadrilaterals $ABCD$ strictly contain a square number of lattice points for $m = 100$?
<p>Let $ABCD$ be a quadrilateral whose vertices are lattice points lying on the coordinate axes as follows:</p> <p>$A(a, 0)$, $B(0, b)$, $C(-c, 0)$, $D(0, -d)$, where $1 \le a, b, c, d \le m$ and $a, b, c, d, m$ are integers.</p> <p>It can be shown that for $m = 4$ there are exactly $256$ valid ways to construct $ABCD$. Of these $256$ quadrilaterals, $42$ of them <u>strictly</u> contain a square number of lattice points.</p> <p>How many quadrilaterals $ABCD$ strictly contain a square number of lattice points for $m = 100$?</p>
694687
Saturday, 21st February 2015, 10:00 pm
3406
15%
easy
829
Integral Fusion
Given any integer $n \gt 1$ a binary factor tree $T(n)$ is defined to be: A tree with the single node $n$ when $n$ is prime. A binary tree that has root node $n$, left subtree $T(a)$ and right subtree $T(b)$, when $n$ is not prime. Here $a$ and $b$ are positive integers such that $n = ab$, $a\le b$ and $b-a$ is the smallest. For example $T(20)$: We define $M(n)$ to be the smallest number that has a factor tree identical in shape to the factor tree for $n!!$, the double factorial of $n$. For example, consider $9!! = 9\times 7\times 5\times 3\times 1 = 945$. The factor tree for $945$ is shown below together with the factor tree for $72$ which is the smallest number that has a factor tree of the same shape. Hence $M(9) = 72$. Find $\displaystyle\sum_{n=2}^{31} M(n)$.
Given any integer $n \gt 1$ a binary factor tree $T(n)$ is defined to be: A tree with the single node $n$ when $n$ is prime. A binary tree that has root node $n$, left subtree $T(a)$ and right subtree $T(b)$, when $n$ is not prime. Here $a$ and $b$ are positive integers such that $n = ab$, $a\le b$ and $b-a$ is the smallest. For example $T(20)$: We define $M(n)$ to be the smallest number that has a factor tree identical in shape to the factor tree for $n!!$, the double factorial of $n$. For example, consider $9!! = 9\times 7\times 5\times 3\times 1 = 945$. The factor tree for $945$ is shown below together with the factor tree for $72$ which is the smallest number that has a factor tree of the same shape. Hence $M(9) = 72$. Find $\displaystyle\sum_{n=2}^{31} M(n)$.
<p>Given any integer $n \gt 1$ a <dfn>binary factor tree</dfn> $T(n)$ is defined to be:</p> <ul> <li>A tree with the single node $n$ when $n$ is prime.</li> <li>A binary tree that has root node $n$, left subtree $T(a)$ and right subtree $T(b)$, when $n$ is not prime. Here $a$ and $b$ are positive integers such that $n = ab$, $a\le b$ and $b-a$ is the smallest.</li> </ul> <p>For example $T(20)$:</p> <img alt="0829_example1.jpg" src="resources/images/0829_example1.jpg?1678992055"/> <p>We define $M(n)$ to be the smallest number that has a factor tree identical in shape to the factor tree for $n!!$, the <b>double factorial</b> of $n$.</p> <p>For example, consider $9!! = 9\times 7\times 5\times 3\times 1 = 945$. The factor tree for $945$ is shown below together with the factor tree for $72$ which is the smallest number that has a factor tree of the same shape. Hence $M(9) = 72$.</p> <img alt="0829_example2.jpg" src="resources/images/0829_example2.jpg?1678992055"/> <p>Find $\displaystyle\sum_{n=2}^{31} M(n)$.</p>
41768797657018024
Saturday, 11th February 2023, 07:00 pm
220
45%
medium
622
Riffle Shuffles
A riffle shuffle is executed as follows: a deck of cards is split into two equal halves, with the top half taken in the left hand and the bottom half taken in the right hand. Next, the cards are interleaved exactly, with the top card in the right half inserted just after the top card in the left half, the 2nd card in the right half just after the 2nd card in the left half, etc. (Note that this process preserves the location of the top and bottom card of the deck) Let $s(n)$ be the minimum number of consecutive riffle shuffles needed to restore a deck of size $n$ to its original configuration, where $n$ is a positive even number. Amazingly, a standard deck of $52$ cards will first return to its original configuration after only $8$ perfect shuffles, so $s(52) = 8$. It can be verified that a deck of $86$ cards will also return to its original configuration after exactly $8$ shuffles, and the sum of all values of $n$ that satisfy $s(n) = 8$ is $412$. Find the sum of all values of n that satisfy $s(n) = 60$.
A riffle shuffle is executed as follows: a deck of cards is split into two equal halves, with the top half taken in the left hand and the bottom half taken in the right hand. Next, the cards are interleaved exactly, with the top card in the right half inserted just after the top card in the left half, the 2nd card in the right half just after the 2nd card in the left half, etc. (Note that this process preserves the location of the top and bottom card of the deck) Let $s(n)$ be the minimum number of consecutive riffle shuffles needed to restore a deck of size $n$ to its original configuration, where $n$ is a positive even number. Amazingly, a standard deck of $52$ cards will first return to its original configuration after only $8$ perfect shuffles, so $s(52) = 8$. It can be verified that a deck of $86$ cards will also return to its original configuration after exactly $8$ shuffles, and the sum of all values of $n$ that satisfy $s(n) = 8$ is $412$. Find the sum of all values of n that satisfy $s(n) = 60$.
<p> A riffle shuffle is executed as follows: a deck of cards is split into two equal halves, with the top half taken in the left hand and the bottom half taken in the right hand. Next, the cards are interleaved exactly, with the top card in the right half inserted just after the top card in the left half, the 2nd card in the right half just after the 2nd card in the left half, etc. (Note that this process preserves the location of the top and bottom card of the deck) </p> <p> Let $s(n)$ be the minimum number of consecutive riffle shuffles needed to restore a deck of size $n$ to its original configuration, where $n$ is a positive even number.</p> <p> Amazingly, a standard deck of $52$ cards will first return to its original configuration after only $8$ perfect shuffles, so $s(52) = 8$. It can be verified that a deck of $86$ cards will also return to its original configuration after exactly $8$ shuffles, and the sum of all values of $n$ that satisfy $s(n) = 8$ is $412$. </p> <p> Find the sum of all values of n that satisfy $s(n) = 60$. </p>
3010983666182123972
Sunday, 11th March 2018, 07:00 am
1918
15%
easy
138
Special Isosceles Triangles
Consider the isosceles triangle with base length, $b = 16$, and legs, $L = 17$. By using the Pythagorean theorem it can be seen that the height of the triangle, $h = \sqrt{17^2 - 8^2} = 15$, which is one less than the base length. With $b = 272$ and $L = 305$, we get $h = 273$, which is one more than the base length, and this is the second smallest isosceles triangle with the property that $h = b \pm 1$. Find $\sum L$ for the twelve smallest isosceles triangles for which $h = b \pm 1$ and $b$, $L$ are positive integers.
Consider the isosceles triangle with base length, $b = 16$, and legs, $L = 17$. By using the Pythagorean theorem it can be seen that the height of the triangle, $h = \sqrt{17^2 - 8^2} = 15$, which is one less than the base length. With $b = 272$ and $L = 305$, we get $h = 273$, which is one more than the base length, and this is the second smallest isosceles triangle with the property that $h = b \pm 1$. Find $\sum L$ for the twelve smallest isosceles triangles for which $h = b \pm 1$ and $b$, $L$ are positive integers.
<p>Consider the isosceles triangle with base length, $b = 16$, and legs, $L = 17$.</p> <div class="center"> <img alt="" class="dark_img" height="228" src="resources/images/0138.png?1678992052" width="230"/></div> <p>By using the Pythagorean theorem it can be seen that the height of the triangle, $h = \sqrt{17^2 - 8^2} = 15$, which is one less than the base length.</p> <p>With $b = 272$ and $L = 305$, we get $h = 273$, which is one more than the base length, and this is the second smallest isosceles triangle with the property that $h = b \pm 1$.</p> <p>Find $\sum L$ for the twelve smallest isosceles triangles for which $h = b \pm 1$ and $b$, $L$ are positive integers.</p>
1118049290473932
Saturday, 20th January 2007, 11:00 am
6556
45%
medium
703
Circular Logic II
Given an integer $n$, $n \geq 3$, let $B=\{\mathrm{false},\mathrm{true}\}$ and let $B^n$ be the set of sequences of $n$ values from $B$. The function $f$ from $B^n$ to $B^n$ is defined by $f(b_1 \dots b_n) = c_1 \dots c_n$ where: $c_i = b_{i+1}$ for $1 \leq i < n$. $c_n = b_1 \;\mathrm{AND}\; (b_2 \;\mathrm{XOR}\; b_3)$, where $\mathrm{AND}$ and $\mathrm{XOR}$ are the logical $\mathrm{AND}$ and exclusive $\mathrm{OR}$ operations. Let $S(n)$ be the number of functions $T$ from $B^n$ to $B$ such that for all $x$ in $B^n$, $T(x) ~\mathrm{AND}~ T(f(x)) = \mathrm{false}$. You are given that $S(3) = 35$ and $S(4) = 2118$. Find $S(20)$. Give your answer modulo $1\,001\,001\,011$.
Given an integer $n$, $n \geq 3$, let $B=\{\mathrm{false},\mathrm{true}\}$ and let $B^n$ be the set of sequences of $n$ values from $B$. The function $f$ from $B^n$ to $B^n$ is defined by $f(b_1 \dots b_n) = c_1 \dots c_n$ where: $c_i = b_{i+1}$ for $1 \leq i < n$. $c_n = b_1 \;\mathrm{AND}\; (b_2 \;\mathrm{XOR}\; b_3)$, where $\mathrm{AND}$ and $\mathrm{XOR}$ are the logical $\mathrm{AND}$ and exclusive $\mathrm{OR}$ operations. Let $S(n)$ be the number of functions $T$ from $B^n$ to $B$ such that for all $x$ in $B^n$, $T(x) ~\mathrm{AND}~ T(f(x)) = \mathrm{false}$. You are given that $S(3) = 35$ and $S(4) = 2118$. Find $S(20)$. Give your answer modulo $1\,001\,001\,011$.
<p>Given an integer $n$, $n \geq 3$, let $B=\{\mathrm{false},\mathrm{true}\}$ and let $B^n$ be the set of sequences of $n$ values from $B$. The function $f$ from $B^n$ to $B^n$ is defined by $f(b_1 \dots b_n) = c_1 \dots c_n$ where:</p> <ul><li>$c_i = b_{i+1}$ for $1 \leq i &lt; n$.</li> <li>$c_n = b_1 \;\mathrm{AND}\; (b_2 \;\mathrm{XOR}\; b_3)$, where $\mathrm{AND}$ and $\mathrm{XOR}$ are the logical $\mathrm{AND}$ and exclusive $\mathrm{OR}$ operations.</li> </ul><p>Let $S(n)$ be the number of functions $T$ from $B^n$ to $B$ such that for all $x$ in $B^n$, $T(x) ~\mathrm{AND}~ T(f(x)) = \mathrm{false}$. You are given that $S(3) = 35$ and $S(4) = 2118$.</p> <p>Find $S(20)$. Give your answer modulo $1\,001\,001\,011$.</p>
843437991
Saturday, 22nd February 2020, 10:00 pm
347
45%
medium
288
An Enormous Factorial
For any prime $p$ the number $N(p, q)$ is defined by $N(p, q) = \sum_{n = 0}^q T_n \cdot p^n$ with $T_n$ generated by the following random number generator: $S_0 = 290797$ $S_{n + 1} = S_n^2 \bmod 50515093$ $T_n = S_n \bmod p$ Let $\operatorname{Nfac}(p, q)$ be the factorial of $N(p, q)$. Let $\operatorname{NF}(p, q)$ be the number of factors $p$ in $\operatorname{Nfac}(p, q)$. You are given that $\operatorname{NF}(3,10000) \bmod 3^{20} = 624955285$. Find $\operatorname{NF}(61, 10^7) \bmod 61^{10}$.
For any prime $p$ the number $N(p, q)$ is defined by $N(p, q) = \sum_{n = 0}^q T_n \cdot p^n$ with $T_n$ generated by the following random number generator: $S_0 = 290797$ $S_{n + 1} = S_n^2 \bmod 50515093$ $T_n = S_n \bmod p$ Let $\operatorname{Nfac}(p, q)$ be the factorial of $N(p, q)$. Let $\operatorname{NF}(p, q)$ be the number of factors $p$ in $\operatorname{Nfac}(p, q)$. You are given that $\operatorname{NF}(3,10000) \bmod 3^{20} = 624955285$. Find $\operatorname{NF}(61, 10^7) \bmod 61^{10}$.
<p> For any prime $p$ the number $N(p, q)$ is defined by $N(p, q) = \sum_{n = 0}^q T_n \cdot p^n$<br/> with $T_n$ generated by the following random number generator:</p> <p> $S_0 = 290797$<br/> $S_{n + 1} = S_n^2 \bmod 50515093$<br/> $T_n = S_n \bmod p$ </p> <p> Let $\operatorname{Nfac}(p, q)$ be the factorial of $N(p, q)$.<br/> Let $\operatorname{NF}(p, q)$ be the number of factors $p$ in $\operatorname{Nfac}(p, q)$. </p> <p> You are given that $\operatorname{NF}(3,10000) \bmod 3^{20} = 624955285$. </p> <p> Find $\operatorname{NF}(61, 10^7) \bmod 61^{10}$.</p>
605857431263981935
Saturday, 17th April 2010, 01:00 pm
1859
35%
medium
452
Long Products
Define $F(m,n)$ as the number of $n$-tuples of positive integers for which the product of the elements doesn't exceed $m$. $F(10, 10) = 571$. $F(10^6, 10^6) \bmod 1\,234\,567\,891 = 252903833$. Find $F(10^9, 10^9) \bmod 1\,234\,567\,891$.
Define $F(m,n)$ as the number of $n$-tuples of positive integers for which the product of the elements doesn't exceed $m$. $F(10, 10) = 571$. $F(10^6, 10^6) \bmod 1\,234\,567\,891 = 252903833$. Find $F(10^9, 10^9) \bmod 1\,234\,567\,891$.
<p>Define $F(m,n)$ as the number of $n$-tuples of positive integers for which the product of the elements doesn't exceed $m$.</p> <p>$F(10, 10) = 571$.</p> <p>$F(10^6, 10^6) \bmod 1\,234\,567\,891 = 252903833$.</p> <p>Find $F(10^9, 10^9) \bmod 1\,234\,567\,891$.</p>
345558983
Saturday, 28th December 2013, 01:00 pm
652
45%
medium
529
$10$-substrings
A $10$-substring of a number is a substring of its digits that sum to $10$. For example, the $10$-substrings of the number $3523014$ are: 3523014 3523014 3523014 3523014 A number is called $10$-substring-friendly if every one of its digits belongs to a $10$-substring. For example, $3523014$ is $10$-substring-friendly, but $28546$ is not. Let $T(n)$ be the number of $10$-substring-friendly numbers from $1$ to $10^n$ (inclusive). For example $T(2) = 9$ and $T(5) = 3492$. Find $T(10^{18}) \bmod 1\,000\,000\,007$.
A $10$-substring of a number is a substring of its digits that sum to $10$. For example, the $10$-substrings of the number $3523014$ are: 3523014 3523014 3523014 3523014 A number is called $10$-substring-friendly if every one of its digits belongs to a $10$-substring. For example, $3523014$ is $10$-substring-friendly, but $28546$ is not. Let $T(n)$ be the number of $10$-substring-friendly numbers from $1$ to $10^n$ (inclusive). For example $T(2) = 9$ and $T(5) = 3492$. Find $T(10^{18}) \bmod 1\,000\,000\,007$.
<p>A <dfn>$10$-substring</dfn> of a number is a substring of its digits that sum to $10$. For example, the $10$-substrings of the number $3523014$ are:</p> <ul style="list-style-type:none;"><li><b><u>352</u></b>3014</li> <li>3<b><u>523</u></b>014</li> <li>3<b><u>5230</u></b>14</li> <li>35<b><u>23014</u></b></li></ul> <p>A number is called <dfn>$10$-substring-friendly</dfn> if every one of its digits belongs to a $10$-substring. For example, $3523014$ is $10$-substring-friendly, but $28546$ is not.</p> <p>Let $T(n)$ be the number of $10$-substring-friendly numbers from $1$ to $10^n$ (inclusive).<br/> For example $T(2) = 9$ and $T(5) = 3492$.</p> <p>Find $T(10^{18}) \bmod 1\,000\,000\,007$.</p>
23624465
Saturday, 10th October 2015, 10:00 pm
283
85%
hard