There exists a unique positive integer $a$ for which the sum \[U=\sum_{n=1}^{2023}\left\lfloor\dfrac{n^{2}-na}{5}\right\rfloor\] is an integer strictly between $-1000$ and $1000$. For that unique $a$, find $a+U$.
(Note that $\lfloor x\rfloor$ denotes the greatest integer that is less than or equal to $x$.)

Solution:
Define $\left\{ x \right\} = x - \left\lfloor x \right\rfloor$.
First, we bound $U$.
We establish an upper bound of $U$. We have
\begin{align*} U & \leq \sum_{n=1}^{2023} \frac{n^2 - na}{5} \\ & = \frac{1}{5} \sum_{n=1}^{2023} n^2 - \frac{a}{5} \sum_{n=1}^{2023} n \\ & = \frac{1012 \cdot 2023}{5} \left( 1349 - a \right) \\ & \triangleq UB . \end{align*}
We establish a lower bound of $U$. We have
\begin{align*} U & =  \sum_{n=1}^{2023} \left(  \frac{n^2 - na}{5} - \left\{ \frac{n^2 - na}{5} \right\}  \right) \\ & = \sum_{n=1}^{2023} \frac{n^2 - na}{5} - \sum_{n=1}^{2023} \left\{ \frac{n^2 - na}{5} \right\} \\ & = UB -  \sum_{n=1}^{2023} \left\{ \frac{n^2 - na}{5} \right\} \\ & \geq UB -  \sum_{n=1}^{2023} \mathbf 1 \left\{ \frac{n^2 - na}{5} \notin \Bbb Z \right\} . \end{align*}
We notice that if $5 | n$, then $\frac{n^2 - na}{5} \in \Bbb Z$.
Thus,
\begin{align*} U & \geq UB -  \sum_{n=1}^{2023} \mathbf 1 \left\{ \frac{n^2 - na}{5} \notin \Bbb Z \right\} \\ & \geq UB -  \sum_{n=1}^{2023} \mathbf 1 \left\{ 5 \nmid n \right\} \\ & = UB - \left( 2023 - \left\lfloor \frac{2023}{5} \right\rfloor \right) \\ & = UB - 1619 \\ & \triangleq LB . \end{align*}
Because $U \in \left[ - 1000, 1000 \right]$ and $UB - LB = 1619 < \left( 1000 - \left( - 1000 \right) \right)$, we must have either $UB \in \left[ - 1000, 1000 \right]$ or $LB \in \left[ - 1000, 1000 \right]$.
For $UB \in \left[ - 1000, 1000 \right]$, we get a unique $a = 1349$.
For $LB \in \left[ - 1000, 1000 \right]$, there is no feasible $a$.
Therefore, $a = 1349$. Thus $UB = 0$.
Next, we compute $U$.
Let $n = 5 q + r$, where $r = {\rm Rem} \ \left( n, 5 \right)$.
We have
\begin{align*} \left\{ \frac{n^2 - na}{5} \right\} & = \left\{ \frac{\left( 5 q + r \right)^2 - \left( 5 q + r \right)\left( 1350 - 1 \right)}{5} \right\} \\ & = \left\{ 5 q^2 + 2 q r - \left( 5 q + r \right) 270 + q + \frac{r^2 + r}{5}  \right\} \\ & = \left\{\frac{r^2 + r}{5}  \right\} \\ & = \left\{ \begin{array}{ll} 0 & \mbox{ if } r = 0, 4 \\ \frac{2}{5} & \mbox{ if } r = 1, 3 \\ \frac{1}{5} & \mbox{ if } r = 2 \end{array} \right. . \end{align*}
Therefore,
\begin{align*} U & =  \sum_{n=1}^{2023} \left(  \frac{n^2 - na}{5} - \left\{ \frac{n^2 - na}{5} \right\}  \right) \\ & = UB - \sum_{n=1}^{2023} \left\{ \frac{n^2 - na}{5} \right\} \\ & = - \sum_{n=1}^{2023} \left\{ \frac{n^2 - na}{5} \right\} \\ & = - \sum_{q=0}^{404} \sum_{r=0}^4 \left\{\frac{r^2 + r}{5}  \right\} + \left\{ \frac{0^2 - 0 \cdot a}{5} \right\} + \left\{ \frac{2024^2 - 2024a}{5} \right\} \\ & = - \sum_{q=0}^{404} \left( 0 + 0 + \frac{2}{5} + \frac{2}{5} + \frac{1}{5} \right) + 0 + 0 \\ & = - 405 . \end{align*}
Therefore, $a + U = 1349 - 405 = \boxed{\textbf{944}}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
~minor edit by KevinChen_Yay
We define $U' = \sum^{2023}_{n=1} {\frac{n^2-na}{5}}$. Since for any real number $x$, $\lfloor x \rfloor \le x \le \lfloor x \rfloor + 1$, we have $U \le U' \le U + 2023$. Now, since $-1000 \le U \le 1000$, we have $-1000 \le U' \le 3023$.
Now, we can solve for $U'$ in terms of $a$. We have:
\begin{align*} U' &= \sum^{2023}_{n=1} {\frac{n^2-na}{5}} \\ &= \sum^{2023}_{n=1} {\frac{n^2}{5} - \frac{na}{5}} \\ &= \sum^{2023}_{n=1} {\frac{n^2}{5}} - \sum^{2023}_{n=1} {\frac{na}{5}} \\ &= \frac{\sum^{2023}_{n=1} {{n^2}} - \sum^{2023}_{n=1} {na}}{5} \\ &= \frac{\frac{2023(2023+1)(2023 \cdot 2 + 1)}{6} - \frac{a \cdot 2023(2023+1)}{2} }{5} \\ &= \frac{2023(2024)(4047-3a)}{30} \\ \end{align*}
So, we have $U' = \frac{2023(2024)(4047-3a)}{30}$, and $-1000 \le U' \le 3023$, so we have $-1000 \le \frac{2023(2024)(4047-3a)}{30} \le 3023$, or $-30000 \le 2023(2024)(4047-3a) \le 90690$. Now, $2023 \cdot 2024$ is much bigger than $90690$ or $30000$, and since $4047-3a$ is an integer, to satsify the inequalities, we must have $4047 - 3a = 0$, or $a = 1349$, and $U' = 0$.
Now, we can find $U - U'$. We have:
\begin{align*} U - U' &= \sum^{2023}_{n=1} {\lfloor \frac{n^2-1349n}{5} \rfloor} - \sum^{2023}_{n=1} {\frac{n^2-1349n}{5}} \\ &= \sum^{2023}_{n=1} {\lfloor \frac{n^2-1349n}{5} \rfloor - \frac{n^2-1349n}{5}} \end{align*}.
Now, if $n^2-1349n \equiv 0 \text{ (mod 5)}$, then $\lfloor \frac{n^2-1349n}{5} \rfloor - \frac{n^2-1349n}{5} = 0$, and if $n^2-1349n \equiv 1 \text{ (mod 5)}$, then $\lfloor \frac{n^2-1349n}{5} \rfloor - \frac{n^2-1349n}{5} = -\frac{1}{5}$, and so on. Testing with $n \equiv 0,1,2,3,4, \text{ (mod 5)}$, we get $n^2-1349n \equiv 0,2,1,2,0 \text{ (mod 5)}$ respectively. From 1 to 2023, there are 405 numbers congruent to 1 mod 5, 405 numbers congruent to 2 mod 5, 405 numbers congruent to 3 mod 5, 404 numbers congruent to 4 mod 5, and 404 numbers congruent to 0 mod 5. So, solving for $U - U'$, we get:
\begin{align*} U - U' &= \sum^{2023}_{n=1} {\lfloor \frac{n^2-1349n}{5} \rfloor - \frac{n^2-1349n}{5}} \\ &= 404 \cdot 0 - 405 \cdot \frac{2}{5} - 405 \cdot \frac{1}{5} - 405 \cdot \frac{2}{5} - 404 \cdot t0 \\ &= -405(\frac{2}{5}+\frac{1}{5}+\frac{2}{5}) \\ &= -405 \end{align*}
Since $U' = 0$, this gives $U = -405$, and we have $a + U = 1349-405 = \boxed{944}$.
~ genius_007
We can view the floor function in this problem as simply subtracting the remainder of $n^2 - na$ (mod $5$) from the numerator of
$\frac{n^2-na}{5}$. For example, $\left\lfloor \frac{7}{5} \right\rfloor = \frac{7-2}{5} = 1$.
Note that the congruence of  $n^2 - na$ (mod $5$) loops every time $n$ increases by 5. Also, note that the congruence of $a$ (mod $5$) determines the set of congruences of $n^2 - na$ for each congruence of $n$ (mod $5$).
For example, if $a \equiv 1$ (mod $5$), the set of remainders is $(0, 2, 1, 2, 0)$ for $n \equiv 1,2,3,4,0$ (mod $5$). Let the sum of these elements be $s$. Note that for each “loop” of the numerator (mod $5$), each element of the set will be subtracted exactly once, meaning $s$ is subtracted once for each loop. The value of the numerator will loop $404$ times (mod $5$) throughout the sum, as $5 \cdot 404=2020$. Then
$U \approx \frac {\left( \frac {n(n+1)(2n+1)}{6} - \frac{(a)(n)(n+1)}{2}  -404s \right)}{5}$
Where $n=2023$. Note that since $5 \cdot 404=2020$, this is an approximation for $U$ because the equation disregards the remainder (mod $5$) when $n=2021, 2022$, and $2023$ so we must subtract the first 3 terms of our set of congruences one extra time to get the exact value of $U$ (*). However, we will find that this is a negligible error when it comes to the inequality $-1000<U<1000$, so we can proceed with this approximation to solve for $a$.
Factoring our approximation gives $U \approx \frac {\frac{(n)(n+1)(2n+1 - 3a)}{6}-404s}{5}$

We set $a= \frac{(2n+1)}{3} = 1349$ to make $\frac{(n)(n+1)(2n+1 - 3a)}{6}=0$, accordingly minimizing $|U|$, yielding  $U \approx  \frac{-404s}{5}$
If $a$ increases or decreases by $1$, then $U$ changes by $\frac {(n)(n+1)}{2 \cdot 5} = \frac {2023 \cdot 2024}{10}$
which clearly breaks the inequality on $U$. Therefore $a=1349 \equiv 4$ (mod $5$) giving the set of remainders $(2,1,2,0,0)$, so $s=5$ and our approximation yields $U \approx -404$. However, we must subtract 2, 1, and 2 (*) giving us $U = - 404 - \frac{(2+1+2)}{5} = - 405$, giving an answer of $1349-405= \boxed{944}$
~Spencer Danese
Consider the integral
\[\int_{0}^{2023} \dfrac{n^2-na}{5} \, dn.\]
We hope this will give a good enough appoximation of $U$ to find $a$. However, this integral can be easily evaluated(if you know calculus) to be
\[\dfrac{1}{15}2023^3-\dfrac{a}{10}2023^2=2023^2\left(\dfrac{2023}{15}-\dfrac{a}{10}\right).\]
Because we want this to be as close to $0$ as possible, we find that $a$ should equal $1349$. Then, evaluating the sum becomes trivial. Set
\[U'=\sum_{n=1}^{2023}\dfrac{n^2-1349n}{5}\]
and
\[U''=\sum_{n=1}^{2023}\{\dfrac{n^2-1349n}{5}\}.\]
Then $U=U'-U''$. We can evaluate $U'$ to be $0$ and $U''$ to be $-405$ (using some basic number theory). Thus, $U=-405$ and the answer is
\[1349+(-405)=\boxed{944}.\]
~[BS2012](https://artofproblemsolving.com/wiki/index.php/BS2012)

Answer: 944


Find the number of subsets of $\{1,2,3,\ldots,10\}$ that contain exactly one pair of consecutive integers. Examples of such subsets are $\{\mathbf{1},\mathbf{2},5\}$ and $\{1,3,\mathbf{6},\mathbf{7},10\}$.

Solution:
Define $f(x)$ to be the number of subsets of $\{1, 2, 3, 4, \ldots x\}$ that have $0$ consecutive element pairs, and $f'(x)$ to be the number of subsets that have $1$ consecutive pair.
Using casework on where the consecutive element pair is, there is a unique consecutive element pair that satisfies the conditions. It is easy to see that \[f'(10) = 2f(7) + 2f(6) + 2f(1)f(5) + 2f(2)f(4) + f(3)^2.\]
We see that $f(1) = 2$, $f(2) = 3$, and $f(n) = f(n-1) + f(n-2)$. This is because if the element $n$ is included in our subset, then there are $f(n-2)$ possibilities for the rest of the elements (because $n-1$ cannot be used), and otherwise there are $f(n-1)$ possibilities. Thus, by induction, $f(n)$ is the $n+1$th Fibonacci number.
This means that $f'(10) = 2(34) + 2(21) + 2(2)(13) + 2(3)(8) + 5^2 = \boxed{235}$.

~mathboy100
We can solve this problem using casework, with one case for each possible pair of consecutive numbers.
$\textbf{Case 1: (1,2)}$
If we have (1,2) as our pair, we are left with the numbers from 3-10 as elements that can be added to our subset. So, we must compute how many ways we can pick these numbers so that the set has no consecutive numbers other than (1,2). Our first option is to pick no more numbers, giving us $8 \choose {0}$. We can also pick one number, giving us $7 \choose {1}$ because 3 cannot be picked. Another choice is to pick two numbers and in order to make sure they are not consecutive we must fix one number in between them, giving us $6 \choose {2}$. This pattern continues for each amount of numbers, yielding $5 \choose {3}$ for 3 numbers and $4 \choose {4}$ for four numbers. Adding these up, we have $8 \choose {0}$ + $7 \choose {1}$ + $6 \choose {2}$ + $5 \choose {3}$ + $4 \choose {4}$ = $\textbf{34}$.

$\textbf{Case 2: (2,3)}$
If we have (2,3) as our pair, everything works the same as with (1,2), because 1 is still unusable as it is consecutive with 2. The only difference is we now have only 4-10 to work with. Using the same pattern as before, we have $7 \choose {0}$ + $6 \choose {1}$ + $5 \choose {2}$ + $4 \choose {3}$ = $\textbf{21}$.

$\textbf{Case 3: (3,4)}$
This case remains pretty much the same except we now have an option of whether or not to include 1. If we want to represent this like we have with our other choices, we would say $2 \choose {0}$ for choosing no numbers and $1 \choose {1}$ for choosing 1, leaving us with $2 \choose {0}$ + $1 \choose {1}$ = 2 choices (either including the number 1 in our subset or not including it). As far as the numbers from 5-10, our pattern from previous cases still holds. We have $6 \choose {0}$ + $5 \choose {1}$ + $4 \choose {2}$ + $3 \choose {3}$ = 13. With 2 choices on one side and 13 choices on the other side, we have $2\cdot13$ = $\textbf{26}$ combinations in all.

$\textbf{Case 4: (4,5)}$
Following the patterns we have already created in our previous cases, for the numbers 1-3 we have $3 \choose {0}$ + $2 \choose {1}$ = 3 choices (1, 2, or neither) and for the numbers 6-10 we have $5 \choose {0}$ + $4 \choose {1}$ + $3 \choose {2}$ = 8 choices. With 3 choices on one side and 8 choices on the other side, we have $3\cdot8$ = $\textbf{24}$ combinations in all.

$\textbf{Case 5: (5,6)}$
Again following the patterns we have already created in our previous cases, for the numbers 1-4 we have $4 \choose {0}$ + $3 \choose {1}$ + $2 \choose {2}$ = 5 choices and for the numbers 5-10 we have the same $4 \choose {0}$ + $3 \choose {1}$ + $2 \choose {2}$ = 5 choices. $5\cdot5$ = $\textbf{25}$ combinations in all.

$\textbf{Rest of the cases}$
By symmetry, the case with (6,7) will act the same as case 4 with (4,5). This goes the same for (7,8) and case 3, (8.9) and case 2, and (9,10) and case 1.

Now, we simply add up all of the possibilities for each case to get our final answer. 34 + 21 + 26 + 24 + 25 + 24 + 26 + 21 + 34 = $\boxed{\textbf{(235)}}$

-Algebraik
Denote by $N_1 \left( m \right)$ the number of subsets of a set $S$ that consists of $m$ consecutive integers, such that each subset contains exactly one pair of consecutive integers.
Denote by $N_0 \left( m \right)$ the number of subsets of a set $S$ that consists of $m$ consecutive integers, such that each subset does not contain any consecutive integers.
Denote by $a$ the smallest number in set $S$.
First, we compute $N_1 \left( m \right)$.
Consider $m \geq 3$.
We do casework analysis.
Case 1: A subset does not contain $a$.
The number of subsets that has exactly one pair of consecutive integers is $N_1 \left( m - 1 \right)$.
Case 2: A subset contains $a$ but does not contain $a + 1$.
The number of subsets that has exactly one pair of consecutive integers is $N_1 \left( m - 2 \right)$.
Case 3: A subset contains $a$ and $a + 1$.
To have exactly one pair of consecutive integers, this subset cannot have $a + 2$, and cannot have consecutive integers in $\left\{ a+3, a+4, \cdots , a + m - 1 \right\}$.
Thus, the number of subsets that has exactly one pair of consecutive integers is $N_0 \left( m - 3 \right)$.
Therefore, for $m \geq 3$,
\[N_1 \left( m \right) = N_1 \left( m - 1 \right) + N_1 \left( m - 2 \right) + N_0 \left( m - 3 \right) .\]
For $m = 1$, we have $N_1 \left( 1 \right) = 0$.
For $m = 2$, we have $N_1 \left( 2 \right) = 1$.

Second, we compute $N_0 \left( m \right)$.
Consider $m \geq 2$.
We do casework analysis.
Case 1: A subset does not contain $a$.
The number of subsets that has no consecutive integers is $N_0 \left( m - 1 \right)$.
Case 2: A subset contains $a$.
To avoid having consecutive integers, the subset cannot have $a + 1$.
Thus, the number of subsets that has no consecutive integers is $N_0 \left( m - 2 \right)$.
Therefore, for $m \geq 2$,
\[N_0 \left( m \right) = N_0 \left( m - 1 \right) + N_0 \left( m - 2 \right)  .\]
For $m = 0$, we have $N_0 \left( 0 \right) = 1$.
For $m = 1$, we have $N_0 \left( 1 \right) = 2$.
By solving the recursive equations above, we get $N_1 \left( 10 \right) = \boxed{\textbf{(235) }}$.
~ Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
Let $a_n$ be the number of subsets of the set $\{1,2,3,\ldots,n\}$ such that there exists exactly 1 pair of consecutive elements.
Let $b_n$ be the number of subsets of the set $\{1, 2, 3\ldots, n\}$ such that there doesn't exist any pair of consecutive elements.
First, lets see how we can construct $a_n$. For each subset $S$ counted in $a_n,$ either:
1. $\{n-1, n\}\subseteq S,$
2. $n\not\in S$, or
3. $n-1 \not\in S$ and $n\in S$.
The first case counts $b_{n-3}$ subsets (as $n-1$ cannot be included and the rest cannot have any consecutive elements), The second counts $a_{n-1},$ and the third counts $a_{n-2}$. Thus, \[a_n = a_{n-1} + a_{n-2} + b_{n-3}.\]
Next, Lets try to construct $b_n$. For each subset $T$ counted in $b_n,$ either:
1$.n \not\in T,$ or
2$.n \in T$.
The first case counts $b_{n-1}$ subsets and the second counts $b_{n-2}$. Thus, \[b_n = b_{n-1} + b_{n-2}.\]
Since $b_1 = 2$ and $b_2 = 3,$ we have that $b_n = F_{n+1},$ so $a_n = a_{n-1} + a_{n-2} + F_{n-2}$. (The $F_i$ is the $i$th Fibonacci number). From here, we can construct a table of the values of $a_n$ until $n = 10$. By listing out possibilities, we can solve for our first 3 values.
\[\begin{array}{r|l} n & a_n \\ \hline 1 & 0 \\ 2 & 1\\ 3 & 2\\ 4 & 2 + 1 + F_2 = 5\\5 & 5 + 2 + F_3 = 10\\6 & 10 + 5 + F_4 = 20 \\ 7 & 20 + 10 + F_5 = 38\\ 8 & 38 + 20 + F_6 = 71 \\ 9& 71 + 38 + F_7 = 130\\ 10 & 130 + 71 + F_8 = 235 \end{array}\]
Our answer is $a_{10} = \boxed{235}$.
~AtharvNaphade
Note: This is a very common stars and bars application.
Casework on number of terms, let the number of terms be $n$. We can come up with a generalized formula for the number  of subsets with n terms.
Let $d_1, d_2, ..., d_{n-1}$ be the differences between the n terms. For example, in the set {2, 3, 6}, $d_1 = 1; d_2 = 3; d_3 = 5$
Let the range of the set be k for now, $d_1 + ... + d_{n-1} = k$. We select one pair of terms to be consecutive by selecting one of the (n-1) terms to be 1. WLOG, let $d_1 = 1$. $1 + d_2 + ... + d_{n-1} = k$.
To ensure the other $d_2, d_3, ..., d_{n-1}$ are greater than 1 such that no two other terms are consecutive or the same, let $D_2 = d_2 + 1; D_3 = d_3 + 1; ..$.. $(n-2) + 1 + D_2 + ... + D_{n-1} = k$ where $D_2, D_3, ..., D_{n-1}$ are positive integers.
Finally, we add in $D_0$, the distance between 0 and the first term of the set, and $D_n$, the distance between the last term and 11. This way, the "distance" from 0 to 11 is "bridged" by $D_0$, k, and $D_N$.
\[D_0 + k + D_n = D_0 + ((n-1) + D_2 + ... + D_{n-1}) + D_N = 11\]
\[D_0 + D_2 + D_3 + ... + D_n = 12 - n\]
There are n positive terms, by [Balls and Urns](https://artofproblemsolving.com/wiki/index.php/Balls_and_Urns), there are ${(12-n)-1 \choose (n)-1} = {11-n \choose n-1}$ ways of doing this. However, recall that there were $(n-1)$ ways, and we had used a WLOG to choose which two digits are consecutive. The final formula for the number of valid n-element subsets is hence $(n-1){11-n \choose n-1}$ for $n > 2$.
Case 1: Two terms
$n = 2$, so $(2-1){11-2 \choose 2-1} = 1{9 \choose 1} = 9$
Case 2: Three terms
$n = 3$, so $(3-1){11-3 \choose 3-1} = 2{8 \choose 2} = 56$
Case 3: Four terms
$n = 4$, so $(4-1){11-4 \choose 4-1} = 3{7 \choose 3} = 105$
Case 4: Five terms
$n = 5$, so $(5-1){11-5 \choose 5-1} = 4{6 \choose 4} = 60$
Case 5: Six terms
$n = 6$, so $(6-1){11-6 \choose 6-1} = 5{5 \choose 5} = 5$
We can check by the Pigeonhole principle that there cannot be more than six terms, so the answer is $9+56+105+60+5=\boxed{235}$.
~Mathandski
Note that there are $F_{n+2}$ subsets of a set of $n$ consecutive integers that contains no two consecutive integers. (This can be proven by induction.)
Now, notice that if we take $i$ and $i+1$ as the consecutive integers in our subset, we need to make a subset of the remaining integers such that it doesn't contain any two consecutive integers. Clearly, $i-1$ and $i+2$ cannot be chosen, and since $i-2$ and $i+3$ are sufficiently far apart, it is obvious we do not need to be concerned that an element of the set $\{1, 2, ... , i-2 \}$ is consecutive with any element of the set $\{ i+3, i+4, ... , 10 \}$
Thus, we can count the number of ways to choose a subset from the first set without any two elements being consecutive and multiply this by the number of ways to choose a subset from the second set without any two elements being consecutive. From above, and noting that the first set has $i-2$ consecutive integer elements and the second set has $8-i$ consecutive integer elements, we know that this is $F_i F_{10-i}$.
Summing this over for all $1 \leq i \leq 9$ yields \[\sum_{i=1}^9 F_i F_{10-i} = F_1F_9 + F_2F_8 + F_3F_7 + F_4F_6 + F_5 F_5 + F_6 F_4 + F_7 F_3 + F_8 F_2 + F_9 F_1 = 2(F_1F_9 + F_2F_8 + F_3F_7+F_4F_6) + F_5^2 = 2(1 \cdot 34 + 1 \cdot 21 + 2 \cdot 13 + 3 \cdot 8) + 5^2 = 2 \cdot 105+25 = \boxed{235}.\]
~lpieleanu
The problem is the same as laying out a line of  polynomoes to cover spots $0,1,...10$: 1 triomino ($RGG$), $n$ dominoes ($RG$), and $8-2n$ monominoes ($R$).  The $G$ spots cover the members of the subset.
The total number spots is 11, because one $R$ spot always covers the 0, and the other spots cover 1 through 10.
There are 5 ways to choose polyomino sets, and many ways to order each set:
$R + RG + RGG =$ Polyominoes $\rightarrow$ Orderings
$0 + 4 + 1 = 5 \rightarrow 5! / 0!4!1! = ~~~5$
$2 + 3 + 1 = 6 \rightarrow 6! / 2!3!1! = ~60$
$4 + 2 + 1 = 7 \rightarrow 7! / 4!2!1! = 105$
$6 + 1 + 1 = 8 \rightarrow 8! / 6!1!1! = ~56$
$8 + 0 + 1 = 9 \rightarrow 9! / 8!0!1! = ~~~9$
The sum is $\boxed{235}$.
~BraveCobra22aops
Let $dp(i)$ be the number of subsets of a set $i$ consecutive integers such that the maximum value in the set is $i$ and there exists exactly one pair of consecutive integers. Define $dp2(i)$ similarly, but without any pair of consecutive integers. The base cases are  $dp2(1)=dp2(2)=1$, $dp(1)=0$, and $dp(2)=1$.
The transitions are:
\[dp2(i)=\sum_{j=1}^{i-2}(dp(j))+1\]
\[dp(i)=dp2(i-1)+\sum_{j=1}^{i-2}dp(j)\]
Note that $dp2$ is the Fibonacci numbers.
\[\begin{array}{rcl} i & dp & dp2\\ \hline 1 & 0 & 1 \\ 2 & 1 & 1 \\ 3 & 1 & 2 \\ 4 & 3 & 3 \\ 5 & 5 & 5 \\ 6 & 10 & 8 \\ 7 & 18 & 13 \\ 8 & 33 & 21 \\ 9 & 59 & 34 \\ 10 & 105 & 55 \\ \end{array}\]
Summing over $dp$ yields $1+1+3+5+10+18+33+59+105=\boxed{235}$
~Mathenthus

Answer: 235


Let $\triangle ABC$ be an equilateral triangle with side length $55$. Points $D$, $E$, and $F$ lie on $\overline{BC}$, $\overline{CA}$, and $\overline{AB}$, respectively, with $BD = 7$, $CE=30$, and $AF=40$. Point $P$ inside $\triangle ABC$ has the property that \[\angle AEP = \angle BFP = \angle CDP.\] Find $\tan^2(\angle AEP)$.

Solution:
By Miquel's theorem, $P=(AEF)\cap(BFD)\cap(CDE)$ (intersection of circles). The law of cosines can be used to compute $DE=42$, $EF=35$, and $FD=13$. Toss the points on the coordinate plane; let $B=(-7, 0)$, $D=(0, 0)$, and $C=(48, 0)$, where we will find $\tan^{2}\left(\measuredangle CDP\right)$ with $P=(BFD)\cap(CDE)$.
By the extended law of sines, the radius of circle $(BFD)$ is $\frac{13}{2\sin 60^{\circ}}=\frac{13}{3}\sqrt{3}$. Its center lies on the line $x=-\frac{7}{2}$, and the origin is a point on it, so $y=\frac{23}{6}\sqrt{3}$.
The radius of circle $(CDE)$ is $\frac{42}{2\sin 60^{\circ}}=14\sqrt{3}$. The origin is also a point on it, and its center is on the line $x=24$, so $y=2\sqrt{3}$.
The equations of the two circles are \begin{align*}(BFD)&:\left(x+\tfrac{7}{2}\right)^{2}+\left(y-\tfrac{23}{6}\sqrt{3}\right)^{2}=\tfrac{169}{3} \\ (CDE)&:\left(x-24\right)^{2}+\left(y-2\sqrt{3}\right)^{2}=588\end{align*} These equations simplify to \begin{align*}(BFD)&:x^{2}+7x+y^{2}-\tfrac{23}{3}\sqrt{3}y=0 \\ (CDE)&: x^{2}-48x+y^{2}-4\sqrt{3}y=0\end{align*} Subtracting these two equations gives that both their points of intersection, $D$ and $P$, lie on the line $55x-\tfrac{11}{3}\sqrt{3}y=0$. Hence, $\tan^{2}\left(\measuredangle AEP\right)=\tan^{2}\left(\measuredangle CDP\right)=\left(\frac{55}{\tfrac{11}{3}\sqrt{3}}\right)^{2}=3\left(\tfrac{55}{11}\right)^{2}=\boxed{075}$. To scale, the configuration looks like the figure below:
Denote $\theta = \angle AEP$.
In $AFPE$, we have $\overrightarrow{AF} + \overrightarrow{FP} + \overrightarrow{PE} + \overrightarrow{EA} = 0$.
Thus,
\[ AF + FP e^{i \theta} + PE e^{i \left( \theta + 60^\circ \right)} + EA e^{- i 120^\circ} = 0. \]
Taking the real and imaginary parts, we get
\begin{align*} AF + FP \cos \theta + PE \cos \left( \theta + 60^\circ \right) + EA \cos \left( - 120^\circ \right) & = 0 \hspace{1cm} (1) \\ FP \sin \theta + PE \sin \left( \theta + 60^\circ \right) + EA \sin \left( - 120^\circ \right) & = 0 \hspace{1cm} (2) \end{align*}
In $BDPF$, analogous to the analysis of $AFPE$ above, we get
\begin{align*} BD + DP \cos \theta + PF \cos \left( \theta + 60^\circ \right) + FB \cos \left( - 120^\circ \right) & = 0 \hspace{1cm} (3) \\ DP \sin \theta + PF \sin \left( \theta + 60^\circ \right) + FB \sin \left( - 120^\circ \right) & = 0 \hspace{1cm} (4) \end{align*}
Taking $(1) \cdot \sin \left( \theta + 60^\circ \right) - (2) \cdot \cos \left( \theta + 60^\circ \right)$, we get
\[ AF \sin \left( \theta + 60^\circ \right) + \frac{\sqrt{3}}{2} FP - EA \sin \theta = 0 . \hspace{1cm} (5) \]
Taking $(3) \cdot \sin \theta - (4) \cdot \cos \theta$, we get
\[ BD \sin \theta - \frac{\sqrt{3}}{2} FP + FB \sin \left( \theta + 120^\circ \right) . \hspace{1cm} (6) \]
Taking $(5) + (6)$, we get
\[ AF \sin \left( \theta + 60^\circ \right)  - EA \sin \theta + BD \sin \theta  + FB \sin \left( \theta + 120^\circ \right) . \]
Therefore,
\begin{align*} \tan \theta & = \frac{\frac{\sqrt{3}}{2} \left( AF + FB \right)} {\frac{FB}{2} + EA - \frac{AF}{2} - BD} \\ & = 5 \sqrt{3} . \end{align*}
Therefore, $\tan^2 \theta = \boxed{075}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
Drop the perpendiculars from $P$ to $\overline{AB}$, $\overline{AC}$, $\overline{BC}$, and call them $Q,R,$ and $S$ respectively. This gives us three similar right triangles $FQP$, $ERP$, and $DSP$.
The sum of the perpendiculars to a point $P$ within an equilateral triangle is always constant, so we have that $PQ+PR+PS=\dfrac{55 \sqrt{3}}{2}$.
The sum of the lengths of the alternating segments split by the perpendiculars from a point $P$ within an equilateral triangle is always equal to half the perimeter, so $QA+RC+SB = \dfrac{165}{2},$ which means that $FQ+ER+DS = QA+RC+SB - CE - AF - BD = \dfrac{165}{2} - 30 - 40 - 7 = \dfrac{11}{2}$.
Finally, $\tan AEP = \dfrac{PQ}{FQ} = \dfrac{PR}{ER} = \dfrac{PS}{DS} = \dfrac{PQ+PR+PS}{FQ+ER+DS} = 5 \sqrt{3}$.
Thus, $\tan^2 AEP = \boxed{075}$.
~anon
Claim

[Carnot theorem new.png](https://artofproblemsolving.com/wiki/index.php/File:Carnot_theorem_new.png)
a) Carnot's theorem. Given triangle $\triangle ABC$ and point $P$.  Let $PS \perp BC,$
$PR \perp AC, PQ \perp AB$. $P$ doesn't have to be inside $\triangle ABC$.
Prove that $AQ^2 + BS^2 + CR^2 = AR^2 + BQ^2 + CS^2$.
b) Let $\triangle ABC$ be the equilateral triangle. Prove that $AQ + BS + CR = \frac {3}{2} AB$. (The sum of the lengths of the alternating segments split by the perpendiculars from a point $P$ within an equilateral triangle is equal to half the perimeter.)
Proof
a) $AP^2 = AQ^2 + PQ^2 = AR^2 + PR^2,$
\[BP^2 = BQ^2 + PQ^2 = BS^2 + PS^2,\]
\[CP^2 = CR^2 + PR^2 = CS^2 + PS^2 \implies\]
$AQ^2 + PQ^2 + BS^2 + PS^2 + CR^2 + PR^2 = AR^2 + PR^2 + BQ^2 + PQ^2 + CS^2 + PS^2,$
\[AQ^2 + BS^2 + CR^2 = AR^2 + BQ^2 + CS^2.\]
b) $AQ + BQ = BS + CS = CR + AR = AB = AC = BC,$
\[AQ^2 + BQ^2 + 2 AQ \cdot BQ + BS^2 + CS^2 + 2 BS \cdot CS + AR^2 + CR^2+ 2 AR \cdot CR = 3 AB^2.\]

[2023 AIME I 11.png](https://artofproblemsolving.com/wiki/index.php/File:2023_AIME_I_11.png)
\[2AQ^2 + 2 AQ \cdot BQ + 2 BS^2 + 2 BS \cdot CS + 2 CR^2 + 2 AR \cdot CR = 3 AB^2.\]
\[AQ (AQ + BQ) + BS (BS + CS) + CR (AR + CR) = \frac {3}{2} AB^2.\]
\[AQ \cdot AB + BS \cdot BC + CR \cdot AC = \frac {3}{2} AB^2.\]
\[AQ + BS + CR = \frac {3}{2} AB.\]
vladimir.shelomovskii@gmail.com, vvsss
This solution is inspired by AIME 1999 Problem 14 Solution 2 (a similar question)
Draw line segments from $P$ to points $A$, $B$, and $C$. And label the angle measure of $\angle{BFP}$, $\angle{CDP}$, and $\angle{AEP}$ to be $\alpha$
Using Law of Cosines (note that $\cos{\angle{AFP}}=\cos{\angle{BDP}}=\cos{\angle{CEP}}=\cos{180^\circ-\alpha}=-\cos{\alpha}$)
\begin{align*} (1) \ BP^2 &= FP^2+15^2-2\cdot FP\cdot15\cdot\cos(\alpha)\\ (2) \ BP^2 &= DP^2+7^2+2\cdot DP\cdot7\cdot\cos(\alpha)\\ (3) \ CP^2 &= DP^2+48^2-2\cdot DP\cdot48\cdot\cos(\alpha)\\ (4) \ CP^2 &= EP^2+30^2+2\cdot EP\cdot30\cdot\cos(\alpha)\\ (5) \ AP^2 &= EP^2+25^2-2\cdot EP\cdot25\cdot\cos(\alpha)\\ (6) \ AP^2 &= FP^2+40^2+2\cdot FP\cdot40\cdot\cos(\alpha)\\ \end{align*}
We can perform this operation $(1) - (2) + (3) - (4) + (5) - (6)$:
Leaving us with (after combining and simplifying)
\[\cos{\alpha}=\frac{-11}{2\cdot(DP+EP+FP)}\]
Therefore, we want to solve for $DP+EP+FP$
Notice that $\angle{DPE}=\angle{EPF}=\angle{FPD}=120^\circ$
We can use Law of Cosines again to solve for the sides of $\triangle{DEF}$, which have side lengths of $13$, $42$, and $35$, and area $120\sqrt{3}$.
Label the lengths of $PD$, $PE$, and $PF$ to be $x$, $y$, and $z$.
Therefore, using the $\sin$ area formula,
\begin{align*} [\triangle{DEF}] &= \frac{1}{2}\cdot\sin{120°}\cdot(xy+yz+zx) = 120\sqrt{3} \\ xy+yz+zx &= 2^5\cdot3\cdot5 \end{align*}
In addition, we know that
\begin{align*} x^2+y^2+xy&=42^2\\ y^2+z^2+yz&=35^2\\ z^2+x^2+zx&=13^2\\ \end{align*}
By using Law of Cosines for $\triangle{DPE}$, $\triangle{EPF}$, and $\triangle{FPD}$ respectively
Because we want $DP+EP+FP$, which is $x+y+z$, we see that
\begin{align*} (x+y+z)^2 &= \frac{x^2+y^2+x+y^2+z^2+yz+z^2+x^2+3(zx+xy+yz+zx)}{2} \\ (x+y+z)^2 &= \frac{42^2+35^2+13^2+3\cdot2^5\cdot3\cdot5}{2} \\ (x+y+z)^2 &= 2299 \\ x+y+z &= 11\sqrt{19} \end{align*}
So plugging the results back into the equation before, we get
\begin{align*} \cos{\alpha} &= \frac{-1}{2\sqrt{19}}\\ \sin{\alpha} &= \frac{5\sqrt{3}}{2\sqrt{19}} \end{align*}
Giving us \[\tan^2{\alpha}=\boxed{075}\]
~[Danielzh](https://artofproblemsolving.com/wiki/index.php/Daniel_Zhou%27s_Profile)
We begin by using the fact stated in Solution 3 that, for any point in an equilateral triangle, the lengths of the three perpendicular lines dropped to the sides of the triangle add up to the altitude of that triangle. To make things simple, let's assign $\angle AEP = \angle BFP = \angle CDP = \alpha$. We can label these three perpendiculars as:
\[PD\cdot\sin{\alpha} + PE\cdot\sin{\alpha} + PF\cdot\sin{\alpha} = \dfrac{55 \sqrt{3}}{2}\]
Simplifying, we get
\[PD + PE + PF = \dfrac{55 \sqrt{3}}{2\cdot\sin{\alpha}}\]
Now, as stated and quoting Solution 4,
"Draw line segments from $P$ to points $A$, $B$, and $C$. [We know that] the angle measure of $\angle{AEP}$, $\angle{BFP}$, and $\angle{CDP}$ is $\alpha$
Using Law of Cosines (note that $\cos{\angle{AFP}}=\cos{\angle{BDP}}=\cos{\angle{CEP}}=\cos{180^\circ-\alpha}=-\cos{\alpha}$)
\begin{align*} (1) \ BP^2 &= FP^2+15^2-2\cdot FP\cdot15\cdot\cos(\alpha)\\ (2) \ BP^2 &= DP^2+7^2+2\cdot DP\cdot7\cdot\cos(\alpha)\\ (3) \ CP^2 &= DP^2+48^2-2\cdot DP\cdot48\cdot\cos(\alpha)\\ (4) \ CP^2 &= EP^2+30^2+2\cdot EP\cdot30\cdot\cos(\alpha)\\ (5) \ AP^2 &= EP^2+25^2-2\cdot EP\cdot25\cdot\cos(\alpha)\\ (6) \ AP^2 &= FP^2+40^2+2\cdot FP\cdot40\cdot\cos(\alpha)\\ \end{align*}
We can perform this operation $(1) - (2) + (3) - (4) + (5) - (6)$:
Leaving us with (after combining and simplifying)
\[PD + PE + PF=\frac{11}{2\cdot\cos{\alpha}}\]".
Now, we can use our previous equation along with this one to get:
\[\frac{11}{2\cdot\cos{\alpha}} = \dfrac{55 \sqrt{3}}{2\cdot\sin{\alpha}}\].
This equation becomes:
\[\tan{\alpha} = 5\sqrt{3}\]
As so, our answer is
\[\left(5\sqrt3\right)^2=\boxed{075}.\]
~Solution by armang32324 (Mathemagics Club)
By the law of cosines,
\[FE=\sqrt{AF^2+AE^2-2AF\cdot AE\cos\angle FAE}=35.\]
Similarly we get $FD=13$ and $DE=42$. $\angle AEP=\angle BFP=\angle CDP\overset\triangle=\theta$ implies that $AFPE$, $BDPF$, and $CDPE$ are three cyclic quadrilaterals, as shown below:

Using the law of sines in each,
\[\frac{AP}{35}=\frac{AP}{FE}=\frac{CP}{42}=\frac{CP}{ED}=\frac{BP}{13}=\frac{BP}{DF}=\frac{\sin\theta}{\sin\frac\pi3}.\]
So we can set $AP=35k$, $BP=13k$, and $CP=42k$. Let $PD=d$, $PE=e$, and $PF=f$. Applying Ptolemy theorem in the cyclic quadrilaterals,
\[\begin{cases}AP\cdot FE=AF\cdot PE+AE\cdot PF,\\CP\cdot ED=CE\cdot PD+CD\cdot PE,\\BP\cdot DF=BD\cdot PF+BF\cdot PD.\end{cases} \implies \begin{cases} 1225k=40e+25f,\\1764k=30d+48e,\\169k=15d+7f, \end{cases}\]
We can solve out $d=\frac{54k}5$, $e=30k$, $f=k$. By the law of cosines in $\triangle PEF$, $FE=\sqrt{900k^2+k^2-60k\cdot\left(\frac{-1}2\right)}=\sqrt{931}k$. The law of sines yield $\frac{\sin\angle AEP}{\sin\angle FAE}=\frac{AP}{FE}=\frac{35k}{\sqrt{931}k}=\frac{35}{\sqrt{931}}$.
Lastly, $\sin\angle AEP=\frac{5\sqrt{57}}{38}$, then $\tan\angle AEP=5\sqrt3$. The answer is
\[\left(5\sqrt3\right)^2=\boxed{075}.\]

Answer: 075


Each face of two noncongruent parallelepipeds is a rhombus whose diagonals have lengths $\sqrt{21}$ and $\sqrt{31}$.
The ratio of the volume of the larger of the two polyhedra to the volume of the smaller is $\frac{m}{n}$, where $m$ and $n$
are relatively prime positive integers. Find $m + n$. A parallelepiped is a solid with six parallelogram faces
such as the one shown below.
[asy] unitsize(2cm); pair o = (0, 0), u = (1, 0), v = 0.8*dir(40), w = dir(70);  draw(o--u--(u+v)); draw(o--v--(u+v), dotted); draw(shift(w)*(o--u--(u+v)--v--cycle)); draw(o--w); draw(u--(u+w)); draw(v--(v+w), dotted); draw((u+v)--(u+v+w)); [/asy]

Solution:
Denote $\alpha = \tan^{-1} \frac{\sqrt{21}}{\sqrt{31}}$.
Denote by $d$ the length of each side of a rhombus.
Now, we put the solid to the 3-d coordinate space.
We put the bottom face on the $x-O-y$ plane.
For this bottom face, we put a vertex with an acute angle $2 \alpha$ at the origin, denoted as $O$.
For two edges that are on the bottom face and meet at $O$, we put one edge on the positive side of the $x$-axis. The endpoint is denoted as $A$. Hence, $A = \left( d , 0 , 0 \right)$.
We put the other edge in the first quadrant of the $x-O-y$ plane. The endpoint is denoted as $B$. Hence, $B = \left( d \cos 2 \alpha , d \sin 2 \alpha , 0 \right)$.
For the third edge that has one endpoint $O$, we denote by $C$ its second endpoint.
We denote $C = \left( u , v , w \right)$.
Without loss of generality, we set $w > 0$.
Hence,
\[ u^2 + v^2 + w^2 = d^2 . \hspace{1cm} (1) \]
We have
\begin{align*} \cos \angle AOC & = \frac{\overrightarrow{OA} \cdot \overrightarrow{OC}}{|OA| \cdot |OC|} \\ & = \frac{u}{d} , \hspace{1cm} (2) \end{align*}
and
\begin{align*} \cos \angle BOC & = \frac{\overrightarrow{OB} \cdot \overrightarrow{OC}}{|OB| \cdot |OC|} \\ & = \frac{u \cos 2 \alpha + v \sin 2 \alpha}{d} . \hspace{1cm} (3) \end{align*}
Case 1: $\angle AOC = \angle BOC = 2 \alpha$ or $2 \left( 90^\circ - \alpha \right)$.
By solving (2) and (3), we get
\begin{align*} u & = \pm d \cos 2 \alpha , \\ v & = \pm d \cos 2 \alpha \frac{1 - \cos 2 \alpha}{\sin 2 \alpha} \\ & = \pm d \cos 2 \alpha \tan \alpha . \end{align*}
Plugging these into (1), we get
\begin{align*} w & = d \sqrt{1 - \cos^2 2 \alpha - \cos^2 2 \alpha \tan^2 \alpha} \\ & = d \sqrt{\sin^2 2 \alpha - \cos^2 2 \alpha \tan^2 \alpha} . \hspace{1cm} (4) \end{align*}
Case 2: $\angle AOC = 2 \alpha$ and $\angle BOC = 2 \left( 90^\circ - \alpha \right)$, or $\angle BOC = 2 \alpha$ and $\angle AOC = 2 \left( 90^\circ - \alpha \right)$.
By solving (2) and (3), we get
\begin{align*} u & = \pm d \cos 2 \alpha , \\ v & = \mp d \cos 2 \alpha \frac{1 + \cos 2 \alpha}{\sin 2 \alpha} \\ & = \mp d \cos 2 \alpha \cot \alpha . \end{align*}
Plugging these into (1), we get
\begin{align*} w & = d \sqrt{1 - \cos^2 2 \alpha - \cos^2 2 \alpha \cot^2 \alpha} \\ & = d \sqrt{\sin^2 2 \alpha - \cos^2 2 \alpha \cot^2 \alpha} . \hspace{1cm} (5) \end{align*}
We notice that $(4) > (5)$. Thus, (4) (resp. (5)) is the parallelepiped with a larger (resp. smaller) height.
Therefore, the ratio of the volume of the larger parallelepiped to the smaller one is
\begin{align*} \frac{(4)}{(5)} & = \frac{\sqrt{\sin^2 2 \alpha - \cos^2 2 \alpha \tan^2 \alpha}} {\sqrt{\sin^2 2 \alpha - \cos^2 2 \alpha \cot^2 \alpha}} \\ & = \sqrt{\frac{\tan^2 2 \alpha - \tan^2 \alpha}{\tan^2 2 \alpha - \cot^2 \alpha}} . \end{align*}
Recall that $\tan \alpha = \frac{\sqrt{21}}{\sqrt{31}}$.
Thus, $\tan 2 \alpha = \frac{2 \tan \alpha}{1 - \tan^2 \alpha} = \frac{\sqrt{21 \cdot 31}}{5}$.
Plugging this into the equation above, we get
\begin{align*} \frac{(4)}{(5)} & = \frac{63}{62}. \end{align*}
Therefore, the answer is $63 + 62 = \boxed{\textbf{(125) }}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
Let one of the vertices be at the origin and the three adjacent vertices be $u$, $v$, and $w$. For one of the parallelepipeds, the three diagonals involving the origin have length $\sqrt {21}$. Hence, $(u+v)\cdot (u+v)=u\cdot u+v\cdot v+2u\cdot v=21$ and $(u-v)\cdot (u-v)=u\cdot u+v\cdot v-2u\cdot v=31$. Since all of $u$, $v$, and $w$ have equal length, $u\cdot u=13$, $v\cdot v=13$, and $u\cdot v=-2.5$. Symmetrically, $w\cdot w=13$, $u\cdot w=-2.5$, and $v\cdot w=-2.5$. Hence the volume of the parallelepiped is given by $\sqrt{\operatorname{det}\begin{pmatrix}13&-2.5&-2.5\\-2.5&13&-2.5\\-2.5&-2.5&13\end{pmatrix}}=\sqrt{\operatorname{det}\begin{pmatrix}15.5&-15.5&0\\-2.5&13&-2.5\\0&-15.5&15.5\end{pmatrix}}=\sqrt{15.5^2\operatorname\det\begin{pmatrix}1&-1&0\\-2.5&13&-2.5\\0&-1&1\end{pmatrix}}=\sqrt{15.5^2\cdot 8}$.
For the other parallelepiped, the three diagonals involving the origin are of length $\sqrt{31}$ and the volume is $\sqrt{\operatorname{det}\begin{pmatrix}13&2.5&2.5\\2.5&13&2.5\\2.5&2.5&13\end{pmatrix}}=\sqrt{\operatorname{det}\begin{pmatrix}10.5&-10.5&0\\2.5&13&2.5\\0&-10.5&10.5\end{pmatrix}}=\sqrt{10.5^2\operatorname\det\begin{pmatrix}1&-1&0\\2.5&13&2.5\\0&-1&1\end{pmatrix}}=\sqrt{10.5^2\cdot 18}$.
Consequently, the answer is $\sqrt\frac{10.5^2\cdot 18}{15.5^2\cdot 8}=\frac{63}{62}$, giving $\boxed{125}$.
~EVIN-
Observe that both parallelepipeds have two vertices (one on each base) that have three congruent angles meeting at them. Denote the parallelepiped with three acute angles meeting $P$, and the one with three obtuse angles meeting $P'$.
The area of a parallelepiped is simply the base area times the height, but because both parallelepipeds have the same base, what we want is just the ratio of the heights.
Denote the point with three acute angles meeting at it in $P$ as $A$, and its neighbors $B$, $C$, and $D$. Similarly, denote the point with three obtuse angles meeting at it in $P'$ as $A'$, and its neighbors $B'$, $C'$, and $D'$.
We have the following equations:
\[\textrm{Height of }P\textrm{ from }ACD = \frac{\textrm{Vol}(ABCD) \cdot 3}{[ACD]},\]
\[\textrm{Height of }P'\textrm{ from }A'C'D' = \frac{\textrm{Vol}(A'B'C'D') \cdot 3}{[A'C'D']}.\]
However, $ACD$ and $A'C'D'$ are both half the area of a rhombus with diagonals $\sqrt{31}$ and $\sqrt{21}$, so our ratio is really
\[\frac{P}{P'} = \frac{\textrm{Vol}(ABCD)}{\textrm{Vol}(A'B'C'D')}.\]
Because the diagonals of all of the faces are $\sqrt{31}$ and $\sqrt{21}$, each edge of the parallelepipeds is $\sqrt{13}$ by the Pythagorean theorem.
We have $AB = AC = AD = \sqrt{13}$, and $BC = CD = BD = \sqrt{21}$. When we drop a perpendicular to the centroid of $BCD$ from $A$ (let's call this point $O$), we have $BO = \frac{\sqrt{21}}{\sqrt{3}} = \sqrt{7}$. Thus,
\[AB^2 - BO^2 = AO^2\]
\[13 - 7 = AO^2 = 6\]
\[AO = \sqrt{6}.\]
The area of base $BCD$ is $\frac{21\sqrt{3}}{4}$. Hence,
\[\textrm{Vol}(ABCD) = \frac{\sqrt{6}\cdot\frac{21\sqrt{3}}{4}}{3}\]
\[= \frac{63\sqrt{2}}{12}.\]
We can apply a similar approach to $A'B'C'D'$.
$A'B' = A'C' = A'D' = \sqrt{13}$, and $B'C' = C'D' = B'D' = \sqrt{31}$. When we drop a perpendicular to the centroid of $B'C'D'$ from $A'$ (let's call this point $O'$), we have $B'O' = \frac{\sqrt{31}}{\sqrt{3}} = \sqrt{\frac{31}{3}}$. Thus,
\[A'B'^2 - B'O'^2 = A'O'^2\]
\[13 - \frac{31}{3} = A'O'^2\]
\[A'O' = \sqrt{8}{3} = \frac{2\sqrt{6}}{3}.\]
The area of base $B'C'D'$ is $\frac{31\sqrt{3}}{4}$. Hence,
\[\textrm{Vol}(A'B'C'D') = \frac{\frac{2\sqrt{6}}{3}\cdot\frac{31\sqrt{3}}{4}}{3}\]
\[= \frac{186\sqrt{2}}{36}\]
\[= \frac{62\sqrt{2}}{12}.\]
Finally,
\[\frac{P}{P'} = \frac{\textrm{Vol}(ABCD)}{\textrm{Vol}(A'B'C'D')} = \frac{\frac{63\sqrt{2}}{12}}{\frac{62\sqrt{2}}{12}} = \frac{63}{62}.\]
Our answer is $63 + 62 = \boxed{125}$.
~mathboy100
Since the two parallelepipeds have the same base, all we need to do is to find their respective heights.

As illustrated in the above diagram, drop a perpendicular from $D$ onto the base at $P$. Denote the center of the base by $O$. By symmetry, $P$ must be on $AO$. Now we need to find $DP$.
Apply Pythagorean theorem to $\triangle DPA$ we have
\[DP^2 = AD^2 - AP^2.\]
Apply Pythagorean theorem to $\triangle DPC$ and then $\triangle CPO$ we have
\[DP^2 = DC^2 - CP^2 = DC^2 - (CO^2 + OP^2) = DC^2 - (CO^2 + (AO-AP)^2) = DC^2 - CO^2 - (AO-AP)^2.\]
Combining the above two, we have
\[AD^2 - AP^2 = DC^2 - CO^2 - (AO-AP)^2.\]
Since $AD=\sqrt{13}$, $DC=\sqrt{21}$, $CO=\frac{\sqrt{21}}{2}$, $AO=\frac{\sqrt{31}}{2}$, plug them into the above equation and solve for the only unknown variable $AP$, we get $AP=\frac{5}{\sqrt{31}}$.
Thus the height
\[DP = \sqrt{AD^2 - AP^2} = \sqrt{13 - \frac{25}{31}} = \sqrt{\frac{378}{31}}.\]
[asy] unitsize(2cm); pair a = (0, 0), b = (1, 0), c = 0.8*dir(40), d = 0.7*dir(80), e = c+d, p = 0.9*dir(10), o = (b+c)/2;  label("A'",a,S); label("B'",b,S); label("C'",c,W); label("E'",e,N); label("P'",p,S); label("O'",o,W);  draw(a--b--(b+c)); draw(a--c--(b+c), dotted); draw(shift(d)*(a--b--(b+c)--c--cycle)); draw(a--d); draw(b--(b+d)); draw(c--(c+d), dotted); draw((b+c)--(b+c+d));  draw(e--p, dotted); draw(c--b, dotted); draw(a--(b+c), dotted); draw(p--a, dotted); draw(e--a, dotted); [/asy]
For the other parallelepiped, using the same approach and drop a perpendicular from $E'$ onto the base at $P'$. Similarly applying Pythagorean theorem to $\triangle E'P'C'$, $\triangle E'P'A'$ and $\triangle A'P'O'$ we have
\[C'E'^2 - C'P'^2 = A'E'^2 - A'O'^2 - (C'P'-C'O')^2.\]
Plugging known values into the above equation and solve for the only unknown variable $C'P'$, we get $C'P'=\frac{5}{\sqrt{21}}$.
Thus the height
\[E'P' = \sqrt{C'E'^2 - C'P'^2} = \sqrt{13 - \frac{25}{21}} = \sqrt{\frac{248}{21}}.\]
The ratio between the two is therefore
\[\frac{DP}{E'P'} = \frac{\sqrt{\frac{378}{31}}}{\sqrt{\frac{248}{21}}} = \sqrt{\frac{2\cdot3^3\cdot7}{31}\cdot\frac{3\cdot7}{2^3\cdot31}} = \frac{3^2\cdot7}{2\cdot31} = \frac{63}{62}\], giving $\boxed{125}$.
~sgdzw
[2023 AIME I 13a.png](https://artofproblemsolving.com/wiki/index.php/File:2023_AIME_I_13a.png)
Let us inscribe a tetrahedron $ACB'D'$ in given parallelepiped so that its edges coincide with the diagonals of the faces of the parallelepiped. Note that the three edges outgoing from the vertex $B'$ have the same length $b$, and the three edges at the base have a different length $a$.
The volume of the tetrahedron $V= \frac {a^2}{12}\sqrt{3b^2 - a^2}$ is three times less than the volume of the parallelepiped.
In second parallelepiped $a$ and $b$ change the positions.
Required ratio is $\frac {a^2 \cdot \sqrt {3b^2 - a^2}}{b^2 \cdot \sqrt {3a^2 - b^2}} = \frac {21 \sqrt {3 \cdot 31 - 21}}{31 \cdot \sqrt{3 \cdot 21 - 31}} = \frac {21 \sqrt {72}}{31 \sqrt {32}}= \frac {63}{62}$.
Claim

[2023 AIME I 13.png](https://artofproblemsolving.com/wiki/index.php/File:2023_AIME_I_13.png)
Let $ABCD$ be the regular pyramid, $AB = AC = AD = b, BC = BD = CD = a$.
The area of $\triangle BCD = \frac {a^2 \sqrt {3}}{4}$.
Height $AO^2 = AB^2 - OB^2 = {b^2 - \frac {a^2}{3}}$.
Volume $V= \frac {a^2}{12}\sqrt{3b^2 - a^2}$.
vladimir.shelomovskii@gmail.com, vvsss

Answer: 125


The following analog clock has two hands that can move independently of each other.
[asy]             unitsize(2cm);             draw(unitcircle,black+linewidth(2));              for (int i = 0; i < 12; ++i) {                 draw(0.9*dir(30*i)--dir(30*i));             }             for (int i = 0; i < 4; ++i) {                 draw(0.85*dir(90*i)--dir(90*i),black+linewidth(2));             }             for (int i = 1; i < 13; ++i) {                 label(\small + (string) i, dir(90 - i * 30) * 0.75);             }             draw((0,0)--0.6*dir(90),black+linewidth(2),Arrow(TeXHead,2bp));             draw((0,0)--0.4*dir(90),black+linewidth(2),Arrow(TeXHead,2bp)); [/asy]
Initially, both hands point to the number $12$. The clock performs a sequence of hand movements so that on each movement, one of the two hands moves clockwise to the next number on the clock face while the other hand does not move.
Let $N$ be the number of sequences of $144$ hand movements such that during the sequence, every possible positioning of the hands appears exactly once, and at the end of the $144$ movements, the hands have returned to their initial position. Find the remainder when $N$ is divided by $1000$.

Solution:
This problem is, in essence, the following:  A $12\times12$ coordinate grid is placed on a (flat) torus; how many loops are there that pass through each point while only moving up or right?  In other words, Felix the frog starts his journey at $(0,0)$ in the coordinate plane.  Every second, he jumps either to the right or up, until he reaches an $x$- or $y$-coordinate of $12$.  At this point, if he tries to jump to a coordinate outside the square from $(0,0)$ to $(11,11)$, he "wraps around" and ends up at an $x$- or $y$- coordinate of $0$.  How many ways are there for Felix to jump on every grid point in this square, so that he ends at $(0,0)$?  This is consistent with the construction of the flat torus as $\mathbb Z^2/12\mathbb Z^2$ (2-dimensional modular arithmetic.  $(\mathbb{Z}_{12})^2$)
Moving on, define a $\textit{path}$ from point $A$ to point $B$ to be a sequence of "up"s and "right"s that takes Felix from $A$ to $B$.  The $\textit{distance}$ from $A$ to $B$ is the length of the shortest path from $A$ to $B$.  At the crux of this problem is the following consideration:  The points $A_i=(i,12-i), i\in{0,...,11}$ are pairwise equidistant, each pair having distance of $12$ in both directions.
[asy] size(7cm); for (int x=0; x<12; ++x){ for (int y=0; y<12; ++y){ fill(circle((x,y),0.05));}} for (int i=0; i<12; ++i){ fill(circle((i,11-i),0.1),red);} pen p=green+dashed; path u=(3,8)--(4,8)--(4,9)--(4,10)--(4,11)--(5,11)--(5,11.5); path v=(5,-0.5)--(5,0)--(5,1)--(6,1)--(6,2)--(6,3)--(6,4)--(7,4); draw(u,p); draw(v,p); pen p=blue+dashed; path u=(4,7)--(5,7)--(5,8)--(5,9)--(5,10)--(6,10)--(6,11)--(6,11.5); path v=(6,-0.5)--(6,0)--(7,0)--(7,1)--(7,2)--(7,3)--(8,3); draw(u,p); draw(v,p); [/asy]
A valid complete path then joins two $A_i$'s, say $A_i$ and $A_j$.  In fact, a link between some $A_i$ and $A_j$ fully determines the rest of the cycle, as the path from $A_{i+1}$ must "hug" the path from $A_i$, to ensure that there are no gaps.  We therefore see that if $A_0$ leads to $A_k$, then $A_i$ leads to $A_{i+k}$.  Only the values of $k$ relatively prime to $12$ result in solutions, though, because otherwise $A_0$ would only lead to $\{A_i:\exists n\in \mathbb Z:i\equiv kn\quad\text{mod 12}\}$.  The number of paths from $A_0$ to $A_k$ is ${12\choose k}$, and so the answer is
\[{12\choose1}+{12\choose5}+{12\choose7}+{12\choose11}=1\boxed{608}.\]
Notes:
- One can prove that the path from $A_{i+1}$ must "hug" the path from $A_i$ by using techniques similar to those in Solution 2.
- One can count the paths as follows:  To get from $A_0$ to $A_i$, Felix takes $k$ rights and $12-k$ ups, which can be done in  ${12\choose k}$ ways.
This is more of a solution sketch and lacks rigorous proof for interim steps, but illustrates some key observations that lead to a simple solution.
Note that one can visualize this problem as walking on a $N \times N$ grid where the edges warp. Your goal is to have a single path across all nodes on the grid leading back to $(0,\ 0)$. For convenience, any grid position are presumed to be in $\mod N$.
Note that there are exactly two ways to reach node $(i,\ j)$, namely $(i - 1,\ j)$ and $(i,\ j - 1)$.
As a result, if a path includes a step from $(i,\ j)$ to $(i + 1,\ j)$, there cannot be a step from $(i,\ j)$ to $(i,\ j + 1)$. However, a valid solution must reach $(i,\ j + 1)$, and the only valid step is from $(i - 1,\ j + 1)$.
So a solution that includes a step from $(i,\ j)$ to $(i + 1,\ j)$ dictates a step from $(i - 1,\ j + 1)$ to $(i,\ j + 1)$ and by extension steps from $(i - a,\ j + a)$ to $(i - a + 1,\ j + a)$. We observe the equivalent result for steps in the orthogonal direction.
This means that in constructing a valid solution, taking one step in fact dictates N steps, thus it's sufficient to count valid solutions with $N = a + b$ moves of going right $a$ times and $b$ times up the grid. The number of distinct solutions can be computed by permuting 2 kinds of indistinguishable objects $\binom{N}{a}$.
Here we observe, without proof, that if $\gcd(a, b) \neq 1$, then we will return to the origin prematurely. For $N = 12$, we only want to count the number of solutions associated with $12 = 1 + 11 = 5 + 7 = 7 + 5 = 11 + 1$.
(For those attempting a rigorous proof, note that $\gcd(a, b) = \gcd(a + b, b) = \gcd(N, b) = \gcd(N, a)$).
The total number of solutions, noting symmetry, is thus
\[2\cdot\left(\binom{12}{1} + \binom{12}{5}\right) = 1608\]
This yields $\boxed{\textbf{608}}$ as our desired answer.
~ cocoa @ [https://www.corgillogical.com/](https://artofproblemsolving.comhttps://www.corgillogical.com/)
Define a $12 \times 12$ matrix $X$.
Each entry $x_{i, j}$ denotes the number of movements the longer hand moves, given that two hands jointly make $12 \left( i - 1 \right) + \left( j - 1 \right)$ movements.
Thus, the number of movements the shorter hand moves is $12 \left( i - 1 \right) + \left( j - 1 \right) - x_{i, j}$.
Denote by $r_{i, j}$ the remainder of $x_{i, j}$ divided by 12.
Denote by $R$ this remainder matrix.
If two hands can return to their initial positions after 144 movements, then $r_{12, 12} = 0$ or 11.
Denote by $S_0$ (resp. $S_{11}$) the collection of feasible sequences of movements, such that $r_{12, 12} = 0$ (resp. $r_{12, 12} = 11$).
Define a function $f :  S_0 \rightarrow S_{11}$, such that for any $\left\{ x_{i,j} , \ \forall \ i, j \in \left\{ 1, 2, \cdots , 12 \right\} \right\} \in S_0$, the functional value of the entry indexed as $\left( i, j \right)$ is $12 \left( i - 1 \right) + \left( j - 1 \right) - x_{i, j}$.
Thus, function $f$ is bijective. This implies $| S_0 | = | S_{11} |$.
In the rest of analysis, we count $| S_0 |$.
We make the following observations:
\begin{enumerate}
\item $x_{1, 1} = 0$ and $12 | x_{12, 12}$.
These follow from the definition of $S_0$.
\item Each column of $R$ is a permutation of $\left\{ 0, 1, \cdots , 11 \right\}$.
The reasoning is as follows. Suppose there exist $i < i'$, $j$, such that $r_{i, j} = r_{i', j}$. Then this entails that the positions of two hands after the $\left( 12 \left( i' - 1 \right) + \left( j - 1 \right) \right)$th movement coincide with their positions after the  $\left( 12 \left( i - 1 \right) + \left( j - 1 \right) \right)$th movement.
\item For any $j \in \left\{ 1, 2 ,\cdots , 11 \right\}$, $x_{i, j+1} - x_{i, j}$ is equal to either 0 for all $i$ or 1 for all $i$.
The reasoning is as follows. If this does not hold and the $j$th column in $R$ is a permutation of $\left\{ 0, 1, \cdots , 12 \right\}$, then the $j+1$th column is no longer a permutation of $\left\{ 0, 1, \cdots , 12 \right\}$. This leads to the infeasibility of the movements.
\item $x_{i+1, 1} = x_{i, 12}$ for any $i \in \left\{ 1, 2, \cdots , 11 \right\}$.
This follows from the conditions that the $12$th column in $R$ excluding $r_{12, 12}$ and the first column in $R$ excluding $x_{1, 1}$ are both permutations of $\left\{ 1, 2, \cdots , 11 \right\}$.
\end{enumerate}
All observations jointly imply that $x_{i, 12} = i \cdot x_{1, 12}$.
Thus, $\left\{ r_{1, 12}, r_{2, 12} , \cdots , r_{11, 12} \right\}$ is a permutation of $\left\{ 1, 2, \cdots , 11 \right\}$.
Thus, $x_{1, 12}$ is relatively prime to 12.
Because $x_{1, 1} = 0$ and $x_{1, 12} - x_{1, 1} \leq 11$, we have $x_{1, 12} = 1$, 5, 7, or 11.
Recall that when we move from $x_{1, 1}$ to $x_{1, 12}$, there are 11 steps of movements. Each movement has $x_{1, j+1} - x_{i, j} = 0$ or 1.
Thus, for each given $x_{1, 12}$, the number of feasible movements from $x_{1, 1}$ to $x_{1, 12}$ is $\binom{11}{x_{1, 12}}$.
Therefore, the total number of feasible movement sequences in this problem is
\begin{align*} | S_0 | + | S_{11} | & = 2 | S_0 | \\ & = 2 \cdot \sum_{x_{1, 12} = 1, 5, 7, 11} \binom{11}{x_{1, 12}} \\ & = 2 \left( 11 + 462 + 330 + 1 \right) \\ & = 1608 . \end{align*}
Therefore, the answer is $\boxed{\textbf{(608) }}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)

Answer: 608


Find the largest prime number $p<1000$ for which there exists a complex number $z$ satisfying

the real and imaginary part of $z$ are both integers;
$|z|=\sqrt{p}$, and
there exists a triangle whose three side lengths are $p$, the real part of $z^{3}$, and the imaginary part of $z^{3}$.

Solution:
Assume that $z=a+bi$. Then,
\[z^3=(a^3-3ab^2)+(3a^2b-b^3)i\]Note that by the Triangle Inequality,
\[|(a^3-3ab^2)-(3a^2b-b^3)|<p\implies |a^3+b^3-3ab^2-3a^2b|<a^2+b^2\]Thus, we know
\[|a+b||a^2+b^2-4ab|<a^2+b^2\]Without loss of generality, assume $a>b$ (as otherwise, consider $i^3\overline z=b+ai$). If $|a/b|\geq 4$, then
\[17b^2\geq a^2+b^2>|a+b||a^2+b^2-4ab|\geq |b-4b||16b^2-16b^2+b^2|=3b^3\]`Thus, this means $b\leq\frac{17}3$ or $b\leq 5$. Also note that the roots of $x^2-4x+1$ are $2\pm\sqrt 3$, so thus if $b\geq 6$,
\[2\sqrt 3b=(2(2-\sqrt 3)-4)b<a<4b\]Note that
\[1000>p=a^2+b^2\geq 12b^2+b^2=13b^2\]so $b^2<81$, and $b<9$. If $b=8$, then $16\sqrt 3\leq a\leq 32$. Note that $\gcd(a,b)=1$, and $a\not\equiv b\pmod 2$, so $a=29$ or $31$. However, then $5\mid a^2+b^2$, absurd.
If $b=7$, by similar logic, we have that $14\sqrt 3 <a< 28$, so $b=26$. However, once again, $5\mid a^2+b^2$. If $b=6$, by the same logic, $12\sqrt3<a<24$, so $a=23$, where we run into the same problem. Thus $b\leq 5$ indeed.
If $b=5$, note that
\[(a+5)(a^2+25-20a)<a^2+25\implies a<20\]We note that $p=5^2+18^2=349$ works. Thus, we just need to make sure that if $b\leq 4$, $a\leq 18$. But this is easy, as
\[p>(a+b)(a^2+b^2-4ab)\geq (4+18)(4^2+18^2-4\cdot 4\cdot 18)>1000\]absurd. Thus, the answer is $\boxed{349}$.
Denote $z = a + i b$. Thus, $a^2 + b^2 = p$.
Thus,
\[z^3 = a \left( a^2 - 3 b^2 \right) + i b \left( - b^2 + 3 a^2 \right) .\]
Because $p$, ${\rm Re} \left( z^3 \right)$, ${\rm Im} \left( z^3 \right)$ are three sides of a triangle, we have ${\rm Re} \left( z^3 \right) > 0$ and ${\rm Im} \left( z^3 \right) > 0$.
Thus,
\begin{align*} a \left( a^2 - 3 b^2 \right) & > 0 , \hspace{1cm} (1) \\ b \left( - b^2 + 3 a^2 \right) & > 0. \hspace{1cm} (2) \end{align*}
Because $p$, ${\rm Re} \left( z^3 \right)$, ${\rm Im} \left( z^3 \right)$ are three sides of a triangle, we have the following triangle inequalities:
\begin{align*} {\rm Re} \left( z^3 \right) + {\rm Im} \left( z^3 \right) & > p \hspace{1cm} (3) \\ p + {\rm Re} \left( z^3 \right) & > {\rm Im} \left( z^3 \right) \hspace{1cm} (4) \\ p + {\rm Im} \left( z^3 \right) & > {\rm Re} \left( z^3 \right) \hspace{1cm} (5) \end{align*}
We notice that $| z^3 | = p^{3/2}$, and ${\rm Re} \left( z^3 \right)$, ${\rm Im} \left( z^3 \right)$, and $| z^3 |$ form a right triangle. Thus, ${\rm Re} z^3 + {\rm Im} z^3 > p^{3/2}$.
Because $p > 1$, $p^{3/2} > p$.
Therefore, (3) holds.
Conditions (4) and (5) can be written in the joint form as
\[\left| {\rm Re} \left( z^3 \right) - {\rm Im} \left( z^3 \right) \right| < p . \hspace{1cm} (4)\]

We have
\begin{align*} {\rm Re} \left( z^3 \right) - {\rm Im} \left( z^3 \right) & = \left( a^3 - 3 a b^2 \right) - \left( - b^3 + 3 a^2 b \right) \\ & = \left( a + b \right) \left( a^2 - 4 ab + b^2 \right) \end{align*}
and $p = a^2 + b^2$.
Thus, (5) can be written as
\[\left| \left( a + b \right) \left( a^2 - 4 ab + b^2 \right)  \right| < a^2 + b^2 . \hspace{1cm} (6)\]
Therefore, we need to jointly solve (1), (2), (6).
From (1) and (2), we have either $a, b >0$, or $a, b < 0$.
In (6), by symmetry, without loss of generality, we assume $a, b > 0$.
Thus, (1) and (2) are reduced to
\[a > \sqrt{3} b . \hspace{1cm} (7)\]
Let $a = \lambda b$. Plugging this into (6), we get
\begin{align*} \left| \left( \left( \lambda - 2 \right)^2 - 3 \right)  \right| < \frac{1}{b} \frac{\lambda^2 + 1}{\lambda + 1} .  \hspace{1cm} (8) \end{align*}
Because $p= a^2 + b^2$ is a prime, $a$ and $b$ are relatively prime.
Therefore, we can use (7), (8), $a^2 + b^2 <1000$, and $a$ and $b$ are relatively prime to solve the problem.
To facilitate efficient search, we apply the following criteria:
\begin{enumerate*}
\item To satisfy (7) and $a^2 + b^2 < 1000$, we have $1 \leq b \leq 15$.
In the outer layer, we search for $b$ in a decreasing order.
In the inner layer, for each given $b$, we search for $a$.
\item Given $b$, we search for $a$ in the range $\sqrt{3} b < a < \sqrt{1000 - b^2}$.
\item We can prove that for $b \geq 9$, there is no feasible $a$.
The proof is as follows.
For $b \geq 9$, to satisfy $a^2 + b^2 < 1000$, we have $a \leq 30$.
Thus, $\sqrt{3} < \lambda \leq \frac{30}{9}$.
Thus, the R.H.S. of (8) has the following upper bound
\begin{align*} \frac{1}{b} \frac{\lambda^2 + 1}{\lambda + 1} & < \frac{1}{b} \frac{\lambda^2 + \lambda}{\lambda + 1} \\ & = \frac{\lambda}{b} \\ & \leq \frac{\frac{30}{9}}{9} \\ & < \frac{10}{27} . \end{align*}
Hence, to satisfy (8), a necessary condition is
\begin{align*} \left| \left( \left( \lambda - 2 \right)^2 - 3 \right)  \right| < \frac{10}{27} . \end{align*}
However, this cannot be satisfied for $\sqrt{3} < \lambda \leq \frac{30}{9}$.
Therefore, there is no feasible solution for $b \geq 9$.
Therefore, we only need to consider $b \leq 8$.
\item We eliminate $a$ that are not relatively prime to $b$.
\item We use the following criteria to quickly eliminate $a$ that make $a^2 + b^2$ a composite number.

For $b \equiv 1 \pmod{2}$, we eliminate $a$ satisfying $a \equiv 1 \pmod{2}$.
For $b \equiv \pm 1 \pmod{5}$ (resp. $b \equiv \pm 2 \pmod{5}$), we eliminate $a$ satisfying $a \equiv \pm 2 \pmod{5}$ (resp. $a \equiv \pm 1 \pmod{5}$).

\item For the remaining $\left( b, a \right)$, check whether (8) and the condition that $a^2 + b^2$ is prime are both satisfied.
The first feasible solution is $b = 5$ and $a = 18$.
Thus, $a^2 + b^2 = 349$.
\item For the remaining search, given $b$, we only search for $a \geq \sqrt{349 - b^2}$.
Following the above search criteria, we find the final answer as $b = 5$ and $a = 18$.
Thus, the largest prime $p$ is $p = a^2 + b^2 = \boxed{\textbf{(349) }}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)

Answer: 349


Positive real numbers $b \not= 1$ and $n$ satisfy the equations \[\sqrt{\log_b n} = \log_b \sqrt{n} \qquad \text{and} \qquad b \cdot \log_b n = \log_b (bn).\] The value of $n$ is $\frac{j}{k}$, where $j$ and $k$ are relatively prime positive integers. Find $j+k$.

Solution:
Denote $x = \log_b n$.
Hence, the system of equations given in the problem can be rewritten as
\begin{align*} \sqrt{x} & = \frac{1}{2} x , \\ bx & = 1 + x . \end{align*}
Solving the system gives $x = 4$ and $b = \frac{5}{4}$.
Therefore,
\[n = b^x = \frac{625}{256}.\]
Therefore, the answer is $625 + 256 = \boxed{881}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)

Answer: 881


A plane contains $40$ lines, no $2$ of which are parallel. Suppose that there are $3$ points where exactly $3$ lines intersect, $4$ points where exactly $4$ lines intersect, $5$ points where exactly $5$ lines intersect, $6$ points where exactly $6$ lines intersect, and no points where more than $6$ lines intersect. Find the number of points where exactly $2$ lines intersect.

Solution:
In this solution, let $\boldsymbol{n}$-line points be the points where exactly $n$ lines intersect. We wish to find the number of $2$-line points.
There are $\binom{40}{2}=780$ pairs of lines. Among them:

The $3$-line points account for $3\cdot\binom32=9$ pairs of lines.
The $4$-line points account for $4\cdot\binom42=24$ pairs of lines.
The $5$-line points account for $5\cdot\binom52=50$ pairs of lines.
The $6$-line points account for $6\cdot\binom62=90$ pairs of lines.
It follows that the $2$-line points account for $780-9-24-50-90=\boxed{607}$ pairs of lines, where each pair intersect at a single point.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
~MRENTHUSIASM

Answer: 607


The sum of all positive integers $m$ such that $\frac{13!}{m}$ is a perfect square can be written as $2^a3^b5^c7^d11^e13^f,$ where $a,b,c,d,e,$ and $f$ are positive integers. Find $a+b+c+d+e+f$.

Solution:
We first rewrite $13!$ as a prime factorization, which is $2^{10}\cdot3^5\cdot5^2\cdot7\cdot11\cdot13$.
For the fraction to be a square, it needs each prime to be an even power. This means $m$ must contain $7\cdot11\cdot13$. Also, $m$ can contain any even power of $2$ up to $2^{10}$, any odd power of $3$ up to $3^{5}$, and any even power of $5$ up to $5^{2}$. The sum of $m$ is \[(2^0+2^2+2^4+2^6+2^8+2^{10})(3^1+3^3+3^5)(5^0+5^2)(7^1)(11^1)(13^1) =\] \[1365\cdot273\cdot26\cdot7\cdot11\cdot13 = 2\cdot3^2\cdot5\cdot7^3\cdot11\cdot13^4.\] Therefore, the answer is $1+2+1+3+1+4=\boxed{012}$.
~chem1kall
The prime factorization of $13!$ is \[2^{10} \cdot 3^5 \cdot 5^2 \cdot 7 \cdot 11 \cdot 13.\]
To get $\frac{13!}{m}$ a perfect square, we must have $m = 2^{2x} \cdot 3^{1 + 2y} \cdot 5^{2z} \cdot 7 \cdot 11 \cdot 13$, where $x \in \left\{ 0, 1, \cdots , 5 \right\}$, $y \in \left\{ 0, 1, 2 \right\}$, $z \in \left\{ 0, 1 \right\}$.
Hence, the sum of all feasible $m$ is
\begin{align*} \sum_{x=0}^5 \sum_{y=0}^2 \sum_{z=0}^1 2^{2x} \cdot 3^{1 + 2y} \cdot 5^{2z} \cdot 7 \cdot 11 \cdot 13 & = \left( \sum_{x=0}^5 2^{2x} \right) \left( \sum_{y=0}^2 3^{1 + 2y} \right) \left( \sum_{z=0}^1 5^{2z} \right) 7 \cdot 11 \cdot 13 \\ & = \frac{4^6 - 1}{4-1} \cdot \frac{3 \cdot \left( 9^3 - 1 \right)}{9 - 1} \cdot \frac{25^2  - 1}{25 - 1} \cdot 7 \cdot 11 \cdot 13 \\ &  = 2 \cdot 3^2 \cdot 5 \cdot 7^3 \cdot 11 \cdot 13^4 . \end{align*}
Therefore, the answer is
\begin{align*} 1 + 2 + 1 + 3 + 1 + 4 & = \boxed{012} . \end{align*}
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
Try smaller cases. There is clearly only one $m$ that makes $\frac{2!}{m}$ a square, and this is $m=2$. Here, the sum of the exponents in the prime factorization is just $1$. Furthermore, the only $m$ that makes $\frac{3!}{m}$ a square is $m = 6 = 2^13^1$, and the sum of the exponents is $2$ here. Trying $\frac{4!}{m}$ and $\frac{5!}{m}$, the sums of the exponents are $3$ and $4$. Based on this, we (incorrectly!) conclude that, when we are given $\frac{n!}{m}$, the desired sum is $n-1$. The problem gives us $\frac{13!}{m}$, so the answer is $13-1 = \boxed{012}$.
-InsetIowa9
However!
The induction fails starting at $n = 9$ !
The actual answers $f(n)$ for small $n$ are:
$0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 8, 11, 12$
In general, $f(p) = f(p-1)+1$ if p is prime, $n=4,6,8$ are "lucky", and the pattern breaks down after $n=8$
-"fake"  warning by oinava
We have $\frac{13!}{m}=a^2$ for some integer $a$. Writing $13!$ in terms of its prime factorization, we have \[\frac{13!}{m}=\frac{2^{10}\cdot3^5\cdot5^2\cdot7^1\cdot11^1\cdot13^1}{m}=a^2.\] For a given prime $p$, let the exponent of $p$ in the prime factorization of $m$ be $k$. Then we have \[\frac{10-2k}{2}+\frac{5-k}{2}+\frac{2-k}{2}+\frac{1-k}{2}+\frac{1-k}{2}+\frac{1-k}{2}\geq 2.\] Simplifying the left-hand side, we get \[k\geq 4.\] Thus, the exponent of each prime factor in $m$ is at least $4$. Also, since $13$ is prime and appears in the prime factorization of $13!$, it follows that $13$ must divide $m$.
Thus, $m$ is of the form $2^43^45^47^4\cdot11^413^{2f}$ for some nonnegative integer $f$. There are $(4+1)(4+1)(4+1)(4+1)(1+1)(2f+1)=4050(2f+1)$ such values of $m$. The sum of all possible values of $m$ is \[2^43^45^47^4\cdot11^4\sum_{f=0}^{6}13^{2f}(2f+1)=2^43^45^47^4\cdot11^4\left(\sum_{f=0}^{6}13^{2f}(2f)+\sum_{f=0}^{6}13^{2f}\right).\] The first sum can be computed using the formula for the sum of the first $n$ squares: \[\sum_{f=0}^{6}13^{2f}(2f)=\sum_{f=0}^{6}(169)^f\cdot 2f=\frac{1}{4}\left[\left(169^7-1\right)+2\left(169^6-1\right)+3\left(169^5-1\right)+\cdots+12\left(169^1-1\right)\right].\] Using the formula for the sum of a geometric series, we can simplify this as \[\sum_{f=0}^{6}13^{2f}(2f)=\frac{169^7-1}{4}+\frac{169^5-1}{2}+\frac{169^3-1}{4}=2613527040.\] The second sum can be computed using the formula for the sum of a geometric series: \[\sum_{f=0}^{6}13^{2f}=110080026.\] Thus, the sum of all possible values of $m$ is \[2^43^45^47^4\cdot11^4(2613527040+110080026)=2^33^45^37^411^413^2\cdot 29590070656,\] so $a+b+c+d+e+f=3+4+3+4+4+2=\boxed{012}$.
- This answer is incorrect.

Answer: 012


Let $P$ be a point on the circle circumscribing square $ABCD$ that satisfies $PA \cdot PC = 56$ and $PB \cdot PD = 90$. Find the area of $ABCD$.

Solution:
[Ptolemy's theorem](https://artofproblemsolving.com/wiki/index.php/Ptolemy%27s_theorem) states that for cyclic quadrilateral $WXYZ$, $WX\cdot YZ + XY\cdot WZ = WY\cdot XZ$.
We may assume that $P$ is between $B$ and $C$. Let $PA = a$, $PB = b$, $PC = c$, $PD = d$, and $AB = s$. We have $a^2 + c^2 = AC^2 = 2s^2$, because $AC$ is a diameter of the circle. Similarly, $b^2 + d^2 = 2s^2$. Therefore, $(a+c)^2 = a^2 + c^2 + 2ac = 2s^2 + 2(56) = 2s^2 + 112$. Similarly, $(b+d)^2 = 2s^2 + 180$.
By Ptolemy's Theorem on $PCDA$, $as + cs = ds\sqrt{2}$, and therefore $a + c = d\sqrt{2}$. By Ptolemy's on $PBAD$, $bs + ds = as\sqrt{2}$, and therefore $b + d = a\sqrt{2}$. By squaring both equations, we obtain
\begin{alignat*}{8} 2d^2 &= (a+c)^2 &&= 2s^2 + 112, \\ 2a^2 &= (b+d)^2 &&= 2s^2 + 180. \end{alignat*}
Thus, $a^2 = s^2 + 90$, and $d^2 = s^2 + 56$. Plugging these values into $a^2 + c^2 = b^2 + d^2 = 2s^2$, we obtain $c^2 = s^2 - 90$, and $b^2 = s^2 - 56$. Now, we can solve using $a$ and $c$ (though using $b$ and $d$ yields the same solution for $s$).
\begin{align*} ac = (\sqrt{s^2 - 90})(\sqrt{s^2 + 90}) &= 56 \\ (s^2 + 90)(s^2 - 90) &= 56^2 \\ s^4 &= 90^2 + 56^2 = 106^2 \\ s^2 &= \boxed{106}. \end{align*}
~mathboy100
By the Inscribed Angle Theorem, we conclude that $\triangle PAC$ and $\triangle PBD$ are right triangles.
Let the brackets denote areas. We are given that
\begin{alignat*}{8} 2[PAC] &= PA \cdot PC &&= 56, \\ 2[PBD] &= PB \cdot PD &&= 90. \end{alignat*}
Let $O$ be the center of the circle, $X$ be the foot of the perpendicular from $P$ to $\overline{AC},$ and $Y$ be the foot of the perpendicular from $P$ to $\overline{BD},$ as shown below:

Let $d$ be the diameter of $\odot O$. It follows that
\begin{alignat*}{8} 2[PAC] &= d\cdot PX &&= 56, \\ 2[PBD] &= d\cdot PY &&= 90. \end{alignat*}
Moreover, note that $OXPY$ is a rectangle. By the Pythagorean Theorem, we have \[PX^2+PY^2=PO^2.\]
We rewrite this equation in terms of $d:$ \[\left(\frac{56}{d}\right)^2+\left(\frac{90}{d}\right)^2=\left(\frac d2\right)^2,\] from which $d^2=212$. Therefore, we get \[[ABCD] = \frac{d^2}{2} = \boxed{106}.\]
~MRENTHUSIASM
Let the center of the circle be $O$, and the radius of the circle be $r$. Since $ABCD$ is a rhombus with diagonals $2r$ and $2r$, its area is $\dfrac{1}{2}(2r)(2r) = 2r^2$. Since $AC$ and $BD$ are diameters of the circle, $\triangle APC$ and $\triangle BPD$ are right triangles. Let $X$ and $Y$ be the foot of the altitudes to $AC$ and $BD$, respectively. We have
\[[\triangle APC] = \frac{1}{2}(PA)(PC) = \frac{1}{2}(PX)(AC),\]
so $PX = \dfrac{(PA)(PC)}{AC} = \dfrac{28}{r}$. Similarly,
\[[\triangle BPD] = \frac{1}{2}(PB)(PD) = \frac{1}{2}(PY)(PB),\]
so $PY = \dfrac{(PB)(PD)}{BD} = \dfrac{45}{r}$. Since $\triangle APX \sim \triangle PCX,$
\[\frac{AX}{PX} = \frac{PX}{CX}\]
\[\frac{AO - XO}{PX} = \frac{PX}{OC + XO}.\]
But $PXOY$ is a rectangle, so $PY = XO$, and our equation becomes
\[\frac{r - PY}{PX} = \frac{PX}{r + PY}.\]
Cross multiplying and rearranging gives us $r^2 = PX^2 + PY^2 = \left(\dfrac{28}{r}\right)^2 + \left(\dfrac{45}{r}\right)^2$, which rearranges to $r^4 = 2809$. Therefore $[ABCD] = 2r^2 = \boxed{106}$.
~Cantalon
Drop a height from point $P$ to line $\overline{AC}$ and line $\overline{BC}$. Call these two points to be $X$ and $Y$, respectively. Notice that the intersection of the diagonals of $\square ABCD$ meets at a right angle at the center of the circumcircle, call this intersection point $O$.
Since $OXPY$ is a rectangle, $OX$ is the distance from $P$ to line $\overline{BD}$. We know that $\tan{\angle{POX}} = \frac{PX}{XO} = \frac{28}{45}$ by triangle area and given information. Then, notice that the measure of $\angle{OCP}$ is half of $\angle{XOP}$.
Using the half-angle formula for tangent,
\begin{align*} \frac{(2 \cdot \tan{\angle{OCP}})}{(1-\tan^2{\angle{OCP}})} = \tan{\angle{POX}} = \frac{28}{45} \\ 14\tan^2{\angle{OCP}} + 45\tan{\angle{OCP}} - 14 = 0 \end{align*}
Solving the equation above, we get that $\tan{\angle{OCP}} = -7/2$ or $2/7$. Since this value must be positive, we pick $\frac{2}{7}$. Then, $\frac{PA}{PC} = 2/7$ (since $\triangle CAP$ is a right triangle with line $\overline{AC}$ the diameter of the circumcircle) and $PA * PC = 56$. Solving we get $PA = 4$, $PC = 14$, giving us a diagonal of length $\sqrt{212}$ and area $\boxed{106}$.
~[Danielzh](https://artofproblemsolving.com/wiki/index.php/Daniel_Zhou%27s_Profile)
Denote by $x$ the half length of each side of the square.
We put the square to the coordinate plane, with $A = \left( x, x \right)$, $B = \left( - x , x \right)$, $C = \left( - x , - x \right)$, $D = \left( x , - x \right)$.
The radius of the circumcircle of $ABCD$ is $\sqrt{2} x$.
Denote by $\theta$ the argument of point $P$ on the circle.
Thus, the coordinates of $P$ are $P = \left( \sqrt{2} x \cos \theta , \sqrt{2} x \sin \theta \right)$.
Thus, the equations $PA \cdot PC = 56$ and $PB \cdot PD = 90$ can be written as
\begin{align*} \sqrt{\left( \sqrt{2} x \cos \theta - x \right)^2 + \left( \sqrt{2} x \sin \theta - x \right)^2} \cdot \sqrt{\left( \sqrt{2} x \cos \theta + x \right)^2 + \left( \sqrt{2} x \sin \theta + x \right)^2} & = 56 \\ \sqrt{\left( \sqrt{2} x \cos \theta + x \right)^2 + \left( \sqrt{2} x \sin \theta - x \right)^2} \cdot \sqrt{\left( \sqrt{2} x \cos \theta - x \right)^2 + \left( \sqrt{2} x \sin \theta + x \right)^2} & = 90 \end{align*}
These equations can be reformulated as
\begin{align*} x^4 \left( 4 - 2 \sqrt{2} \left( \cos \theta + \sin \theta \right) \right) \left( 4 + 2 \sqrt{2} \left( \cos \theta + \sin \theta \right) \right) & = 56^2  \\ x^4 \left( 4 + 2 \sqrt{2} \left( \cos \theta - \sin \theta \right) \right) \left( 4 - 2 \sqrt{2} \left( \cos \theta - \sin \theta \right) \right) & = 90^2 \end{align*}
These equations can be reformulated as
\begin{align*} 2 x^4 \left( 1 - 2 \cos \theta  \sin \theta \right) & = 28^2 \hspace{1cm} (1) \\ 2 x^4 \left( 1 + 2 \cos \theta  \sin \theta \right) & = 45^2 \hspace{1cm} (2) \end{align*}
Taking $\frac{(1)}{(2)}$, by solving the equation, we get
\[ 2 \cos \theta \sin \theta = \frac{45^2 - 28^2}{45^2 + 28^2} . \hspace{1cm} (3) \]
Plugging (3) into (1), we get
\begin{align*} {\rm Area} \ ABCD & = \left( 2 x \right)^2 \\ & = 4 \sqrt{\frac{28^2}{2 \left( 1 - 2 \cos \theta \sin \theta \right)}} \\ & = 2 \sqrt{45^2 + 28^2} \\ & = 2 \cdot 53 \\ & = \boxed{\textbf{(106) }} . \end{align*}
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
WLOG, let $P$ be on minor arc $\overarc {AB}$. Let $r$ and $O$ be the radius and center of the circumcircle respectively, and let $\theta = \angle AOP$.
By the [Pythagorean Theorem](https://artofproblemsolving.com/wiki/index.php/Pythagorean_Theorem), the area of the square is $2r^2$. We can use the [Law of Cosines](https://artofproblemsolving.com/wiki/index.php/Law_of_Cosines) on isosceles triangles $\triangle AOP, \, \triangle COP, \, \triangle BOP, \, \triangle DOP$ to get
\begin{align*} 	 PA^2 &= 2r^2(1 - \cos \theta), \\	 PC^2 &= 2r^2(1 - \cos (180  - \theta)) = 2r^2(1 + \cos \theta), \\	 PB^2 &= 2r^2(1 - \cos (90 - \theta)) = 2r^2(1 - \sin \theta), \\	 PD^2 &= 2r^2(1 - \cos (90 + \theta)) = 2r^2(1 + \sin \theta).	 \end{align*}
Taking the products of the first two and last two equations, respectively, \[56^2 = (PA \cdot PC)^2 = 4r^4(1 - \cos \theta)(1 + \cos \theta) = 4r^4(1 - \cos^2 \theta) = 4r^4 \sin^2 \theta,\] and \[90^2 = (PB \cdot PD)^2 = 4r^4(1 - \sin \theta)(1 + \sin \theta) = 4r^4(1 - \sin^2 \theta) = 4r^4 \cos^2 \theta.\]
Adding these equations, \[56^2 + 90^2 = 4r^4,\] so
\[2r^2 = \sqrt{56^2+90^2} = 2\sqrt{28^2+45^2} = 2\sqrt{2809} = 2 \cdot 53 = \boxed{106}.\]
~OrangeQuail9
First draw a diagram.

Let's say that the radius is $r$. Then the area of the $ABCD$ is $(\sqrt2r)^2 = 2r^2$
Using the formula for the length of a chord subtended by an angle, we get
\[PA = 2r\sin\left(\dfrac{\theta}2\right)\]
\[PC = 2r\sin\left(\dfrac{180-\theta}2\right) = 2r\sin\left(90 - \dfrac{\theta}2\right) = 2r\cos\left(\dfrac{\theta}2\right)\]
Multiplying and simplifying these 2 equations gives
\[PA \cdot PC = 4r^2 \sin \left(\dfrac{\theta}2 \right) \cos \left(\dfrac{\theta}2 \right) = 2r^2 \sin\left(\theta \right) = 56\]
Similarly $PB = 2r\sin\left(\dfrac{90 +\theta}2\right)$ and $PD =2r\sin\left(\dfrac{90 -\theta}2\right)$. Again, multiplying gives
\[PB \cdot PD = 4r^2 \sin\left(\dfrac{90 +\theta}2\right) \sin\left(\dfrac{90 -\theta}2\right) = 4r^2 \sin\left(90 -\dfrac{90 -\theta}2\right) \sin\left(\dfrac{90 -\theta}2\right)\]
\[=4r^2 \sin\left(\dfrac{90 -\theta}2\right) \cos\left(\dfrac{90 -\theta}2\right) = 2r^2 \sin\left(90 - \theta \right) = 2r^2 \cos\left(\theta \right) = 90\]
Dividing $2r^2 \sin \left(\theta \right)$ by $2r^2 \cos \left( \theta \right)$ gives $\tan \left(\theta \right) = \dfrac{28}{45}$, so $\theta = \tan^{-1} \left(\dfrac{28}{45} \right)$.
Pluging this back into one of the equations, gives
\[2r^2 = \dfrac{90}{\cos\left(\tan^{-1}\left(\dfrac{28}{45}\right)\right)}\]
If we imagine a $28$-$45$-$53$ right triangle, we see that if $28$ is opposite and $45$ is adjacent, $\cos\left(\theta\right) = \dfrac{\text{adj}}{\text{hyp}} = \dfrac{45}{53}$. Now we see that
\[2r^2 = \dfrac{90}{\frac{45}{53}} = \boxed{106}.\]
~Voldemort101
Let $P=(a,b)$ on the upper quarter of the circle, and let $k$ be the side length of the square. Hence, we want to find $k^2$. Let the center of the circle be $(0,0)$.
The two equations would thus become:
\[\left(\left(a+\dfrac{k}2\right)^2+\left(b-\dfrac{k}2\right)^2\right)\left(\left(a-\dfrac{k}2\right)^2+\left(b+\dfrac{k}2\right)^2\right)=56^2\]
\[\left(\left(a-\dfrac{k}2\right)^2+\left(b-\dfrac{k}2\right)^2\right)\left(\left(a+\dfrac{k}2\right)^2+\left(b+\dfrac{k}2\right)^2\right)=90^2\]
Now, let $m=\left(a+\dfrac{k}2\right)^2$, $n=\left(a-\dfrac{k}2\right)^2$, $o=\left(b+\dfrac{k}2\right)^2$, and $p=\left(b-\dfrac{k}2\right)^2$. Our equations now change to $(m+p)(n+o)=56^2=mn+op+mo+pn$ and $(n+p)(m+o)=90^2=mn+op+no+pm$. Subtracting the first from the second, we have $pm+no-mo-pn=p(m-n)-o(m-n)=(m-n)(p-o)=34\cdot146$. Substituting back in and expanding, we have $2ak\cdot-2bk=34\cdot146$, so $abk^2=-17\cdot73$. We now have one of our terms we need ($k^2$). Therefore, we only need to find $ab$ to find $k^2$.
We now write the equation of the circle, which point $P$ satisfies: \[a^2+b^2=\left(\dfrac{k\sqrt{2}}{2}\right)^2=\dfrac{k^2}2\]
We can expand the second equation, yielding \[\left(a^2+b^2+\dfrac{k^2}2+(ak+bk)\right)\left(a^2+b^2+\dfrac{k^2}2-(ak+bk)\right)=(k^2+k(a+b))(k^2-k(a+b))=8100.\]
Now, with difference of squares, we get $k^4-k^2\cdot(a+b)^2=k^2(k^2-(a+b)^2)=8100$. We can add $2abk^2=-17\cdot73\cdot2=-2482$ to this equation, which we can factor into $k^2(k^2-(a+b)^2+2ab)=k^2(k^2-(a^2+b^2))=8100-2482$. We realize that $a^2+b^2$ is the same as the equation of the circle, so we plug its equation in: $k^2\left(k^2-\dfrac{k^2}2\right)=5618$. We can combine like terms to get $k^2\cdot\dfrac{k^2}2=5618$, so $(k^2)^2=11236$.
Since the answer is an integer, we know $11236$ is a perfect square. Since it is even, it is divisible by $4$, so we can factor $11236=2^2\cdot2809$. With some testing with approximations and last-digit methods, we can find that $53^2=2809$. Therefore, taking the square root, we find that $k^2$, the area of square $ABCD$, is $2\cdot53=\boxed{106}$.
~wuwang2002
WLOG, let $P$ be on minor arc $AD$. Draw in $AP$, $BP$, $CP$, $DP$ and let $\angle ABP = x$.  We can see, by the inscribed angle theorem, that $\angle APB = \angle ACB = 45$, and $\angle CPD = \angle CAD = 45$. Then, $\angle PAB = 135-x$, $\angle PCD = \angle PAD = (135-x)-90 = 45-x$, and $\angle PDC = 90+x$. Letting $(PA, PB, PC, PD, AB) = (a,b,c,d,s)$, we can use the law of sines on triangles $PAB$ and $PCD$ to get \[s\sqrt{2} = \frac{a}{\sin(x)} = \frac{b}{\sin(135-x)} = \frac{c}{\sin(90+x)} = \frac{d}{\sin(45-x)}.\] Making all the angles in the above equation acute gives \[s\sqrt{2} = \frac{a}{\sin(x)} = \frac{b}{\sin(45+x)} = \frac{c}{\sin(90-x)} = \frac{d}{\sin(45-x)}.\]
Note that we are looking for $s^{2}$. We are given that $ac = 56$ and $bd = 90$. This means that
$s^{2}\sin(x)\sin(90-x) = 28$ and $s^{2}\sin(45+x)\sin(45-x) = 45$. However, \[\sin(x)\sin(90-x) = \sin(x)\cos(x) = \frac{\sin(2x)}{2}\] and \[\sin(45+x)\sin(45-x) = \frac{(\cos(x) + \sin(x))(\cos(x) - \sin(x))}{2} = \frac{\cos^{2}(x) - \sin^{2}(x)}{2} = \frac{\cos(2x)}{2}.\]  Therefore, $s^{2}\sin(2x) = 56$ and $s^{2}\cos(2x) = 90$. Therefore, by the Pythagorean Identity, \[s^{2} = \sqrt{(s^{2}\sin(2x))^{2} + (s^{2}\cos(2x))^{2}} = \sqrt{56^{2} + 90^{2}} = \boxed{106}.\]
~pianoboy
Similar to Solution 6, let $P$ be on minor arc $\overarc {AB}$, $r$ and $O$ be the radius and center of the circumcircle respectively, and $\theta = \angle AOP$. Since $\triangle APC$ is a right triangle, $PA \cdot PC$ equals the hypotenuse, $2r$, times its altitude, which can be represented as $r \sin \theta$. Therefore, $2r^2 \sin \theta = 56$. Applying similar logic to $\triangle BPD$, we get $2r^2 \sin (90^\circ - \theta) = 2r^2 \cos \theta = 90$.
Dividing the two equations, we have
\begin{align*} \frac{\sin \theta}{\cos \theta} &= \frac{56}{90} \\ 56 \cos \theta &= 90 \sin \theta \\ (56 \cos \theta)^2 &= (90 \sin \theta)^2. \end{align*}
Adding $(56 \sin \theta)^2$ to both sides allows us to get rid of $\cos \theta$:
\begin{align*} (56 \cos \theta)^2 + (56 \sin \theta)^2 &= (90 \sin \theta)^2 + (56 \sin \theta)^2 \\ 56^2 &= (90^2 + 56^2)(\sin \theta)^2 \\ \frac{56^2}{90^2 + 56^2} &= (\sin \theta)^2 \\ \frac{28}{53} &= \sin \theta. \end{align*}
Therefore, we have $2r^2\left(\frac{28}{53}\right) = 56$, and since the area of the square can be represented as $2r^2$, the answer is $56 \cdot \frac{53}{28} = \boxed{106}$.
~phillipzeng

Answer: 106


Alice knows that $3$ red cards and $3$ black cards will be revealed to her one at a time in random order. Before each card is revealed, Alice must guess its color. If Alice plays optimally, the expected number of cards she will guess correctly is $\frac{m}{n}$, where $m$ and $n$ are relatively prime positive integers. Find $m+n$.

Solution:
We break the problem into stages, one for each card revealed, then further into cases based on the number of remaining unrevealed cards of each color. Since [expected value](https://artofproblemsolving.com/wiki/index.php/Expected_value) is linear, the expected value of the total number of correct card color guesses across all stages is the sum of the expected values of the number of correct card color guesses at each stage; that is, we add the probabilities of correctly guessing the color at each stage to get the final answer (See [https://brilliant.org/wiki/linearity-of-expectation/](https://artofproblemsolving.comhttps://brilliant.org/wiki/linearity-of-expectation/))
At any stage, if there are $a$ unrevealed cards of one color and $b$ of the other color, and $a \geq b$, then the optimal strategy is to guess the color with $a$ unrevealed cards, which succeeds with probability $\frac{a}{a+b}$.
Stage 1:
There are always $3$ unrevealed cards of each color, so the probability of guessing correctly is $\frac{1}{2}$.
Stage 2:
There is always a $3$-$2$ split ($3$ unrevealed cards of one color and $2$ of the other color), so the probability of guessing correctly is $\frac{3}{5}$.
Stage 3:
There are now $2$ cases:

 The guess from Stage 2 was correct, so there is now a $2$-$2$ split of cards and a $\frac{1}{2}$ probability of guessing the color of the third card correctly.
 The guess from Stage 2 was incorrect, so the split is $3$-$1$ and the probability of guessing correctly is $\frac{3}{4}$.

Thus, the overall probability of guessing correctly is $\frac{3}{5} \cdot \frac{1}{2} + \frac{2}{5} \cdot \frac{3}{4} = \frac{3}{5}$.
Stage 4:
This stage has $2$ cases as well:

 The guesses from both Stage 2 and Stage 3 were incorrect. This occurs with probability $\frac{2}{5} \cdot \frac{1}{4} = \frac{1}{10}$ and results in a $3$-$0$ split and a certain correct guess at this stage.
 Otherwise, there must be a $2$-$1$ split and a $\frac{2}{3}$ probability of guessing correctly.

The probability of guessing the fourth card correctly is therefore $\frac{1}{10} \cdot 1 + \frac{9}{10} \cdot \frac{2}{3} = \frac{7}{10}$.
Stage 5:
Yet again, there are $2$ cases:

 In Stage 4, there was a $2$-$1$ split and the guess was correct. This occurs with probability $\frac{9}{10} \cdot \frac{2}{3} = \frac{3}{5}$ and results in a $1$-$1$ split with a $\frac{1}{2}$ chance of a correct guess here.
 Otherwise, there must be a $2$-$0$ split, making a correct guess certain.

In total, the fifth card can be guessed correctly with probability $\frac{3}{5} \cdot \frac{1}{2} + \frac{2}{5} \cdot 1 = \frac{7}{10}$.
Stage 6:
At this point, only $1$ card remains, so the probability of guessing its color correctly is $1$.
In conclusion, the expected value of the number of cards guessed correctly is \[\frac{1}{2} + \frac{3}{5} + \frac{3}{5} + \frac{7}{10} + \frac{7}{10} + 1 = \frac{5+6+6+7+7+10}{10} = \frac{41}{10},\] so the answer is $41 + 10 = \boxed{051}$.
~OrangeQuail9
At any point in the game, Alice should guess whichever color has come up less frequently thus far (although if both colors have come up equally often, she may guess whichever she likes); using this strategy, her probability of guessing correctly is at least $\frac{1}{2}$ on any given card, as desired.
There are ${6 \choose 3} = 20$ possible orderings of cards, all equally likely (since any of the $6! = 720$ permutations of the cards is equally likely, and each ordering covers $3!^2 = 6^2 = 36$ permutations).
Each of the $10$ orderings that start with red cards corresponds with one that starts with a black card; the problem is symmetrical with respect to red and black cards, so we can, without loss of generality, consider only the orderings that start with red cards.
We then generate a tally table showing whether Alice's guesses are correct for each ordering; for a given card, she guesses correctly if fewer than half the previously shown cards were the same color, guesses incorrectly if more than half were the same color, and guesses correctly with probability $\frac{1}{2}$ if exactly half were the same color.
In this table, $\mid$ denotes a correct guess, $\--$ denotes an incorrect guess, and $/$ denotes a guess with $\frac{1}{2}$ probability of being correct.

[Alice's Tally Table (2023 AIME I Problem 6).png](https://artofproblemsolving.com/wiki/index.php/File:Alice%27s_Tally_Table_(2023_AIME_I_Problem_6).png)
Now we sum the tallies across orderings, obtaining $41$, and finally divide by the number of orderings ($10$) to obtain the expected number of correct guesses, $\frac{41}{10}$, which yields an answer of $41 + 10 = \boxed{051}$.
~IndigoEagle108
Denote by $N \left( a, b \right)$ the optimal expected number of cards that Alice guesses correctly, where the number of red and black cards are $a$ and $b$, respectively.
Thus, for $a, b \geq 1$, we have
\begin{align*} N \left( a, b \right) & = \max \left\{ \frac{a}{a+b} \left( 1 + N \left( a - 1 , b \right) \right) + \frac{b}{a+b} N \left( a , b - 1 \right) , \right. \\ & \hspace{1cm} \left. \frac{a}{a+b} N \left( a - 1 , b \right) + \frac{b}{a+b} \left( 1 + N \left( a , b - 1 \right) \right) \right\} . \end{align*}
For $a = 0$, Alice always guesses black. So $N \left( 0 , b \right) = b$.
For $b = 0$, Alice always guesses red. So $N \left( a , 0 \right) = a$.
To solve this dynamic program, we can also exploit its symmetry that $N \left( a , b \right) = N \left( b , a \right)$.
By solving this dynamic program, we get
$N \left( 1, 1 \right) = \frac{3}{2}$, $N \left( 1, 2 \right) = \frac{7}{3}$, $N \left( 1 , 3 \right) = \frac{13}{4}$, $N \left( 2 , 2 \right) = \frac{17}{6}$, $N \left( 2 , 3 \right) = \frac{18}{5}$, $N \left( 3, 3 \right) = \frac{41}{10}$.
Therefore, the answer is $41 + 10 = \boxed{\textbf{(051) }}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
Denote by $N_{i,j}$ the optimal expected number of cards that Alice guesses correctly, where the number of cards are $i$ and $j \ge i$.
If $i = 0$ then Alice guesses correctly all cards, so $N_{0,j} = j$.
If $j = i$ then Alice guesses next card with probability  $\frac {1}{2} \implies N_{i,i} = \frac {1}{2} + N_{i-1,i}$.
If $j = i+1$ then Alice guesses next card with probability $\frac {i+1}{2i+1} \implies N_{i,i+1} = \frac {i+1}{2i+1} (1+ N_{i,i}) + \frac{i}{2i+1}  N_{i-1,i+1}$.
If $j = i+2$ then Alice guesses next card with probability  $\frac {i+2}{2i+2} \implies N_{i,i+2} = \frac {i+2}{2i+2} (1+ N_{i,i+1}) + \frac{i}{2i+2}  N_{i-1,i+2}$.
One can find consistently: $N_{1,1} = \frac {1}{2} + N_{0,1} = \frac {3}{2},$
\[N_{1,2} = \frac {2}{3} (1 + N_{1,1}) + \frac {1}{3} N_{0,2} = \frac {7}{3}.\]
\[N_{2,2} = \frac {1}{2} + N_{1,2} = \frac {17}{6}.\]
\[N_{1,3} = \frac {3}{4} (1 + N_{1,2}) + \frac {1}{4} N_{0,3} = \frac {13}{4}.\]
\[N_{2,3} = \frac {3}{5} (1 + N_{2,2}) + \frac {2}{5} N_{1,3} = \frac {18}{5}.\]
\[N_{3,3} = \frac {1}{2} + N_{2,3} = \frac {41}{10}.\]
Therefore, the answer is $41 + 10 = \boxed{\textbf{(051) }}$.
vladimir.shelomovskii@gmail.com, vvsss
Denote $E_n$ the expected number of cards Alice guesses correctly given $n$ red cards and $n$ black cards. We want to find $E_3$.
Alice has a $\frac{1}{2}$ chance of guessing the first card. WLOG assume the first card color is red. For the next card, Alice has a $\frac{3}{5}$ chance of guessing the card if she chooses black; if they guess right, there's one less red and black card, so the expected number of cards Alice guesses from here is $E_2$. If Alice does not guess correctly (which occurs with probability $\frac{2}{5}$), this means that there's 3 black cards and 1 red card left, so Alice should guess black next with a $\frac{3}{4}$ chance of being right. If Alice is wrong (with probability $\frac{1}{4}$), there are only 3 black cards left, so Alice can guess these with certainty; if Alice is right, there are 2 blacks and 1 red left, so Alice should again guess black. If Alice is right (with probability $\frac{2}{3}$), there is now 1 black and red card each, so the expected number of cards guessed is $E_1$; if she is wrong (with probability $\frac{1}{3}$), there are 2 black cards left, so Alice can guess these with certainty.
Summing this up into a formula:
\[E_3 = \frac{1}{2} + \frac{3}{5} \left(1 + E_2 \right) + \frac{2}{5} \left( \frac{1}{4}(3) + \frac{3}{4}\left(1 + \frac{2}{3}\left(1 + E_1 \right) + \frac{1}{3}(2)\right) \right)\]
We can apply similar logic to compute $E_2$ and get
\[E_2 = \frac{1}{2} + \frac{2}{3}(1 + E_1) + \frac{1}{3}(2)\]
To compute $E_1$, we know that Alice can guess the last card with certainty, and there's a $\frac{1}{2}$ chance they get the first card as well, so $E_1 = \frac{3}{2}$.
Thus, $E_2 = \frac{17}{6}$, and after long computation, we get $E_3 = \frac{41}{10}$. The requested answer is $41 + 10 = \boxed{51}$.
~ adam_zheng

Answer: 051


Call a positive integer $n$ extra-distinct if the remainders when $n$ is divided by $2, 3, 4, 5,$ and $6$ are distinct. Find the number of extra-distinct positive integers less than $1000$.

Solution:
$n$ can either be $0$ or $1$ (mod $2$).
Case 1: $n \equiv 0 \pmod{2}$
Then, $n \equiv 2 \pmod{4}$, which implies $n \equiv 1 \pmod{3}$ and $n \equiv 4 \pmod{6}$, and therefore $n \equiv 3 \pmod{5}$. Using [CRT](https://artofproblemsolving.com/wiki/index.php/Chinese_Remainder_Theorem), we obtain $n \equiv 58 \pmod{60}$, which gives $16$ values for $n$.
Case 2: $n \equiv 1 \pmod{2}$
$n$ is then $3 \pmod{4}$. If $n \equiv 0 \pmod{3}$, $n \equiv 3 \pmod{6}$, a contradiction. Thus, $n \equiv 2 \pmod{3}$, which implies $n \equiv 5 \pmod{6}$. $n$ can either be $0 \pmod{5}$, which implies that $n \equiv 35 \pmod{60}$ by CRT, giving $17$ cases; or $4 \pmod{5}$, which implies that $n \equiv 59 \pmod{60}$ by CRT, giving $16$ cases.
The total number of extra-distinct numbers is thus $16 + 16 + 17 = \boxed{049}$.
~mathboy100
Because the LCM of all of the numbers we are dividing by is $60$, we know that all of the remainders are $0$ again at $60$, meaning that we have a cycle that repeats itself every $60$ numbers.
After listing all of the remainders up to $60$, we find that $35$, $58$, and $59$ are extra-distinct. So, we have $3$ numbers every $60$ which are extra-distinct. $60\cdot16 = 960$ and $3\cdot16 = 48$, so we have $48$ extra-distinct numbers in the first $960$ numbers. Because of our pattern, we know that the numbers from $961$ thru $1000$ will have the same remainders as $1$ thru $40$, so we have $1$ other extra-distinct number ($35$).
$48 + 1 =  \boxed{049}$.
~Algebraik
$\textbf{Case 0:  } {\rm Rem} \ \left( n, 6 \right) = 0$.
We have ${\rm Rem} \ \left( n, 2 \right) = 0$. This violates the condition that $n$ is extra-distinct.
Therefore, this case has no solution.
$\textbf{Case 1:  } {\rm Rem} \ \left( n, 6 \right) = 1$.
We have ${\rm Rem} \ \left( n, 2 \right) = 1$. This violates the condition that $n$ is extra-distinct.
Therefore, this case has no solution.
$\textbf{Case 2:  } {\rm Rem} \ \left( n, 6 \right) = 2$.
We have ${\rm Rem} \ \left( n, 3 \right) = 2$. This violates the condition that $n$ is extra-distinct.
Therefore, this case has no solution.
$\textbf{Case 3:  } {\rm Rem} \ \left( n, 6 \right) = 3$.
The condition ${\rm Rem} \ \left( n, 6 \right) = 3$ implies ${\rm Rem} \ \left( n, 2 \right) = 1$, ${\rm Rem} \ \left( n, 3 \right) = 0$.
Because $n$ is extra-distinct, ${\rm Rem} \ \left( n, l \right)$ for $l \in \left\{ 2, 3, 4 \right\}$ is a permutation of $\left\{ 0, 1 ,2 \right\}$.
Thus, ${\rm Rem} \ \left( n, 4 \right) = 2$.
However, ${\rm Rem} \ \left( n, 4 \right) = 2$ conflicts ${\rm Rem} \ \left( n, 2 \right) = 1$.
Therefore, this case has no solution.
$\textbf{Case 4:  } {\rm Rem} \ \left( n, 6 \right) = 4$.
The condition ${\rm Rem} \ \left( n, 6 \right) = 4$ implies ${\rm Rem} \ \left( n, 2 \right) = 0$ and ${\rm Rem} \ \left( n, 3 \right) = 1$.
Because $n$ is extra-distinct, ${\rm Rem} \ \left( n, l \right)$ for $l \in \left\{ 2, 3, 4 , 5 \right\}$ is a permutation of $\left\{ 0, 1 ,2 , 3 \right\}$.
Because ${\rm Rem} \ \left( n, 2 \right) = 0$, we must have ${\rm Rem} \ \left( n, 4 \right) = 2$. Hence, ${\rm Rem} \ \left( n, 5 \right) = 3$.
Hence, $n \equiv -2 \pmod{{\rm lcm} \left( 4, 5 , 6 \right)}$.
Hence, $n \equiv - 2 \pmod{60}$.
We have $1000 = 60 \cdot 16 + 40$.
Therefore, the number extra-distinct $n$ in this case is 16.
$\textbf{Case 5:  } {\rm Rem} \ \left( n, 6 \right) = 5$.
The condition ${\rm Rem} \ \left( n, 6 \right) = 5$ implies ${\rm Rem} \ \left( n, 2 \right) = 1$ and ${\rm Rem} \ \left( n, 3 \right) = 2$.
Because $n$ is extra-distinct, ${\rm Rem} \ \left( n, 4 \right)$ and ${\rm Rem} \ \left( n, 5 \right)$ are two distinct numbers in $\left\{ 0, 3, 4 \right\}$.
Because ${\rm Rem} \ \left( n, 4 \right) \leq 3$ and $n$ is odd, we have ${\rm Rem} \ \left( n, 4 \right) = 3$.
Hence, ${\rm Rem} \ \left( n, 5 \right) = 0$ or 4.
$\textbf{Case 5.1:  } {\rm Rem} \ \left( n, 6 \right) = 5$, ${\rm Rem} \ \left( n, 4 \right) = 3$, ${\rm Rem} \ \left( n, 5 \right) = 0$.
We have $n \equiv 35 \pmod{60}$.
We have $1000 = 60 \cdot 16 + 40$.
Therefore, the number extra-distinct $n$ in this subcase is 17.
$\textbf{Case 5.2:  } {\rm Rem} \ \left( n, 6 \right) = 5$, ${\rm Rem} \ \left( n, 4 \right) = 3$, ${\rm Rem} \ \left( n, 5 \right) = 4$.
$n \equiv - 1 \pmod{60}$.
We have $1000 = 60 \cdot 16 + 40$.
Therefore, the number extra-distinct $n$ in this subcase is 16.
Putting all cases together, the total number of extra-distinct $n$ is $16 + 17 + 16 = \boxed{049}$.
~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)
We need to find that $35$, $58$, and $59$ are all extra-distinct numbers smaller then $61$.
Let $k \in \left\{2, 3, 4, 5, 6 \right\}$. Denote the remainder in the division of $a$ by $b$ as ${\rm Rem} \ \left( a, b \right)$.
${\rm Rem} \ \left( -1, k \right) = k - 1 \implies {\rm Rem} \ \left( 59, k \right) = k - 1 = \left\{1, 2, 3, 4, 5 \right\}\implies 59$ is extra-distinct.
${\rm Rem} \ \left( -2, k \right) = k - 2 \implies {\rm Rem} \ \left( 58, k \right) = k - 2 = \left\{0, 1, 2, 3, 4 \right\} \implies 58$ is extra-distinct.
\[{\rm Rem} \ \left( x + 12y, k \right) = {\rm Rem} \ \left(x, k \right) + \left\{0, 0, 0, {\rm Rem} \ \left(12y, k \right), 0 \right\}.\]
We need to check all of the remainders up to $12 - 3 = 9$ and remainders
\[{\rm Rem} \ \left( 59 - 12, k \right) = {\rm Rem} \ \left( 59 - 36, k \right) = \left\{1, 2, 3, 3, 5 \right\}, {\rm Rem} \ \left( 59 - 48, k \right) = \left\{1, 2, 3, 1, 5 \right\},\]
${\rm Rem} \ \left( 59 - 24, k \right) ={\rm Rem} \ \left(35, k \right) = \left\{1, 2, 3, 0, 5 \right\} \implies 35$ is extra-distinct.
$58 - 12 = 46 \implies {\rm Rem} \ \left( 46, 5 \right) = 1 = {\rm Rem} \ \left( 46, 3 \right),$
$58 - 24 = 34 \implies {\rm Rem} \ \left( 34, 5 \right) = 4 = {\rm Rem} \ \left( 34, 6 \right),$
$58 - 36 = 22 \implies {\rm Rem} \ \left( 22, 5 \right) = 2 = {\rm Rem} \ \left( 22, 4 \right),$
$58 - 48 = 10 \implies {\rm Rem} \ \left( 10, 5 \right) = 0 = {\rm Rem} \ \left( 10, 2 \right)$.
vladimir.shelomovskii@gmail.com, vvsss

Answer: 049