Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

The Online Math Open Fall Contest

Official Solutions
October 25 – November 5, 2019
Acknowledgments

Tournament Director
• Luke Robitaille

Problem Authors
• Ankan Bhattacharya
• Ankit Bisain
• Gopal Goel
• Vincent Huang
• Sean Li
• James Lin
• Yang Liu
• Ashwin Sah
• Tristan Shin
• Edward Wan
• Brandon Wang
• Yannick Yao

Website Manager
• Evan Chen
• Douglas Chen
• Yannick Yao
OMO Fall 2019
Official Solutions

1. Compute the sum of all positive integers n such that the median of the n smallest prime numbers is n.
Proposed by Luke Robitaille.
Answer. 25 .

Solution. We claim that all the numbers are 3, 4, 5, 6, and 7, for a sum of 3 + 4 + 5 + 6 + 7 = 25.
It is straightforward to check that these work by just listing the n smallest prime numbers for these
n. Note that n = 1 and n = 2 do not work because the n smallest prime numbers are {2} and {2, 3},
respectively. Also, note that n = 8 does not work. Now, we show that n ≥ 9 does not work. Let
p1 , p2 , . . . be the prime numbers.
If n ≥ 9 is even, n = 2k for some k ≥ 5. If n is the median of p1 , p2 , . . . , pn , so
pk + pk+1
n= ⇒ pk < 2k.
2
Since no even numbers larger than 2 are prime, any prime below 2k must be one of {2, 3, 5, 7, 9, . . . 2k −
1}, which has exactly k members, so if pk < 2k, pj = 2j − 1 for j = 2, 3, . . . k. However, this is false
for j = 5, so it cannot hold for k ≥ 5, as desired.
Similarly, if n ≥ 9 is odd, write n = 2k − 1 for some k ≥ 5. If n is the median of the smallest n primes,
we have pk = 2k − 1 so pk < 2k. From the same reasoning as earlier, this cannot hold for k ≥ 5.
Thus the answer is 25 , as desired.

2. Let A, B, C, and P be points in the plane such that no three of them are collinear. Suppose that
the areas of triangles BP C, CP A, and AP B are 13, 14, and 15, respectively. Compute the sum of all
possible values for the area of triangle ABC.
Proposed by Ankan Bhattacharya.
Answer. 84 .

Solution. The possible areas are ±13 ± 14 ± 15, where at most one minus sign is used. The desired
sum equals 2(13 + 14 + 15) = 84 .

3. Let k be a positive real number. Suppose that the set of real numbers x such that x2 + k|x| ≤ 2019 is
an interval of length 6. Compute k.
Proposed by Luke Robitaille.
Answer. 670 .

Solution. Note that x2 + k|x| = (−x)2 + k | −x | for all real numbers x and k. Then x satisfies
x2 + k|x| ≤ 2019 if and only if −x does. Then the interval must be [−c, c] for some c, so since it has
length 6 it must be [−3, 3]; then equality must hold at x = 3, so 9 + 3k = 2019, so k = 670 .

4. Maryssa, Stephen, and Cynthia played a game. Each of them independently privately chose one of
Rock, Paper, and Scissors at random, with all three choices being equally likely. Given that at least
one of them chose Rock and at most one of them chose Paper, the probability that exactly one of
them chose Scissors can be expressed as m
n for relatively prime positive integers m and n. Compute
100m + n.
Proposed by Yannick Yao.
Answer. 916 .

Solution. There are 33 − 23 = 19 ways that at least one of them played Rock, and among them there
are 3 ways to have two Papers and one Rock. Among the 19 − 3 = 16 remaining possibilities, 6 of them
have the three hands appear once each and 3 of them have two Rocks and one Scissors. Therefore the
9
desired probability is 16 . The answer is 916 .

1
OMO Fall 2019
Official Solutions

5. Compute the number of ordered pairs (m, n) of positive integers that satisfy the equation lcm(m, n) +
gcd(m, n) = m + n + 30.
Proposed by Ankit Bisain.
Answer. 16 .

m n
Solution. Let g = gcd(m, n), a = g and b = g. By definition, gcd(a, b) = 1. Now, the equation
becomes
gab + g = ga + gb + 30
g(a − 1)(b − 1) = 30
If g is even, a and b would both be even, contradicting gcd(a, b) = 1. Thus, g is odd.
Case 1: g = 1; then (a − 1)(b − 1) = 2 · 3 · 5, giving the solutions

(a, b) = (2, 31), (3, 16), (4, 11), (6, 7), (7, 6), (11, 4), (16, 3), (31, 2)

(m, n) = (2, 31), (3, 16), (4, 11), (6, 7), (7, 6), (11, 4), (16, 3), (31, 2)

Case 2: g = 3; then (a − 1)(b − 1) = 2 · 5, giving

(a, b) = (2, 11), (3, 6), (6, 3), (11, 2)

but since (3, 6) and (6, 3) do not satisfy gcd(a, b) = 1, the only valid solutions are

(a, b) = (2, 11), (11, 2)

(m, n) = (6, 33), (33, 6)

Case 3: g = 5; then (a − 1)(b − 1) = 2 · 3, giving

(a, b) = (2, 7), (3, 4), (4, 3), (7, 2)

(m, n) = (10, 35), (15, 20), (20, 15), (35, 10)

Case 4: g = 15; then (a − 1)(b − 1) = 2, giving

(a, b) = (2, 3), (3, 2)

(m, n) = (30, 45), (45, 30)

We see that there is a total of 16 solutions.

6. An ant starts at the origin of the Cartesian coordinate plane. Each minute it moves randomly one
unit in one of the directions up, down, left, or right, with all four directions being equally likely; its
direction each minute is independent of its direction in any previous minutes. It stops when it reaches
a point (x, y) such that |x| + |y| = 3. The expected number of moves it makes before stopping can be
expressed as m n for relatively prime positive integers m and n. Compute 100m + n.
Proposed by Yannick Yao.
Answer. 3907 .

Solution. After one move the ant is at one of the four points (1, 0), (0, 1), (−1, 0), (0, −1), and at each
7
of the four points, there is 16 probability of reaching a point where it stops after two moves, and for
9
16 probability it goes to one of these four points again. This means that the expected number starting
from any of these four points is 2 · 16 32 32 39
7 = 7 , so the original expectation is 7 + 1 = 7 , and the answer
is 3907 .

2
OMO Fall 2019
Official Solutions

7. At a concert 10 singers will perform. For each singer x, either there is a singer y such that x wishes to
perform right after y, or x has no preferences at all. Suppose that there are n ways to order the singers
such that no singer has an unsatisfied preference, and let p be the product of all possible nonzero values
of n. Compute the largest nonnegative integer k such that 2k divides p.
Proposed by Gopal Goel.
Answer. 38 .

Solution. Suppose n is nonzero. Consider placing the singers into groups such that if for some two
people x and y, x wishes to perform right after y, then x and y are in the same group. Note that
each of these groups can be ordered in exactly one way, since every person, other than one person, is
performing immediately after a fixed person in the group. (Each group can be ordered in at least one
way, as n 6= 0). Then, if there are g groups, we can see that n = g!.
Thus n is among 10!, 9!, . . . , 1!. It is not hard to show that all these can be achieved.
Now, the product is
10!9! · · · 2!1!.
To compute the answer, Legendre’s formula gives an answer of
              
10 10 9 9 1 1
+ ... + + ... ... + + ...
2 4 2 4 2 4

= 8 + 7 + 7 + 4 + 4 + 3 + 3 + 1 + 1 + 0 = 38 .

8. There are three eight-digit positive integers which are equal to the sum of the eighth powers of their
digits. Given that two of the numbers are 24678051 and 88593477, compute the third number.
Proposed by Vincent Huang.
Answer. 24678050 .

Solution. Since 24678051 has this property, it follows trivially that 24678050 does as well.

9. Convex equiangular hexagon ABCDEF has AB = CD = EF = 1 and BC = DE = F A = 4.


Congruent and pairwise externally tangent circles γ1 , γ2 , and γ3 are drawn such that γ1 is tangent
to side AB and side BC, γ2 is tangent to side CD and side DE, and γ3 is tangent to side EF and
side F A. Then the area of γ1 can be expressed as mπ
n for relatively prime positive integers m and n.
Compute 100m + n.
Proposed by Sean Li.
Answer. 14800 .

Solution. Set the radius of γ1 to be r. Let the center of γi be Oi , the foot of O1 onto BC be X, the
midpoint of BC be M , and the center of ABCDEF be O.
√ some length chasing.√Note O1 X = r and, because 4O1 XB is a 30 − 60 − 90 triangle,
We now do
√ so CX = 2 − r/ 3. Moreover, 4O1 O2 O3 is equilateral with center O by symmetry,
BX = r/ 3 and
so OO1√= 2r/ 3. Finally, by extending sides BC, DE, F A to form an equilateral triangle, we have
OM = 3.
Then by the Pythagorean Theorem on right trapezoid XM OO1 , we have
2 2

 
r 2r
2− √ + ( 3 − r)2 = √ ,
3 3

7 3 147π
which leads to r = 10 . Thus, the area of γ1 is πr2 = 100 , so the answer is 100·147+100 = 14800.

3
OMO Fall 2019
Official Solutions

10. Let k be a positive integer. Marco and Vera play a game on an infinite grid of square cells. At the
beginning, only one cell is black and the rest are white.
A turn in this game consists of the following. Marco moves first, and for every move he must choose a
cell which is black and which has more than two white neighbors. (Two cells are neighbors if they share
an edge, so every cell has exactly four neighbors.) His move consists of making the chosen black cell
white and turning all of its neighbors black if they are not already. Vera then performs the following
action exactly k times: she chooses two cells that are neighbors to each other and swaps their colors
(she is allowed to swap the colors of two white or of two black cells, though doing so has no effect).
This, in totality, is a single turn. If Vera leaves the board so that Marco cannot choose a cell that is
black and has more than two white neighbors, then Vera wins; otherwise, another turn occurs.
Let m be the minimal k value such that Vera can guarantee that she wins no matter what Marco does.
For k = m, let t be the smallest positive integer such that Vera can guarantee, no matter what Marco
does, that she wins after at most t turns. Compute 100m + t.
Proposed by Ashwin Sah.
Answer. 103 .

Solution. We claim that the values of m and t are m = 1 and t = 3.


We show that Vera can win after at most three turns if k = 1. Let B represent a black square, and let
W represent a white square.
Originally, the position is this.
WWWWW
WWWWW
WWBWW
WWWWW
WWWWW
Then Marco makes it this.
WWWWW
WWBWW
WBWBW
WWBWW
WWWWW
Then Vera swaps two white squares off in the distance so as to not move, and Marco makes it this or
something symmetric.
WWBWW
WBWBW
WBBBW
WWBWW
WWWWW
Vera now makes it this.
WWWWW
WBBBW
WBBBW
WWBWW
WWWWW

4
OMO Fall 2019
Official Solutions

Marco is forced to make it this.


WWWWW
WBBBW
WBBBW
WBWBW
WWBWW
Vera then makes it this.
WWWWW
WBBBW
WBBBW
WBBBW
WWWWW
In this position, Vera wins. Thus Vera wins after at most three turns if k = 1. Thus m = 1 (since we
cannot have k < 1), and t ≤ 3.
Now, for k = 1, it needs to be shown that Vera cannot guarantee that she wins after at most two turns.
This is left as an exercise to the reader.
Thus, m = 1 and t = 3, as claimed. Thus, the answer is 100 · 1 + 3 = 103 .

11. Let ABC be a triangle with incenter I such that AB = 20 and AC = 19. Point P 6= A lies on line AB
and point Q 6= A lies on line AC. Suppose that IA = IP = IQ and that line P Q passes through the
midpoint of side BC. Suppose that BC = m n for relatively prime positive integers m and n. Compute
100m + n.
Proposed by Ankit Bisain.
Answer. 3902 .

Solution. Define I 0 to be the intersection of AI with the circumcircle of ABC. Then, by Simson lines,
the foot of altitude IB of I onto AB, the foot of altitude IC of I onto AC, and the midpoint of BC
are collinear.
Since IB IC ||P Q and they both go through the midpoint of BC, they must be the same line. Thus,
0
the reflection of A over I is I 0 . Then AI 0 0 0
2 = II = BI = CI by the so-called ”Fact 5.” Now, as
I lies on arc BC not containing A, AB · CI + AC · BI = BC · AI 0 by Ptolemy, which yields that
0 0 0

AB + AC = 2BC. Then BC = 39 2 , making the answer 3902 .

12. Let F (n) denote the smallest positive integer greater than n whose sum of digits is equal to the sum
of the digits of n. For example, F (2019) = 2028. Compute F (1) + F (2) + · · · + F (1000).
Proposed by Sean Li.
Answer. 535501 .

Solution. Let a(n) denote the least positive integer with digit sum n. Partition the positive integers
into chains

a(1) = 1 7→ F (1) 7→ F (F (1)) 7→ F (F (F (1))) 7→ . . .


a(2) = 2 7→ F (2) 7→ F (F (2)) 7→ F (F (F (2))) 7→ . . .
..
.
a(10) = 19 7→ F (19) 7→ F (F (19)) 7→ F (F (F (19))) 7→ . . .
..
.

5
OMO Fall 2019
Official Solutions

so a positive integer with digit sum n appears in the chain starting with a(n). Then F (N) sends each
positive integer to the next number in its chain. Thus, if X(n) is the least positive integer greater than
1000 with digit sum n, we have
27
X
(F (1) + F (2) + · · · + F (1000)) − (1 + 2 + · · · + 1000) = (X(n) − a(n)).
n=1

It is straightforward to show
(
10000 if n = 1,
a(n) = m |9 .{z
. . 9} where n = 9k + m, 0 ≤ m < 9; X(n) =
1000 + a(n − 1) if 2 ≤ n ≤ 27.
k 9’s

In particular, X(n) − a(n − 1) = 1000, so


27
X 27
X
(X(n) − a(n)) = X(1) − a(27) + (X(n) − a(n − 1)) = 10000 − 999 + 26 · 1000 = 35001,
n=1 n=2

and F (1) + · · · + F (1000) = 35001 + (1 + 2 + · · · + 1000) = 535501.

13. Compute the number of subsets S with at least two elements of {22 , 33 , . . . , 216216 } such that the
product of the elements of S has exactly 216 positive divisors.
Proposed by Sean Li.
Answer. 8 .

Solution. Let X(S) denote the product of the elements in S whose prime factorization is pe11 pe22 . . . pekk
for e1 ≥ e2 ≥ · · · ≥ ek . Then notice pi | ei for all primes pi , so pi | X(S) only if some divisor of
216 = (e1 + 1) . . . (ek + 1) is 1 (mod pi ). Moreover, a quick check shows that all numbers in S are
prime powers, for 66 6∈ S and anything more than 1010 fails due to size reasons.
Now, we take the time to list all primes which divide one less than some divisor of 216:

2 − 1 7→ ∅, 3 − 1 7→ {2}, 4 − 1 7→ {3}, 6 − 1 7→ {5}, 8 − 1 7→ {7},


9 − 1 7→ {2}, 12 − 1 7→ {11}, 18 − 1 7→ {17}, 24 − 1 7→ {23}, 27 − 1 7→ {2, 13},
36 − 1 7→ {5, 7}, 54 − 1 7→ {53}, 72 − 1 7→ {71}, 108 − 1 7→ {107}, 216 − 1 7→ {5, 43}.

Out of all powers of these primes, only 22 , 33 , 55 , 77 , 28 = 44 , 1111 , 1717 , 2323 , 226 = 22 ·88 , 5353 , 7171 , 107107
k
are expressible as a product of some prime powers of the form (pk )(p ) and could be a factor in the
prime factorization of the product of the elements of S. So we are trying to select integers, at most
one from the first set, to be our (ei + 1), id est they multiply to 216:
• {3, 9, 27} (from 22 , 28 , 226 ),
• {4, 6, 8, 12, 18, 24, 54, 72, 108}.
We perform casework on what we choose from the first set.
• If we pick nothing from the first set, then the pairs (4, 54), (12, 18) multiply to 216. It is easy to
check no triples will work, as 4 · 6 · 8 < 216 and 4 · 6 · 12 > 216, so we get two solutions here:
{33 , 5353 } and {1111 , 1717 }.
• If we pick 3 from the first set, then the number (72) and the pairs (4, 18) and (6, 12) both multiply
to 216/3 = 72, corresponding to sets {22 , 7171 }, {22 , 33 , 1717 }, and {22 , 55 , 1111 }.
• If we pick 9 from the first set, then the number (24) and the pair (4, 6) both multiply to 216/9 = 24,
corresponding to sets {44 , 2323 } and {33 , 44 , 55 }.
• If we pick 27 from the first set, then the number (8) works, corresponding to the set {22 , 77 , 88 }.

6
OMO Fall 2019
Official Solutions

Thus, we have a total of 8 sets.

14. The sequence of nonnegative integers F0 , F1 , F2 , . . . is defined recursively as F0 = 0, F1 = 1, and


Fn+2 = Fn+1 + Fn for all integers n ≥ 0. Let d be the largest positive integer such that, for all integers
n ≥ 0, d divides Fn+2020 − Fn . Compute the remainder when d is divided by 1001.
Proposed by Ankit Bisain.

Answer. 638 .

Solution. Extend the sequence to F−1 , F−2 , . . . such that Fn+2 = Fn+1 + Fn for all integers n. Note
that for all integers n, F−n = −(−1)n Fn .
Now, define the sequence Xn = Fn+2020 − Fn . Since Xn satisfies the recurrence Xn = Xn−1 + Xn−2 ,
by the Euclidean Algorithm,

gcd(Xn , Xn−1 ) = gcd(Xn−1 + Xn−2 , Xn−1 ) = gcd(Xn−2 , Xn−1 )

so for all n,
d = gcd(Xn , Xn+1 ).
Taking n = −1010,

d = gcd(F1010 − F−1010 , F1011 − F1009 ) = gcd(2F1010 , F1010 ) = F1010 .

To compute F1010 in modulo 1001, we must compute it in modulo 7, 11, and 13. We have

F0 , F1 , . . . ≡ 0, 1, 1, 2, 3, 5, 1, 6, 0, 6, 6, 5, 4, 2, 6, 1, 0

so it repeats every 16 in modulo 7. Thus,

F1010 ≡ F1010−63·16 ≡ F2 ≡ 1 (mod 7).

Similarly,
F0 , F1 , . . . = 0, 1, 1, 2, 3, 5, 8, 2, 10, 1, 0, 1, . . . (mod 11)
, so it repeats every 10 in (mod 11), giving

F1010 ≡ F0 ≡ 0 (mod 11).

For (mod 13),


F0 , F1 , . . . ≡ 0, 1, 1, 2, 3, 5, 8, 0, 8, 8, 3, 11, 1,
12, 0, 12, 12, 11, 10, 8, 5, 0, 5, 5, 10, 2, 12, 1, 0, 1, . . . (mod 13)
, meaning it repeats every 28 in (mod 13), giving

F1010 ≡ F1010−28·36 ≡ F2 ≡ 1 (mod 13).

By the Chinese Remainder Theorem, we can compute the answer as 638.

15. Let A,B,C, and D be points in the plane with AB = AC = BC = BD = CD = 36 and such that
A 6= D. Point K lies on segment AC such that AK = 2KC. Point M lies on segment AB, and point
N lies on line AC, such that D, M , and N are collinear. Let lines CM and BN
√ intersect at P . Then
the maximum possible length of segment KP can be expressed in the form m + n for positive integers
m and n. Compute 100m + n.
Proposed by James Lin.
Answer. 1632 .

7
OMO Fall 2019
Official Solutions

Solution. We first prove that ∠BP C = 60◦ . Note that 4M BD ∼ 4DCN . Now M B MB DC
BC = BD = CN =
BC ◦ ◦
CN and ∠M BC = 60 = ∠BCN , so 4M BC ∼ 4BCN . Then ∠BP C = 180 − ∠N BC − ∠BCM =
180◦ − ∠CM B − ∠BCM = ∠CBM = 60◦ , as claimed.
Then, P lies on the circumcircle of ABC.
√ Let O√be the circumcenter of ABC. By the Triangle
Inequality, KP ≤ KO + OP = 12 + 12 3 = 12 + 432, with equality when P is the intersection of
−−→
ray KO with the circumcircle of ABC. (Using a phantom point argument, it is not hard to see that
this position of P can be achieved.) The answer is then 1200 + 432 = 1632 .

16. Let ABC be a scalene triangle with inradius 1 and exradii rA , rB , and rC such that
2 2 2 2 2 2
 2
20 rB rC + rC rA + rA rB = 19 (rA rB rC ) .

If
A B C
tan+ tan + tan = 2.019,
2 2 2
m
then the area of 4ABC can be expressed as n for relatively prime positive integers m and n. Compute
100m + n.
Proposed by Tristan Shin.
Answer. 201925 .

Solution. Let r be the inradius of ABC. Then


X r2 X  s − a 2
2 =
rA s
,

where s is the semiperimeter of ABC. Let A1 , A2 be on AB and AC, respectively, such that A1 A2
2
is parallel to BC and 4AA1 A2 has area equal to s−a s of that of 4ABC. Similarly define B1 , B2
on BC and BA, C1 , C2 on CA and CB, with B1 B2 k CA, C1 C2 k AB, and 4BB1 B2 having area
2 2
equal to s−b s of 4ABC and 4CC1 C2 having area equal to s−c s of 4ABC. Then AA1 = c(s−a)
s ,
c(s−b) c(s−c) a(s−a) b(s−b)
BB2 = s , so A1 B2 = s . Similarly, B1 C2 = s and C1 A2 = s . But note that
c(s−c) a(s−a) b(s−b)
C1 C2 = s , A1 A2 = s , and B1 B2 = s , so the semiperimeter of hexagon A1 A2 C1 C2 B1 B2
P s−a P
a· s = a· rrA = r
P a P s−c s−b
+ rA = r cot π2 − B2 +cot π2 − C2 = r tan B2 +
P   P
is S = r A
=r r A
tan C2 = 2r tan A2 .
P

Let ω be the incircle of 4ABC. Consider the A-exradius of 4AA1 A2 . It is s−a r


s · rA = rA · rA = r,
so the A-excircle of 4AA1 A2 is a circle tangent to AB and AC with radius r, so it is ω. Thus,
segment A1 A2 is tangent to ω. Similarly, segments B1 B2 and C1 C2 are also tangent to ω. Because of
c(s−a)
s < s − a and similar inequalities, it is clear that segments A1 B2 , B1 C2 , and C1 A2 are all tangent
to ω. Thus, hexagon A1 A2 C1 C2 B1 B2 has an incircle, namely ω. Thus, its area is its inradius times its
semiperimeter, or
X A
2r2 tan .
2
However, we can also calculate its area by taking the area of 4ABC and subtracting off the area of
each of 4AA1 A2 , 4BB1 B2 , and 4CC1 C2 . Let K denote the area of 4ABC. Then this is
!
X  s − a 2
K 1− .
s

Putting these results together, we get that

2r2 tan A2
P
4.038 2019
K= P s−a 2 = 19 = 25 ,
1− 1 − 20
s

8
OMO Fall 2019
Official Solutions

so m = 2019 and n = 25, and 100m + n = 201925.


1− 19
Remark: Here is a sketch of another solution. Note that 220 = (s−a)(s−b)+(s−a)(s−c)+(s−b)(s−c)
s2 and
1
2.019 = s−a 1
+ s−b 1
+ s−c = (s−a)(s−b)+(s−a)(s−c)+(s−b)(s−c)
(s−a)(s−b)(s−c) = (s−a)(s−b)+(s−a)(s−c)+(s−b)(s−c)
s . Then
(s−a)(s−b)+(s−a)(s−c)+(s−b)(s−c) 2019
2019
s= s
(s−a)(s−b)+(s−a)(s−c)+(s−b)(s−c) = 1000
1 = 25 . Then [ABC] = rs = s, so the answer is 201925 .
s2 40

17. For an ordered pair (m, n) of distinct positive integers, suppose, for some nonempty subset S of R, that
a function f : S → S satisfies the property that f m (x) + f n (y) = x + y for all x, y ∈ S. (Here f k (z)
means the result when f is applied k times to z; for example, f 1 (z) = f (z) and f 3 (z) = f (f (f (z))).)
Then f is called (m, n)-splendid. Furthermore, f is called (m, n)-primitive if f is (m, n)-splendid and
there do not exist positive integers a ≤ m and b ≤ n with (a, b) 6= (m, n) and a 6= b such that f
is also (a, b)-splendid. Compute the number of ordered pairs (m, n) of distinct positive integers less
than 10000 such that there exists a nonempty subset S of R such that there exists an (m, n)-primitive
function f : S → S.
Proposed by Vincent Huang.
Answer. 9998 .

Solution. Note that the given equation rewrites as f m (x) − x = y − f n (y) − y. Fixing y and varying x
yields f m (x)−x = c for a constant c, and fixing x while varying y yields f n (y)−y = −c for a constant c.
Combining these equations yields f m+n (x) = x for all x. But now note 0 = f m(m+n) (x)−x = c(m+n),
hence c = 0, so f m (x) = f n (x) = x. Thus f gcd(m,n) (x) = x as well, so for f to be primitive it follows
that {m, n} = {gcd(m, n), 2 gcd(m, n)}, from which we get (m, n) = (d, 2d), (2d, d), and now the answer
is obviously 9998 .

18. Define a modern artwork to be a nonempty finite set of rectangles in the Cartesian coordinate plane
with positive areas, pairwise disjoint interiors, and sides parallel to the coordinate axes. For a modern
artwork S, define its price to be the minimum number of colors with which Sean could paint the
interiors of rectangles in S such that every rectangle’s interior is painted in exactly one color and every
two distinct touching rectangles have distinct colors, where two rectangles are touching if they share
infinitely many points. For a positive integer n, let g(n) denote the maximum price of any modern
artwork with exactly n rectangles. Compute g(1) + g(2) + · · · + g(2019).
Proposed by Yang Liu and Edward Wan.
Answer. 8068 .

Solution. Define g 0 (n) as g 0 (1) = 1, g 0 (2) = 2, g 0 (3) = 3, g 0 (4) = 3, g 0 (5) = 3, and g 0 (n) = 4 for all
positive integers n ≥ 6. We claim g(n) = g 0 (n) for all positive integers n.
We first show g(n) ≥ g 0 (n) for all positive integers n.
The diagrams below are examples that can be used to prove that g(1) ≥ 1, g(2) ≥ 2, g(3) ≥ 3, and
g(6) ≥ 4. (The details are left as an exercise to the reader.)

9
OMO Fall 2019
Official Solutions

Also, it can be seen that g(n + 1) ≥ g(n) for all positive integers n (simply add a rectangle to an
n-rectangle example that required g(n) colors).
Combining these facts yields that g(n) ≥ g 0 (n) for all positive integers n.
We now show g(n) ≤ g 0 (n) for all positive integers n.
It is obvious that g(i) ≤ i for i = 1, 2, 3.
The following lemma is useful.
Lemma. There cannot be four rectangles in any modern artwork so that each pair of them touch each
other.
Proof. Let R1 , R2 , R3 , and R4 be four arbitrary rectangles in a modern artwork. Assume, for contra-
diction, that each pair of them is touching. If all three of R2 , R3 , R4 touch the same edge of R1 , it’s
clear that some two of them do not touch, contradiction. If two of R2 , R3 , R4 touch opposite edges of
R1 , it’s clear that they do not touch, contradiction. Hence, by symmetry, it suffices only to analyze
the case where R2 , R3 touch the topmost edge of R1 and R4 touches the rightmost edge of R1 . WLOG
assume that the center of R2 is to the left of the center of R3 . Then it’s clear that R2 does not touch
R4 , contradiction. We’ve obtained a contradiction in all cases, and so hence the lemma is proven. 
By the Lemma, we know that g(4) ≤ 3, because in any modern artwork of four rectangles, we can
simply color a non-touching pair of rectangles red, and the other two rectangles blue and green.
We will now use the Lemma to show that g(5) ≤ 3. Because of the Lemma, it is sufficient to show that
any subgraph of a K5 which doesn’t contain a K4 is 3-colorable; we shall show this. To do so, let’s
consider the complement of the graph. If there are two disjoint edges ab, cd in the complement graph,
then in the original graph we can color a, b red, c, d green, and the other vertex blue. Otherwise, any
two edges share a common vertex, so either they form a triangle or all of them share a vertex. In the
former case, color the three vertices of the triangle all red and the other two vertices blue and green.
The latter case actually never occurs, because then the original graph has a K4 . As a result of the
previous discussion, we’ve shown that g(5) ≤ 3.
Notice that g(n) ≤ 4 for all positive integers n, by the Four Color Theorem.
Thus we have that g(n) ≤ g 0 (n) for all positive integers n.
Thus g(n) = g 0 (n) for all positive integers n.
Summing from 1 to 2019 gives us a final answer of 1 + 2 + 3 + 3 + 3 + 4 · 2014 = 8068.

19. Let ABC be an acute triangle with circumcenter O and orthocenter H. Let E be the intersection of
BH and AC and let M and N be the midpoints of HB and HO, respectively. Let I be the incenter
of AEM and J be the intersection of M E and AI. If AO = 20, AN = 17, and ∠AN M = 90◦ , then
AI m
AJ = n for relatively prime positive integers m and n. Compute 100m + n.
Proposed by Tristan Shin.
Answer. 1727 .

π
Solution. Since ∠AEB = 2, we have that AEN M is cyclic.
Let ω be the nine point circle of ABC. Note that N is the center of ω and M and E are on ω. Now, the
radius of ω is R2 , where R is the circumradius of ABC. Now, note that, considering concyclic points
A, E, N, M , we have M N = N E = R2 = 10 and AN = 17; then AN > M N = N E, so it can be shown
that this yields that A lies on arc M E not containing N on (AEN M ). Then, applying Ptolemy’s
Theorem to cyclic quadrilateral AEN M , 17EM = AN · EM = AE · N M + AM · N E = 10(AE + AM ).

10
OMO Fall 2019
Official Solutions

AM ·M E
By the angle bisector theorem on AM E, M J
JE =
MA
AE , so M J = AM +AE . By the angle bisector theorem
on M AJ, AI AM
IJ = M J =
AM +AE
ME = 17
10 . Thus,

AI AM + AE 17
= = ,
AJ AM + AE + M E 27
so 100m + n = 1727.

20. Define a crossword puzzle to be a 15 × 15 grid of squares, each of which is either black or white. In
a crossword puzzle, define a word to be a sequence of one or more consecutive white squares in a row
or column such that the squares immediately before and after the sequence both are either black or
nonexistent. (The latter case would occur if an end of a word coincides with an end of a row or column
of the grid.) A crossword puzzle is tasty if every word consists of an even number of white squares.
Compute the sum of all nonnegative integers n such that there exists a tasty crossword puzzle with
exactly n white squares.
Proposed by Luke Robitaille.
Answer. 4900 .

Solution. I claim the possible values of n are 0, 4, 8, . . . , 196.


Note that if we ignore the rightmost column and the bottom row of the grid, then the rest of the grid
can be partitioned into forty-nine 2 × 2 squares. For any k = 0, 1, . . . , 49, choose any k of those 2 × 2
squares, and color all the cells in those squares white, and color the cells in the other 49 − k of those
squares, as well as the cells in the rightmost column and the bottom row of the grid, black. The result
is a crossword puzzle with exactly 4k white cells. It is not hard to see that this crossword puzzle is
tasty. Thus 4k is a possible value of n, so 0, 4, 8, . . . , 196 all are possible values of n.
Now the other direction: suppose there is a tasty crossword puzzle with exactly n white squares. Label
the rows 1 to 15 in order from top to bottom; label the columns 1 to 15 in order from left to right.
Place the letter a in every square at the intersection of an odd-numbered row and an odd-numbered
column; place the letter b in every square at the intersection of an odd-numbered row and an even-
numbered column; place the letter c in every square at the intersection of an even-numbered row and
an odd-numbered column; place the letter d in every square at the intersection of an even-numbered
row and an even-numbered column. Let A be the number of white squares that contain the letter a;
define B, C, and D analogously. Consider all horizontal words (words that are a subset of some row)
in the grid; every such word consists of an even number of white squares (since the crossword puzzle
is tasty), and every white square in the grid is in exactly one such word. Considering such words in
odd-numbered rows, we get A = B. A similar consideration of even-numbered rows yields that C = D.
Similar consideration of vertical words yields that A = C and B = D. Thus A = B = C = D. Then
n = A + B + C + D = 4D. Now D is a nonnegative integer; furthermore, D is at most the total number
of cells containing d’s in the grid, which is 49. Thus n is among 0, 4, 8, . . . , 196, as desired.
Thus the possible values of n are 0, 4, 8, . . . , 196, as claimed. Thus the answer is 0 + 4 + 8 + · · · + 196 =
4(1 + 2 + · · · + 49) = 4 · 49·50
2 = 4900 .

21. Let p and q be prime numbers such that (p − 1)q−1 − 1 is a positive integer that divides (2q)2p − 1.
Compute the sum of all possible values of pq.
Proposed by Ankit Bisain.
Answer. 85 .

Solution. First, note that p > 2 is obvious.


We claim q | p − 1. If it doesn’t, q | (p − 1)q−1 − 1 by Fermat’s Little Theorem, so q | (2q)2p − 1,
meaning q | −1, contradiction. Now, we take cases on q.

11
OMO Fall 2019
Official Solutions

Case 1: q = 2 The condition becomes p − 2 | 42p − 1 = 16p − 1. Note that 15|16p − 1. For any prime k
dividing p − 2 (which is odd since p > 2 is prime), k | 16p − 1, but since the order of 16 (mod k) divides
p
k − 1 and k − 1 ≤ p − 3 < p, the order must be 1, so k | 15. If k divides 1615−1 = 16p−1 + · · · + 16 + 1,
then 0 ≡ 16p−1 + · · · + 16 + 1 ≡ 1 + · · · + 1 + 1 = p ≡ 2(mod k) (as 16 ≡ 1(mod k) and p ≡ 2(mod k)),
p p p
contradicting k > 2. Thus, k - 1615−1 . Then gcd(p − 2, 1615−1 = 1, so since p − 2|16p − 1 = 1615−1 · 15,
we have, p − 2 | 15, so p ∈ {3, 5, 7, 17}. All these can be seen to work.
Case 2: q > 2 Since q − 1 is even, we get p | (p − 1)q−1 − 1, so p | (2q − 1)(2q + 1). Since q | p − 1,
p > q + 1, so 2p > 2q + 2 > 2q + 1 > 2q − 1, and p | 2q − 1 or p | 2q + 1, so p ∈ {2q − 1, 2q + 1}. Since
q > 2 and q | p − 1, this forces p = 2q + 1. Then, the condition becomes

(2q)q−1 − 1 | (2q)2p − 1 ⇒ q − 1 | 2p ⇒ q − 1 | 2(2q + 1) = 4(q − 1) + 6,

so q −1 | 6, so q ∈ {3, 7}. Since p = 2q +1 is also prime, the only solution from this case is (p, q) = (7, 3).
This can be seen to work.
For the answer extraction, the sum of possible values of pq is 2 · 3 + 2 · 5 + 2 · 7 + 2 · 17 + 3 · 7 = 85 .

22. For finite sets A and B, call a function f : A → B an antibijection if there does not exist a set S ⊆ A∩B
such that S has at least two elements and, for all s ∈ S, there exists exactly one element s0 of S such that
f (s0 ) = s. Let N be the number of antibijections from {1, 2, 3, . . . 2018} to {1, 2, 3, . . . 2019}. Suppose
N is written as the product of a collection of (not necessarily distinct) prime numbers. Compute the
sum of the members of this collection. (For example, if it were true that N = 12 = 2 × 2 × 3, then the
answer would be 2 + 2 + 3 = 7.)
Proposed by Ankit Bisain.

Answer. 1363001 .

Solution. Note that for all x, if x, f (x), f 2 (x), . . . eventually cycles with period > 1, then taking S to
be the numbers in this cycle gives a contradiction. However, since {1, 2, . . . 2018} and {1, 2, . . . 2019}
are finite, that sequence must eventually cycle or terminate at 2019. Thus, that sequence eventually is
constant or terminates.
Now, let g(x) be the constant value that x, f (x), f 2 (x), . . . eventually becomes (let g(x) = 2019 if
that sequence ever reaches 2019, when it would terminate). Denote X = {g(1), g(2), . . . g(2018)}.
If |X ∩ {1, 2, 3, . . . 2018}| ≥ 2, then taking S = |X ∩ {1, 2, 3, . . . 2018}| gives a contradiction. Thus,
|X ∩ {1, 2, 3, . . . 2018}| ∈ {0, 1}. Also, X is nonempty.
Draw a directed graph with vertices labelled 1, 2, . . . 2019, such that there is an edge from x to f (x)
for all x ∈ {1, 2, 3, . . . 2018}.
Case 1: X = {2019}. In this case, if the directions of the graph are removed, there is a path from x to
2019 for all x ∈ {1, 2, 3, . . . 2019}, and there are no cycles, so the graph must be a tree. Also, every tree
can be converted to an antibijection by directing each edge ’towards’ (on the unique path to) 2019. By
Cayley’s formula, this gives 20192017 functions.
Case 2: X = {c} or {c, 2019} for some c ∈ {1, 2, . . . 2018}. We claim that this can be bijected to the set
of ordered pairs (tree on vertices {1, 2, . . . , 2019}, choice of neighbor of 2019). We can create a function
from each of these by drawing the tree, deleting the edge between 2019 and c, and creating functions
from the two resulting trees as done in Case 1 (taking c as the ’final value’ of the tree with c in it).
Similarly, we can create the trees from a function by drawing the graph then connecting c to 2019, so
this is a bijection. To count these, note that each tree generates deg(2019) functions. Counting this
over all labellings of a fixed tree shows that this is 2·2018 2019 on average (there are 2018 edges, each is
counted twice), giving 2·2018
2019 · 2019
2017
= 2 · 2018 · 20192016 functions by Cayley’s.
Thus N = 20192017 + 2 · 2018 · 20192016 = 32016 · 6732016 · 5 · 7 · 173, giving an answer of 2016 · 3 + 2016 ·
673 + 5 + 7 + 173 = 1363001 .

12
OMO Fall 2019
Official Solutions

23. Let v and w be real numbers such that, for all real numbers a and b, the inequality

(2a+b + 8)(3a + 3b ) ≤ v(12a−1 + 12b−1 − 2a+b−1 ) + w

holds. Compute the smallest possible value of 128v 2 + w2 .


Proposed by Luke Robitaille.

Answer. 62208 .

4322 (16v+w)2 √
Solution. Taking a = b = 2 gives 432 ≤ 16v + w, so 62208 = 3 ≤ √
( 2)2 +12
≤ (8 2v)2 + w2 =
128v 2 + w2 by Cauchy-Schwarz.
We claim that 62208 can be achieved. We claim that a construction is v = 18 and w = 144. Note
that 128 · 182 + 1442 = 62208. We now show that this works. The reason this works is because
(2a+b + 8)(3a + 3b ) ≤ 18(12a−1 + 12b−1 − 2a+b−1 ) + 144 is equivalent, after some algebra, to (2a+b+1 +
16)(3a + 3b + 9) ≤ 3(12a + 12b + 144). Now 2a+b+1 ≤ 4a + 4b by AM-GM, so it suffices to prove
(4a + 4b + 42 )(3a + 3b + 32 ) ≤ 3(12a + 12b + 122 ), which is true by Chebyshev’s Inequality.
Thus we are done; the answer is 62208 .

24. Let ABC be an acute scalene triangle with orthocenter H and circumcenter O. Let the line through
A tangent to the circumcircle of triangle AHO intersect the circumcircle of triangle ABC at A and
P 6= A. Let the circumcircles of triangles AOP and BHP intersect at P and Q 6= P . Let √ line P√Q
intersect segment BO at X. Suppose that BX = 2, OX = 1, and BC = 5. Then AB ·AC = k +m n
for positive integers k, m, and n, where neither k nor n is divisible by the square of any integer greater
than 1. Compute 100k + 10m + n.
Proposed by Luke Robitaille.
Answer. 29941 .

Solution. Denote by ] directed angles modulo π. Lemma 1: H, Q, O, X are concyclic. Proof:


]HQX = ]HQP = ]HBP = ]BHP + ]HP B = ]BHA + ]AHP + ]HP A + ]AP B = ]HAP +
]BHA + ]AP B = ]HAP + ]BHA + ]ACB = ]HAP + 2]ACB = ]HAP + ]AOB = ]HOA +
]AOB = ]HOB = ]HOX, so H, Q, O, X are concyclic, as desired.
Lemma 2: A, H, X are collinear. Proof: ]XHO = ]XQO = ]P QO = ]P AO = ]AHO, so A, H, X
are collinear, as desired.
The rest is easy. Let AH ∩BC = F and let M be the midpoint of BC. Then BM = 25 . Furthermore, F
lies on segment BM with FBF BX
M = XO = 2. Thus F M =q
5
6 . Now let Y be the foot of the perpendicular
√ √ √
from O to AF . Then Y F = OM = BO2 − BM 2 = 32 − ( 52 )2 = 211 and AY = AO2 − OY 2 =
√ q √ √ √
AO2 − F M 2 = 32 − ( 56 )2 = 299
6 ; then AF = AY + Y F =
299+3 11
6 . Now let A0 be the
0 0
reflection of A over O. √Then AA √ = 6. Also, triangle ABF is similar to triangle AA C. Thus,
0
AB · AC = AF · AA = 299 + 3 11. Thus the answer is 29900 + 30 + 11 = 29941 .

25. The sequence f0 , f1 , . . . of polynomials in F11 [x] is defined by f0 (x) = x and fn+1 (x) = fn (x)11 − fn (x)
for all n ≥ 0. Compute the remainder when the number of nonconstant monic irreducible divisors of
f1000 (x) is divided by 1000.
Proposed by Ankan Bhattacharya.
Answer. 301 .

Solution. Throughout this solution, “irreducible” will always refer to non-unit polynomials.

13
OMO Fall 2019
Official Solutions

Pn n−k
k n

It’s not hard to show that fn (x) = k=0 (−1) k x11 for all n ≥ 0. In particular, f11n (x) =
11n
11
x − x for all x, and so
112 113
x11 − x = f121 | f1000 | f1331 = x11 − x.
n
It is well-known that the monic irreducible factors of x11 − x are exactly the monic irreducible poly-
n
nomials of degree dividing n, each appearing exactly once in a factorization of x11 − x into monic
irreducible factors. Thus, all monic irreducible divisors of f1000 /f121 are of degree 113 . It follows from
this and analogous arguments regarding f121 , f11 , f1 that the number of monic irreducible factors of
f1000 equals

1111 − 111 11121 − 1111 111000 − 11121


111 + + +
111 112 113
997 118 9
= 11 + 10 · 11 + 10 · 11 + 10
≡ 301 (mod 1000).

26. Let p = 491 be prime. Let S be the set of ordered k-tuples of nonnegative integers that are less than p.
We say that a function f : S → S is k-murine if, for all u, v ∈ S, hf (u), f (v)i ≡ hu, vi (mod p), where
h(a1 , . . . , ak ), (b1 , . . . , bk )i = a1 b1 + · · · + ak bk for any (a1 , . . . ak ), (b1 , . . . bk ) ∈ S.
Let m(k) be the number of k-murine functions. Compute the remainder when m(1) + m(2) + m(3) +
· · · + m(p) is divided by 488.
Proposed by Brandon Wang.
Answer. 18 .

Solution. Let ~e1 , . . . , ~ek be the standard basis. We see that f (~e1 ) = ~u1 , . . . , f (~ek ) = ~uk are an
orthonormal basis. Furthermore, for all ~v , i,

hf (~v ), ~ui i = h~v , ~ei i,


P P
so if ~v = ai~ei , f (~v ) = ai ~ui , thus f is the linear map taking ~ei to ~ui for all i. Thus, m(k) counts
the number of orthonormal bases (~u1 , . . . , ~uk ).
First, we need a lemma: Let ~v1 , . . . , ~v` be orthonormal. Then, we can extend this to an orthonormal
basis ~v1 , . . . , ~vk .
Proof: Let V = (Fp )k and let W = span(~v1 , . . . , ~v` ). Let U = W ⊥ be the orthogonal complement of
W . We will show that there exists ~u ∈ U , with k~uk2 = 1.
Let t = k − ` = dim U . If t = 1, then let U = span(~u). Say M is the matrix with columns
2
~v1 , . . . , ~vk−1 , ~u, then M T M is a diagonal matrix with diagonal entries 1, 1, . . . , 1, k~uk2 , so det~uM = 1
and so ~vk = det~uM works.
Else, first take an orthogonal basis of U as follows: Take ~u1 with ||~u1 ||2 6= 0, and replace U with
U ∩ span(~u1 )⊥ , and repeat on the new U to get ~u2 , . . . , ut . Note in general that after we have generated
~u1 , . . . , ~us , then U ⊥ is currently span(~v1 , . . . , ~v` , ~u1 , . . . , ~us ). Clearly the span is contained in U ⊥ . To
show that U ⊥ does not intersect U , note that if ~x ∈ U ⊥ ∩ U , then h~x, ~v i = 0 for all ~v ∈ V , thus forcing
~x = 0.
Now, we claim that U must contain an element with nonzero norm. Otherwise, for all ~u, ~u0 ∈ U ,

h~u + ~u0 , ~u + ~u0 i − h~u, ~ui − h~u0 , ~u0 i


h~u, ~u0 i = = 0,
2
so U ∈ U ⊥ , contradiction.

14
OMO Fall 2019
Official Solutions

Thus we can find an orthonormal basis. Now suppose k~u1 k2 = a1 , k~u2 k2 = a2 . Suppose that a1 , a2 are
not quadratic residues (else we can normalize one of the vectors and decrease t).
Note that kc~u1 + d~u2 k2 = c2 a1 + d2 a2 . Note that as c2 varies, c2 a1 varies over all p+1
2 nonquadratic
residues and 0. Similarly so varies d2 . So, by Cauchy-Davenport, there exists c, d so that c2 a1 +d2 a2 = 1,
and setting ~u = c~u1 + d~u2 decreases t.
Thus we can always add a vector to our orthonormal set and so we can eventually get a basis. 
Now, let χ(k) denote the number of vectors ~v in (Fp )k with k~v k2 = 1. We claim that m(k) =
χ(1) · · · χ(k). Indeed, we claim that if we pick ~uk , . . . , ~u1 in that order, then there are χ(i) choices for
ui . For i = k this is clear. For i < k, suppose we have picked ~uk , . . . , ~ui+1 . Then, extend this to an
orthonormal basis ~uk , . . . , ~ui+1 , ~vi , . . . , ~v1 .
Let T be the transformation taking vj to ej for j ≤ i and uj to ej otherwise. Since T and T −1 both
preserve dot product, it is clear that picking ui is equivalent to picking ei so that kei k2 = 1 and ei
orthogonal to ei+1 , . . . , en , so we clearly have χ(i) choices for ui .
Thus it suffices to compute χ(k) for all k. Note that k! | χ(k), so it suffices to compute χ(k) for k ≤ 60.
Let Ak be the number of vectors ~v so that k~v k2 = 0, Bk = χ(k), and Ck the number so that k~v k2 = r,
where r is a fixed nonresidue. We see that
p−1 p−1
Ak + Bk + Ck = pk .
2 2
p−1 p−1
Let Dk = 2 Bk and Ek = 2 Ck .
Next, note that if a21 + · · ·
+ a2k+1 ≡
0, then either ak+1 = 0, or a21 + · · · + a2k is a nonresidue with two
choices for ak+1 since p ≡ 3 (mod 4), so

Ak+1 = Ak + 2Ek .

Next, we compute Dk+1 . If a21 + · · · + a2k = 0, then there are p − 1 choices for ak+1 . Now we do
casework on q = a21 + · · · + a2k . We compute the number of a so that q + a2 is a square, or q + a2 = b2
or q = (b − a)(b + a). So, if b + a = s, b − a = qs , a = s − qs . Under s → − qs , a is fixed.
Thus, if q is a square, then we have p−12 solutions for a. Similarly, if q is a nonsquare, we have two
fixed points. At these fixed points, we see that s + qs = 0, so b = 0. Thus we only want non-fixed point
a’s, and since there are two s’s that are fixed, there are p − 3 non-fixed s’s, so we have that there are
p−3
2 solutions to a where b 6= 0. Note that if q is a square, then b is never zero.
So, Dk+1 = (p − 1)Ak + p−1
2 Dk +
p−3
2 Ek , and since Ak+1 + Dk+1 + Ek+1 = p(Ak + Dk + Ek ), we have
p+1 p−1
Ek+1 = 2 Dk + 2 Ek .
Scaling back, we have

Ak+1 = Ak + (p − 1)Ck ,
p−1 p−3
Bk+1 = 2Ak + Bk + Ck ,
2 2
p+1 p−1
Ck+1 = Bk + Ck .
2 2

Taking p − 3 and recalling that Bk , Ck are both even, we get

Ak+1 = Ak + 2Ck , Bk+1 = 2Ak + Bk , Ck+1 = 2Bk + Ck .

k k k
P 3m   
23m+1 23m+2
P P
Solving the recursion, we see that Ak = 2 3m , Bk = 3m+1 , Ck = 3m+2 . In
particular, after a roots of unity filter, we get

3Bk = 3k + (1 + 2ω)k · ω 2 + (1 − 2ω 2 )k · ω.
√ √
Here, note that 1 + 2ω = −i 3. So, 3Bk = 3k + (i 3)k (ω 2 + (−1)k · ω).

15
OMO Fall 2019
Official Solutions

Now we see that  4t



3 + 32t k = 4t + 1
34t+1 + 32t

k = 4t + 2
Bk = .


 34t+2 − 32t+1 k = 4t + 3
 4t+3
3 − 32t+1 k = 4t + 4

Modulo 8, we have B1 = 2, B2 = 4, so the sum is 2. Modulo 61, we have B1 = 2, B2 = 4, B3 = 6, B4 =


24, B5 = 29, B6 = 8, B7 = 31, B8 = 25, B9 = 54, and B10 = 0, so we see that the sum is 18 (mod 61)
and is thus 18 (mod 488).
Remark: This problem asks to count the size of the orthogonal group: https://en.wikipedia.org/
wiki/Orthogonal_group . A general formula is given at the linked article, which can be proven by
computing the Bi ’s explicitly.

27. A complex set, along with its complexity, is defined recursively as the following:

• The set C of complex numbers is a complex set with complexity 1.


• Given two complex sets C1 , C2 with complexity c1 , c2 respectively, the set of all functions f :
C1 → C2 is a complex set denoted [C1 , C2 ] with complexity c1 + c2 .

A complex expression, along with its evaluation and its complexity, is defined recursively as the follow-
ing:
• A single complex set C with complexity c is a complex expression with complexity c that evaluates
to itself.
• Given two complex expressions E1 , E2 with complexity e1 , e2 that evaluate to C1 and C2 re-
spectively, if C1 = [C2 , C] for some complex set C, then (E1 , E2 ) is a complex expression with
complexity e1 + e2 that evaluates to C.
For a positive integer n, let an be the number of complex expressions with complexity n that evaluate
to C. Let x be a positive real number. Suppose that
7
a1 + a2 x + a3 x2 + · · · = .
4

Then x = k nm , where k,m, and n are positive integers such that m is not divisible by the square of
any integer greater than 1, and k and n are relatively prime. Compute 100k + 10m + n.
Proposed by Luke Robitaille and Yannick Yao.
Answer. 1359 .

Solution. Lemma 1. If a complex expression E has complexity e and evaluates to a complex set C
that has complexity c, then e ≥ c and e ≡ c(mod 2); furthermore, if e = c, then E = C.
Proof. This is not hard and is left to the reader as an exercise. 
(2k
k)
Let Ck = k+1 be the kth Catalan number for k ≥ 0.
Lemma 2. For all positive integers i, there are exactly Ci−1 complex sets of complexity i.
Pn
Proof. This follows inductively without difficulty from the well-known fact that k=0 Ck Cn−k = Cn+1
for all nonnegative integers n. 
Now define
P a function f from nonnegative integers to integers recursively by f (0) = 1 and, for x > 0,
f (x) = Ca f (b)f (c), where the sum is over all ordered triples (a, b, c) of nonnegative integers such
that a + b + c = x − 1.
Lemma 3. For any nonnegative integer n, the following is true: for any positive integer k and for any
complex set C of complexity k, the number of complex expressions of complexity k + 2n that evaluate
to C is f (n).

16
OMO Fall 2019
Official Solutions

Proof. Proceed by strong induction on n.


For n = 0, any complex expression of complexity k that evaluates to C must be C by Lemma 1; also,
C is such a complex expression. Thus, there is exactly 1 = f (0) such complex expression, as desired.
For n > 0, any complex expression E of complexity k + 2n that evaluates to C is such that E 6= C
(since the complexity of the complex expression C is k, and k 6= k + 2n as n > 0), so E = (E1 , E2 )
for some complex expressions E1 and E2 such that, for some complex set C 0 , E1 evaluates to [C 0 , C],
and E2 evaluates to C 0 . (Note that C 0 , as the evaluation of E2 , is uniquely determined by E.) The
complexity of C 0 is a + 1 for some nonnegative integer a. Then the complexity of [C 0 , C] is a + 1 + k.
Then, by Lemma 1, the complexity of E1 is a+1+k +2b and the complexity of E2 is a+1+2c for some
nonnegative integers b and c. Then the complexity of E is (a+1+k+2b)+(a+1+2c) = k+2(a+b+c+1);
then k + 2(a + b + c + 1) = k + 2n, so a + b + c = n − 1. Now a,b, and c are nonnegative integers, and
b, c < n. (Note that a, b, c are uniquely determined by E.)
Now, for any ordered triple (a, b, c) of nonnegative integers such that a + b + c = n − 1, there are Ca
complex sets C 0 of complexity a + 1. Then once C 0 is chosen, as b, c < n, by the strong inductive
hypothesis there are f (b) complex expressions E1 of complexity a + 1 + k + 2b that evaluate to [C 0 , C],
and there are f (c) complex expressions E2 of complexity a + 1 + 2c that evaluate to C 0 . This yields
Ca f (b)f (c) complex expressions E = [E1 , E2 ] of complexity k + 2n that evaluate to C, for this case of
what (a, b, c) is.
P
Now if we sum over all cases to get Ca f (b)f (c) complex expressions (where the sum is over all
ordered triples (a, b, c) of nonnegative integers such that a + b + c = n − 1), then we count only complex
expressions of complexity k +2n that evaluate to C, we count all such complex expressions, and (by the
parenthetical notes above that note that C 0 , a, b, c are uniquely determined
P by E) we don’t count any
such complex expression more than once. Thus there are exactly Ca f (b)f (c) complex expressions of
complexity k + 2n that evaluate to C (where the sum is over all ordered triples (a, b, c) of nonnegative
integers such that a + b + c = n − 1); by the definition of f , there are thus exactly f (n) complex
expressions of complexity k + 2n that evaluate to C, as desired.
Thus Lemma 3 is true. 
Now, for all positive integers i, ai = 0 if i is even and ai = f ( i−1 2
2 ) if i is odd. Let y = x ; then y > 0
2 7
and f (0) + f (1)y + f (2)y + · · · = 4 . Now the sequence f (0), f (1), f (2), . . . is sequence A127632 in the
OEIS, so by a result listed at https://oeis.org/A127632 we know that f (0) + f√(1)y + f (2)y 2 + · · · =
√ √
√ √2 . Thus √ √2 = 47 , so y = 4442401, so x = y = 2 49111 , so the answer is
1+ 2 1−4y−1 1+ 2 1−4y−1
2 · 100 + 111 · 10 + 49 = 1359 .
Remark: Of course, contestants would not be allowed to use the OEIS during the contest. Here is
a (somewhat non-rigorous) way they could nevertheless arrive at the correct value of y. Let F =
f (0) + f (1)y + f (2)y 2 · · · = 74 and let C = C0 + C1 y + C2 y 2 + . . . . (Assume that the series for C
converges. This is not rigorous.) The recursion for f yields that 1+yCF 2 = F . (This equation is noted
on the OEIS page linked above.) Thus yC = FF−1 2
12
= 49 . The well-known recursion for the Catalan
numbers yields the well-known (found on Wikipedia, among other places) equation 1 + yC 2 = C. Then
y = yC − (yC)2 = 12 12 2 444
49 − ( 49 ) = 2401 , so we may finish as before.

28. Let S be the set of integers modulo 2020. Suppose that a1 , a2 , ..., a2020 , b1 , b2 , ..., b2020 , c are arbitrary
elements of S. For any x1 , x2 , ..., x2020 ∈ S, define f (x1 , x2 , ..., x2020 ) to be the 2020-tuple whose ith
coordinate is xi−2 + ai x2019 + bi x2020 + cxi , where we set x−1 = x0 = 0. Let m be the smallest positive
integer such that, for some values of a1 , a2 , ..., a2020 , b1 , b2 , ..., b2020 , c, we have, for all x1 , x2 , ..., x2020 ∈
S, that f m (x1 , x2 , ..., x2020 ) = (0, 0, ..., 0) . For this value of m, there are exactly n choices of the
tuple (a1 , a2 , ..., a2020 , b1 , b2 , ..., b2020 , c) such that, for all x1 , x2 , ..., x2020 ∈ S, f m (x1 , x2 , ..., x2020 ) =
(0, 0, ..., 0). Compute 100m + n.
Proposed by Vincent Huang.
Answer. 103020 .

17
OMO Fall 2019
Official Solutions
 
  0 0 ... 0 a1 b1
x1 0 0
 ... 0 a2 b2 

 x2  1 0 ... 0 a3 b3 
Solution. Clearly f is equivalent to multiplying the matrix  .  by M +cI, where M = 0 1 .
   
 ..   ... 0 a4 b4 
 .. .. .. .. .. .. 
x2020 . . . . . . 
0 0 ... 1 a2020 b2020
Note that if solutions exist for some m, then the minimal polynomial of M must have degree at most
m.
The main observation is that, for 1 ≤ i ≤ 1009, the matrix M i has its first 2018 columns equal to the
last 2018 columns of M i−1 . This is easy to see. Now it follows that M 0 , M 1 , . . . , M 1009 are linearly
independent, because the first column of each such M i consists of all 0s and a single 1 in the 2i + 1th
position, so no linear combination of them can sumt o zero. From this it follows that m ≥ 1010.
Next we’ll show that solutions exist for m = 1010 and find all of them. First we’ll characterize all
possible solutions. Note by the observation in the previous paragraph that for each 1 ≤ i ≤ 1009,
M i has all 0 entries in the even positions of the first column and the odd positions of the second
column. Therefore, for a linear dependence between M 0 , M 1 , . . . , M 1010 to exist, M 1010 must also
have all 0 entries in the even positions of the first column and all odd positions of the second column,
so a2 = a4 = · · · = a2020 = 0 and b1 = b3 = · · · = b2019 = 0. Similarly, each M i for 1 ≤ i ≤ 1009
has the property that the 2j + 1th position of the first column and the 2j + 2th position of the second
column are equal, so M 1010 must also have this property, meaning that a2j+1 = b2j+2 = cj for some
constants cj .
 
0 0 . . . 0 0 c0
1 0 . . . 0 0 0 
 
0 1 . . . 0 0 c1 
 
Then it’s not hard to verify that M is the square of the 2020×2020 matrix N =  0 0 . . . 0 0 0 .

 
. . .. . .
 .. .. . .. .. 
0 0 ... ... 1 0
Now since the minimal polynomial of N has degree ≤ 2020, it follows N ’s minimal polynomial has de-
gree exactly 2020 as we wanted. Furthermore, the first 2019 columns of N i are the last 2019 columns
of N i−1 , so it follows that N i ’s first column for 0 ≤ i ≤ 2019 is just all 0s along with a 1 on the
2i + 1th position, while N 2020 ’s first column alternates between the ci s and 0s. Then it’s clear that the
minimal polynomial of N must be N 2020 − c1009 N 2018 − · · · − c0 , so the minimal polynomial of M is
M 1010 −c1009 M 1009 −· · ·−c0 . Since we want M ’s minimal polynomial to be (M +c)1010 for some residue
c modulo 2020, for each c we just expand (M +c)1010 and set the ci to be the appropriate values, and we
are done; clearly this shows m = 1010 and n = 2020, so the answer is 100 · 1010 + 2020 = 103020 .

29. Let ABC be a triangle. The line through A tangent to the circumcircle of ABC intersects line BC at
point W . Points X, Y 6= A lie on lines AC and AB, respectively, such that W A = W X = W Y . Point
X1 lies on line AB such that ∠AXX1 = 90◦ , and point X2 lies on line AC such that ∠AX1 X2 = 90◦ .
Point Y1 lies on line AC such that ∠AY Y1 = 90◦ , and point Y2 lies on line AB such that ∠AY1 Y2 = 90◦ .
Let lines AW and XY intersect at point Z, and let point P be the foot of the perpendicular from A
to line X2 Y2 . Let line ZP intersect line BC at U and the perpendicular bisector of segment BC at V .
Suppose that C lies between B and U . Let √x be a positive real number. Suppose that AB = x + 1,
AC = 3, AV = x, and BC CU = x. Then x =
k−m
n for positive integers k,m, and n such that k is not
divisible by the square of any integer greater than 1. Compute 100k + 10m + n.
Proposed by Ankit Bisain, Luke Robitaille, and Brandon Wang.

Answer. 264143 .

Solution. Let O be the circumcenter


√ of ABC. Key Claim: V = O and (U, AO ∩ BC; B, C) = −1.
Proof of Key Claim: Perform a bc-inversion. Denote the image of any point K by K 0 . Throughout,

18
OMO Fall 2019
Official Solutions

note that AB 6= AC and ∠BAC 6= 90◦ . Let ` be the perpendicular bisector of BC, and let m be
the line through A parallel to BC. Now W 0 = m ∩ (ABC). Then the image of (AXY ) becomes the
perpendicular bisector of AW 0 , which is `. Thus X 0 = AB ∩ ` and Y 0 = AC ∩ `. Now X10 is the foot of
the perpendicular from X 0 to AC, and X20 is the foot of the perpendicular from X10 to AB. Similarly
Y10 is the foot of the perpendicular from Y 0 to AB, and Y20 is the foot of the perpendicular from Y10 to
AC. Now Z 0 = (AX 0 Y 0 ) ∩ m. Also, note that P = (AX1 X2 ) ∩ (AY1 Y2 ). Then P 0 = X10 X20 ∩ Y10 Y20 . Let
S = AO ∩ BC, and let T be on BC such that (T, S; B, C) = −1. We want V = O and U = T ; i.e.,
we want Z, P, O, T collinear. (We have T 6= ∞ as AB 6= AC and ∠BAC 6= 90◦ , so T 0 6= A.) Thus we
need A, Z 0 , P 0 , O0 , T 0 concyclic.
Any degenerate cases that might occur are left as a tacit exercise to the reader. Let R = X 0 X10 ∩ Y 0 Y10 .
Let M be the midpoint of BC. Let R1 be the reflection of R over M . Let γ be the circle with diameter
AR1 . I claim that A, Z 0 , P 0 , O0 , T 0 all lie on γ. Obviously A lies on γ.
Note that R is the orthocenter of AX 0 Y 0 . Also, note that Z 0 is the intersection of the A-altitude and
the circumcircle of 4AX 0 Y 0 . Then R and Z 0 are reflections of one another over `; then Z 0 R1 is parallel
to `, so Z 0 R1 ⊥ BC. Also, R, A, Z 0 all lie on m. Then AZ 0 ||BC. Thus AZ 0 ⊥ Z 0 R1 , so Z 0 lies on γ.
Note that quadrilaterals CM X 0 X10 and BM Y 0 Y10 are cyclic. Then, denoting directed angles modulo
π by ], we have ]X 0 M X10 = ]X 0 CY 0 = ]Y 0 BX 0 = ]Y 0 M Y10 . Thus M, X10 , Y10 are collinear. Note
that RX10 P 0 Y10 is a parallelogram. Then the midpoints of RP 0 and RR1 both lie on line X10 Y10 . Thus
lines P 0 R1 and X10 Y10 are parallel or coincide (assuming for the moment that P 0 6= R1 ). Also, P 0 is the
orthocenter of 4AX10 Y10 , so AP 0 ⊥ X10 Y10 . Thus AP 0 ⊥ P 0 R1 , so P 0 lies on γ. (We assumed P 0 6= R1 ;
if P 0 = R1 , then P 0 lies on γ, so it was okay to assume that.)
Note that O0 is the reflection of A over BC. Let n be the reflection of m over BC. Now AO0 is
perpendicular to BC, while O0 and R1 both lie on n, which is parallel to BC. Then O0 lies on γ.
Let H be the orthocenter of ABC. Consider complete quadrilteral ABCM X 0 Y 0 . Then H, which is
the orthocenter of 4ABC, M , which is the orthocenter of 4X 0 M B, as X 0 M ⊥ BM , and R, which
is the orthocenter of 4AX 0 Y 0 , all lie on the Steiner line of this complete quadrilateral. Thus H, M, R
are collinear.
Now, in 4ABC, the A-altitude intersects (ABC) at S 0 . Now T 0 lies on (ABC) such that (T 0 , S 0 ; B, C) =
−1. Let A1 be the antipode of A on (ABC). Now S 0 6= A1 . Now S 0 A1 ⊥ AS 0 ⊥ BC, S 0 A1 ||BC, so
S 0 A1 ∩BC = ∞. Let L = T 0 A1 ∩BC. Then, projecting through A1 , −1 = (T 0 , S 0 ; B, C) = (L, ∞; B, C),
so L is the midpoint of BC. Thus L = M . Thus T 0 , A1 , M are collinear. It is well-known that M is
the midpoint of HA1 . Thus T 0 , A1 , H, M are collinear.
Now, as H 6= M , we have that T 0 , A1 , R all lie on line HM . Note that A does not lie on line HM (as
AB 6= AC and ∠BAC 6= 90◦ ), so T 0 6= A. Note that T 0 6= A1 . If T 0 = R, then T 0 lies on γ. Otherwise,
]AT 0 R = ]AT 0 A1 = 90◦ , so T 0 lies on γ. Thus, in either case, T 0 lies on γ.
Thus, A, Z 0 , P 0 , O0 , T 0 are concyclic. Thus Z, P, O, T are collinear (as none of them lie at infinity).
Thus the Key Claim is true. 
Now BU BC
CU = CU + 1 = x + 1. Then (U, S; B, C) = −1; then S lies on segment BC, as U lies on ray
BC beyond C. Then [ABO] BS BU
[ACO] = CS = CU = x + 1. Now let MB and MC be the midpoints of AC and
AB, respectively. Then [ABO] = AB·OM 2
C
and [ACO] = AC·OM 2
B
. Thus (x+1)OM
3OMB
C
= [ABO]
[ACO] = x + 1.
Thus OMC = 3OMB , so OMC = 9OMB . Now OMC = x − ( 2 ) and OMB = x2 − 49 . Thus
2 2 2 2 x+1 2 2

x2 − ( x+1 2 2 9 2 2 2
2√) = 9(x − 4 ). Thus 3x − 2x − 1 = 36x − 81, so 33x + 2x − 80 = 0. Thus, as x > 0, we
2641−1
get x = 33 , so the answer is 2641 · 100 + 1 · 10 + 33 = 264143 .

30. For a positive integer n, we say an n-transposition is a bijection σ : {1, 2, . . . , n} → {1, 2, . . . , n} such
that there exist exactly two elements i of {1, 2, . . . , n} such that σ(i) 6= i.
Fix some four pairwise distinct n-transpositions σ1 , σ2 , σ3 , σ4 . Let q be any prime, and let Fq be the
integers modulo q. Consider all functions f : (Fnq )n → Fq that satisfy, for all integers i with 1 ≤ i ≤ n
and all x1 , . . . xi−1 , xi+1 , . . . , xn , y, z ∈ Fnq ,
f (x1 , . . . , xi−1 , y, xi+1 , . . . , xn ) + f (x1 , . . . , xi−1 , z, xi+1 , . . . , xn ) = f (x1 , . . . , xi−1 , y + z, xi+1 , . . . , xn ),

19
OMO Fall 2019
Official Solutions

and that satisfy, for all x1 , . . . , xn ∈ Fnq and all σ ∈ {σ1 , σ2 , σ3 , σ4 },

f (x1 , . . . , xn ) = −f (xσ(1) , . . . , xσ(n) ).

(Note that the equalities in the previous sentence are in Fq . Note that, for any a1 , . . . , an , b1 , . . . , bn ∈
Fq , we have (a1 , . . . , an ) + (b1 , . . . , bn ) = (a1 + b1 , . . . , an + bn ), where a1 + b1 , . . . , an + bn ∈ Fq .)
For a given tuple (x1 , . . . , xn ) ∈ (Fnq )n , let g(x1 , . . . , xn ) be the number of different values of f (x1 , . . . , xn )
over all possible functions f satisfying the above conditions.
Pick (x1 , . . . , xn ) ∈ (Fnq )n uniformly at random, and let ε(q, σ1 , σ2 , σ3 , σ4 ) be the expected value of
g(x1 , . . . , xn ). Finally, let
  
ε(q, σ1 , σ2 , σ3 , σ4 ) − 1
κ(σ1 , σ2 , σ3 , σ4 ) = − lim logq − ln .
q→∞ q−1

Pick four pairwise distinct n-transpositions σ1 , σ2 , σ3 , σ4 uniformly at random from the set of all n-
transpositions. Let π(n) denote the expected value of κ(σ1 , . . . , σ4 ). Suppose that p(x) and q(x) are
polynomials with real coefficients such that q(−3) 6= 0 and such that π(n) = p(n) q(n) for infinitely many
p(−3)
positive integers n. Compute q(−3) .
Proposed by Gopal Goel.
Answer. 197 .

Solution. Let In be the set of all n-transpositions.


Definition. Fix some subset T ⊆ In . We say that a multilinear function f : (Fnq )n → Fq is T -good if

f (x1 , . . . , xn ) = −f (xσ(1) , . . . , xσ(n) )

for all σ ∈ T and (x1 , . . . , xn ) ∈ (Fnq )n .


Definition. Fix some subset T ⊆ In . For any (x1 , . . . , xn ) ∈ (Fnq )n , let gT (x1 , . . . , xn ) denote the
number of different values f (x1 , . . . , xn ) takes over all T -good functions f .
Definition. Fix some subset T ⊆ In . Let GT be the graph with vertex set [n] = {1, 2, . . . , n} and edge
{a, b} if and only if the transposition (a, b) is in T . Let C1 t · · · t Cr be partition of the vertex set into
connected components of GT . Call a matrix (x1 , . . . , xn ) ∈ (Fnq )n T -invertible if the sets {xi }i∈Ck are
each a set of linearly independent vectors.
Definition. Let ε(q, T ) be the expected value of gT (x1 , . . . , xn ) if (x1 , . . . , xn ) ∈ (Fnq )n is chosen uni-
formly at random. Also define
  
ε(q, T ) − 1
κ(T ) = − lim logq − ln .
q→∞ q−1

We have the following lemma. Lemma. Let f be a T -good function for some T ⊆ In . Let C1 t · · · t Cr
be the connected components of GT . Then, if a, b ∈ Ck , then

f (x1 , . . . , xn ) = −f (xσ(1) , . . . , xσ(n) )

where σ is the transposition swapping a and b.


Sketch. Let T̄ be the set of transpositions σ such that

f (x1 , . . . , xn ) = −f (xσ(1) , . . . , xσ(n) )

for all (x1 , . . . , xn ) ∈ (Fnq )n . It suffices to show that if (a, b), (b, c) ∈ T̄ , then (a, c) ∈ T̄ . This follows
since (a, b) ◦ (b, c) ◦ (a, b) = (a, c) and (−1)3 = −1.
We have the following key linear algebra claim.

20
OMO Fall 2019
Official Solutions

Claim (Main Linear Algebra Step).Fix some set T ⊆ In . Then gT (x1 , . . . , xn ) = q if (x1 , . . . , xn ) is
T -invertible, and gT (x1 , . . . , xn ) = 1 otherwise.
Proof. First suppose that X = (x1 , . . . , xn ) is not T -invertible. As above, let C1 t · · · t Cr be partition
of the vertex set into connected components of GT . Then, there is some 1 ≤ k ≤ r such that the set
of vectors {xi }i∈Ck is linearly dependent. So
X
xj + αi xi = 0
i∈Ck
i6=j

for some j ∈ Ck and scalars αi ∈ Fq .


Note that if xa = xb for a, b ∈ Ck and a 6= b, then fP (x1 , . . . , xn ) = 0 (this is due to the lemma). Thus,
f (x1 , . . . , xn ) is unchanged if we replace xj with xj + i∈Ck αi xi , or 0. But f (x1 , . . . , xj−1 , 0, xj+1 , . . . , xn ) =
i6=j
0 by multilinearity, so we have f (X) = 0. Thus, if X is not T -invertible, then f (X) = 0, so gT (X) = 1.
Now, suppose that X = (x1 , . . . , xn ) is T -invertible. We’ll construct a T -good function f such that
f (X) 6= 0. By scaling this function, we see that h(X) can take any value in Fq for T -good functions h,
so g(X) = q.
(k) (k)
Extend each set {xi }i∈Ck to a basis Dk = {zi }i∈[n] of Fnq . In particular, we have zi = xi if i ∈ Ck .
Now, for any (y1 , . . . , yn ) ∈ (Fnq )n , set
r
(k)
Y
f (y1 , . . . , yn ) = det(w1 , . . . , wn(k) ),
k=1

(k) (k) (k)


where wi = yi if i ∈ Ck , and wi = zi otherwise. It is easy to check that this function is T -good,
and that f (x1 , . . . , xn ) 6= 0, so we’re done. This prove the Main Linear Algebra Step.
We have the following well known counting step.
Claim (Counting T -Invertible Matrices). Let T ⊆ [n], and let C1 t· · ·tCr be the connected components
of GT . Then,
r
ε(q, T ) − 1 Y
= (1 − q −n )(1 − q −n+1 ) · · · (1 − q −n+|Ck |−1 ).
q−1
k=1

ε(q,T )−1
Proof. By the previous claim, q−1 is simply the probability that a randomly chosen element of
(Fnq )n is T -good.
Let’s count the number of ordered lists of m vectors in Fnq that are linearly independent. We have
q n − 1 choices for the first vector, q n − q for the second, q n − q 2 for the third, and so on. Thus the
number of lists is
(q n − 1) · (q n − q) · · · (q n − q n−m+1 ).
Now, the number of T -good matrices is just the product of the above quantity where m ranges over
all the |Ck |, since we just have to choose the vectors such that the sets {xi }i∈Ck are sets of linearly
independent vectors. Thus, the number of T -good matrices is
r
Y
(q n − 1) · (q n − q) · · · (q n − q n−|Ck |+1 ).
k=1
2
The result follows since the number of total matrices is q n = q n|C1 | · · · q n|Ck | . This proves the Claim.
We’ll now evaluate the limit. Claim (Evaluating the Limit). Let T ⊆ In , and let C1 t · · · t Cr be
the connected components of GT . Let γ be the size of the largest connected components. Then,
κ(T ) = n + 1 − γ.
Proof. Note that

− ln[((1 − q −n )(1 − q −n+1 ) · · · (1 − q −n+|Ck |−1 )] = q −n+|Ck |−1 + O(q −n+|Ck |−2 ).

21
OMO Fall 2019
Official Solutions

Now, suppose that ` of C1 , . . . , Cr are all the “largest connected component”, so they all have size γ.
Then, we see that
" r #
Y
−n −n+1 −n+|Ck |−1
− ln (1 − q )(1 − q ) · · · (1 − q ) = ` · q −n+γ−1 + O(q −n+γ−2 ).
k=1

The result then follows by taking logq and noting that logq ` → 0 as q → ∞. This proves the Claim.
We see that π(n) = n + 1 − Eγ, where Eγ is the expected size of the largest connected components
over all labeled graphs on n vertices and four edges. Let gγ be the number of graphs with four edges
and largest connected components size γ.
Here is a list of all non-isomorphic graphs on four vertices (we’re ignoring lone vertices), and the
number of labeled graphs on n vertices corresponding to each isomorphism class.

From here, we calculate


 
n
g2 = 105
8
     
n n n
g3 = 315 + 90 + 10
7 6 5
   
n n
g4 = 240 + 15
6 4
 
n
g5 = 125 ,
5
yielding a final answer of
n n
+ 1230 n6 + 655 n5 + 60 n4
    
210 8 + 945 7
π(n) = n + 1 − .
(n2 )
4

22
OMO Fall 2019
Official Solutions

p(−3)
A calculation yields q(−3) = 197.

23

You might also like