The Online Math Open Fall Contest September 24-October 1, 2012

Contest Information Format The test will start Monday September 24 and end Monday October 1. You will have until 7pm EST on October 1 to submit your answers. The test consists of 30 short answer questions, each of which has a nonnegative integer answer. The problem difficulties range from those of AMC problems to those of Olympiad problems. Problems are ordered in roughly increasing order of difficulty.

Team Guidelines Students may compete in teams of up to four people. Participating students must not have graduated from high school. International students may participate. No student can be a part of more than one team. The members of each team do not get individual accounts; they will all share the team account. Each team will submit its final answers through its team account. Though teams can save drafts for their answers, the current interface does not allow for much flexibility in communication between team members. We recommend using Google Docs and Spreadsheets to discuss problems and compare answers, especially if teammates cannot communicate in person. Teams may spend as much time as they like on the test before the deadline.

Aids Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids are not allowed. This is includes (but is not limited to) Geogebra and graphing calculators. Published print and electronic resources are not permitted. (This is a change from last year’s rules.) Four-function calculators are permitted on the Online Math Open. That is, calculators which perform only the four basic arithmetic operations (+-*/) may be used. Any other computational aids such as scientific and graphing calculators, computer programs and applications such as Mathematica, and online databases is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors.

Clarifications Clarifications will be posted as they are answered. For the Fall 2012-2013 Contest, they will be posted at here. If you have a question about a problem, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer.

Scoring Each problem will be worth one point. Ties will be broken based on the highest problem number that a team answered correctly. If there are still ties, those will be broken by the second highest problem solved, and so on.

Results After the contest is over, we will release the answers to the problems within the next day. If you have a protest about an answer, you may send an email to [email protected] (Include “Protest” in the subject). Solutions and results will be released in the following weeks.

September/October 2012

Fall OMO 2012-2013

Page 3

1. Calvin was asked to evaluate 37 + 31 × a for some number a. Unfortunately, his paper was tilted 45 degrees, so he mistook multiplication for addition (and vice versa) and evaluated 37 × 31 + a instead. Fortunately, Calvin still arrived at the correct answer while still following the order of operations. For what value of a could this have happened? 2. Petya gave Vasya a number puzzle. Petya chose a digit X and said, “I am thinking of a number that is divisible by 11. The hundreds digit is X and the tens digit is 3. Find the units digit.” Vasya was excited because he knew how to solve this problem, but then realized that the problem Petya gave did not have an answer. What digit X did Petya chose? 3. Darwin takes an 11 × 11 grid of lattice points and connects every pair of points that are 1 unit apart, creating a 10 × 10 grid of unit squares. If he never retraced any segment, what is the total length of all segments that he drew? 4. Let lcm(a, b) denote the least common multiple of a and b. Find the sum of all positive integers x such that x ≤ 100 and lcm(16, x) = 16x. 5. Two circles have radius 5 and 26. The smaller circle passes through center of the larger one. What is the difference between the lengths of the longest and shortest chords of the larger circle that are tangent to the smaller circle? 6. An elephant writes a sequence of numbers on a board starting with 1. Each minute, it doubles the sum of all the numbers on the board so far, and without erasing anything, writes the result on the board. It stops after writing a number greater than one billion. How many distinct prime factors does the largest number on the board have? 7. Two distinct points A and B are chosen at random from 15 points equally spaced around a circle centered at O such that each pair of points A and B has the same probability of being chosen. The probability that the perpendicular bisectors of OA and OB intersect strictly inside the circle can be expressed in the form m n , where m, n are relatively prime positive integers. Find m + n. 8. In triangle ABC let D be the foot of the altitude from A. Suppose that AD = 4, BD = 3, CD = 2, and AB is extended past B to a point E such that BE = 5. Determine the value of CE 2 . 9. Define a sequence of integers by T1 = 2 and for n ≥ 2, Tn = 2Tn−1 . Find the remainder when T1 + T2 + · · · + T256 is divided by 255. 10. There are 29 unit squares in the diagram below. A frog starts in one of the five (unit) squares on the top row. Each second, it hops either to the square directly below its current square (if that square exists), or to the square down one unit and left one unit of its current square (if that square exists), until it reaches the bottom. Before it reaches the bottom, it must make a hop every second. How many distinct paths (from the top row to the bottom row) can the frog take?

September/October 2012

Fall OMO 2012-2013

Page 4

11. Let ABCD be a rectangle. Circles with diameters AB and CD meet at points P and Q inside the rectangle such that P is closer to segment BC than Q. Let M and N be the midpoints of segments AB and CD. If ∠M P N = 40◦ , find the degree measure of ∠BP C. p 12. Let a1 , a2 , . . . be a sequence defined by a1 = 1 and for n ≥ 1, an+1 = a2n − 2an + 3 + 1. Find a513 . 13. A number is called 6-composite if it has exactly 6 composite factors. What is the 6th smallest 6composite number? (A number is composite if it has a factor not equal to 1 or itself. In particular, 1 is not composite.) 14. When Applejack begins to buck trees, she starts off with 100 energy. Every minute, she may either choose to buck n trees and lose 1 energy, where n is her current energy, or rest (i.e. buck 0 trees) and gain 1 energy. What is the maximum number of trees she can buck after 60 minutes have passed? 15. How many sequences of nonnegative integers a1 , a2 , . . . , an (n ≥ 1) are there such that a1 · an > 0, n−1 Y a1 + a2 + · · · + an = 10, and (ai + ai+1 ) > 0? i=1

16. Let ABC be a triangle with AB = 4024, AC = 4024, and BC = 2012. The reflection of line AC over line AB meets the circumcircle of 4ABC at a point D 6= A. Find the length of segment CD. 17. Find the number of integers a with 1 ≤ a ≤ 2012 for which there exist nonnegative integers x, y, z satisfying the equation x2 (x2 + 2z) − y 2 (y 2 + 2z) = a. 18. There are 32 people at a conference. Initially nobody at the conference knows the name of anyone else. The conference holds several 16-person meetings in succession, in which each person at the meeting learns (or relearns) the name of the other fifteen people. What is the minimum number of meetings needed until every person knows everyone elses name? 19. In trapezoid ABCD, AB < CD, AB ⊥ BC, AB k CD, and the diagonals AC, BD are perpendicular at point P . There is a point Q on ray CA past A such that QD ⊥ DC. If AP QP + = AP QP AP BP − can be expressed in the form then AP BP m + n.

m n



51 14

4 − 2,

for relatively prime positive integers m, n. Compute

20. The numbers 1, 2, . . . , 2012 are written on a blackboard. Each minute, a student goes up to the board, chooses two numbers x and y, erases them, and writes the number 2x + 2y on the board. This continues until only one number N remains. Find the remainder when the maximum possible value of N is divided by 1000. 21. A game is played with 16 cards laid out in a row. Each card has a black side and a red side, and initially the face-up sides of the cards alternate black and red with the leftmost card black-side-up. A move consists of taking a consecutive sequence of cards (possibly only containing 1 card) with leftmost

September/October 2012

Fall OMO 2012-2013

Page 5

card black-side-up and the rest of the cards red-side-up, and flipping all of these cards over. The game ends when a move can no longer be made. What is the maximum possible number of moves that can be made before the game ends? 22. Let c1 , c2 , . . . , c6030 be 6030 real numbers. Suppose that for any 6030 real numbers a1 , a2 , . . . , a6030 , there exist 6030 real numbers {b1 , b2 , . . . , b6030 } such that an =

n X

bgcd(k,n)

k=1

and bn =

X

cd an/d

d|n

for n = 1, 2, . . . , 6030. Find c6030 . 23. For reals x ≥ 3, let f (x) denote the function f (x) =

√ −x + x 4x − 3 . 2

Let a1 , a2 , . . ., be the sequence satisfying a1 > 3, a2013 = 2013, and for n = 1, 2, . . . , 2012, an+1 = f (an ). Determine the value of 2012 X a3i+1 a1 + . a2 + ai ai+1 + a2i+1 i=1 i 24. In scalene 4ABC, I is the incenter, Ia is the A-excenter, D is the midpoint of arc BC of the circumcircle of ABC, and M is the midpoint of side BC. Extend ray IM past M to point P such that IM = M P . Let Q be the intersection of DP and M Ia , and R be the point on the line M Ia such that AR k DP . QM m a Given that AI AI = 9, the ratio RIa can be expressed in the form n for two relatively prime positive integers m, n. Compute m + n. 25. Suppose 2012 reals are selected independently and at random from the unit interval [0, 1], and then 1 written in nondecreasing order as x1 ≤ x2 ≤ · · · ≤ x2012 . If the probability that xi+1 − xi ≤ 2011 for m i = 1, 2, . . . , 2011 can be expressed in the form n for relatively prime positive integers m, n, find the remainder when m + n is divided by 1000. 26. Find the smallest positive integer k such that     x + kb x ≡ (mod b) 12 12 for all positive integers b and x. (Note: For integers a, b, c we say a ≡ b (mod c) if and only if a − b is divisible by c.) 27. Let ABC be a triangle with circumcircle ω. Let the bisector of ∠ABC meet segment AC at D and circle ω at M 6= B. The circumcircle of 4BDC meets line AB at E 6= B, and CE meets ω at P 6= C. The bisector of ∠P M C meets segment AC at Q 6= C. Given that P Q = M C, determine the degree measure of ∠ABC.

September/October 2012

28. Find the remainder when

Fall OMO 2012-2013

16

  2 X 2k k=1

is divided by 2

16

Page 6

k

16

(3 · 214 + 1)k (k − 1)2

−1

+ 1. (Note: It is well-known that 216 + 1 = 65537 is prime.)

29. In the Cartesian plane, let Si,j = {(x, y) | i ≤ x ≤ j}. For i = 0, 1, . . . , 2012, color Si,i+1 pink if i is even and gray if i is odd. For a convex polygon P in the plane, let d(P ) denote its pink density, i.e. the fraction of its total area that is pink. Call a polygon P pinxtreme if it lies completely in the region S0,2013 and has at least one vertex on each of the lines x = 0 and x = 2013. Given that the minimum value of d(P ) over all non-degenerate convex pinxtreme polygons P in the plane can be expressed in the form

√ (1+ p)2 q2

for positive integers p, q, find p + q.

30. Let P (x) denote the polynomial 3

9 X k=0

xk + 2

1209 X k=10

xk +

146409 X

xk .

k=1210

Find the smallest positive integer n for which there exist polynomials f, g with integer coefficients satisfying xn − 1 = (x16 + 1)P (x)f (x) + 11 · g(x).

September/October 2012

Fall OMO 2012-2013

Acknowledgments Contest Directors Ray Li, James Tao, Victor Wang

Head Problem Writers Ray Li, Victor Wang

Problem Contributors Ray Li, James Tao, Anderson Wang, Victor Wang, David Yang, Alex Zhu

Proofreaders and Test Solvers Mitchell Lee, James Tao, Anderson Wang, David Yang, Alex Zhu

Website Manager Ray Li

Page 7

The Online Math Open January 16-23, 2012

Contest Information Format The test will start Monday January 16 and end Monday January 23. The test consists of 50 short answer questions, each of which has a nonnegative integer answer. The problem difficulties range from those of AMC problems to those of Olympiad problems. Problems are ordered in roughly increasing order of difficulty.

Team Guidelines Students may compete in teams of up to four people. Participating students must not have graduated from high school. International students may participate. No student can be a part of more than one team. The members of each team do not get individual accounts; they will all share the team account. The team will submit their final answers through their account. Though teams can save drafts for their answers, the current interface does not allow for much flexibility in communication between team members. We recommend using Google Docs and Spreadsheets to discuss problems and compare answers, especially if teammates cannot communicate in person. Teams may spend as much time as they like on the test before the deadline.

Aids Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids are not allowed. This is includes (but is not limited to) Geogebra and graphing calculators. Published print and electronic resources are permitted. Four-function calculators are permitted on the Online Math Open. That is, calculators which perform only the four basic arithmetic operations (+-*/) may be used. No other computational aids such as scientific and graphing calculators, computer programs and applications such as Mathematica, and online databases are permitted. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors.

Scoring Each problem will be worth one point. Ties will be broken based on the highest problem number that a team answered correctly. If there are still ties, those will be broken by the second highest problem solved, and so on.

Results After the contest is over, we will release the answers to the problems within the next day. If you have a protest about an answer, you may send an email to [email protected] (Include ”Protest” in the subject). Solutions and results will be released in the following weeks.

January 2012

OMO 2012

Page 3

1. The average of two positive real numbers is equal to their difference. What is the ratio of the larger number to the smaller one? 2. How many ways are there to arrange the letters A, A, A, H, H in a row so that the sequence HA appears at least once? 3. A lucky number is a number whose digits are only 4 or 7. What is the 17th smallest lucky number? 4. How many positive even numbers have an even number of digits and are less than 10000? 5. Congruent circles Γ1 and Γ2 have radius 2012, and the center of Γ1 lies on Γ2 . Suppose that Γ1 and Γ2 intersect at A and B. The line through A perpendicular to AB meets Γ1 and Γ2 again at C and D, respectively. Find the length of CD. 6. Alice’s favorite number has the following properties: • It has 8 distinct digits. • The digits are decreasing when read from left to right. • It is divisible by 180. What is Alice’s favorite number? 7. A board 64 inches long and 4 inches high is inclined so that the long side of the board makes a 30 degree angle with the ground. √ The distance from the highest point on the board to the ground can be expressed in the form a + b c where a, b, c are positive integers and c is not divisible by the square of any prime. What is a + b + c? 8. An 8 × 8 × 8 cube is painted red on 3 faces and blue on 3 faces such that no corner is surrounded by three faces of the same color. The cube is then cut into 512 unit cubes. How many of these cubes contain both red and blue paint on at least one of their faces? 9. At a certain grocery store, cookies may be bought in boxes of 10 or 21. What is the minimum positive number of cookies that must be bought so that the cookies may be split evenly among 13 people? 10. A drawer has 5 pairs of socks. Three socks are chosen at random. If the probability that there is a pair among the three is m n , where m and n are relatively prime positive integers, what is m + n? 11. If

1 1 1 1 1 1 + 2+ 3+ 4+ + ··· = , 5 x 2x 4x 8x 16x 64 and x can be expressed in the form m n , where m, n are relatively prime positive integers, find m + n.

12. A cross-pentomino is a shape that consists of a unit square and four other unit squares each sharing a different edge with the first square. If a cross-pentomino is inscribed in a circle of radius R, what is 100R2 ?

January 2012

OMO 2012

Page 4

13. A circle ω has center O and radius r. A chord BC of ω also has length r, and the tangents to ω at B and C meet at A. Ray AO meets ω at D past O, and ray OA meets the circle centered at A with radius AB at E past A. Compute the degree measure of ∠DBE. 14. Al told Bob that he was thinking of 2011 distinct positive integers. He also told Bob the sum of those integers. From this information, Bob was able to determine all 2011 integers. How many possible sums could Al have told Bob? 15. Five bricklayers working together finish a job in 3 hours. Working alone, each bricklayer takes at most 36 hours to finish the job. What is the smallest number of minutes it could take the fastest bricklayer to complete the job alone? 16. Let A1 B1 C1 D1 A2 B2 C2 D2 be a unit cube, with A1 B1 C1 D1 and A2 B2 C2 D2 opposite square faces, and let M be the center of face A2 B2 C2 D2 . Rectangular pyramid M A1 B1 C√ 1 D1 is cut out of the cube. If the surface area of the remaining solid can be expressed in the form a + b, where a and b are positive integers and b is not divisible by the square of any prime, find a + b. 17. Each pair of vertices of a regular 10-sided polygon is connected by a line segment. How many unordered pairs of distinct parallel line segments can be chosen from these segments? 18. The sum of the squares of three positive numbers is 160. One of the numbers is equal to the sum of the other two. The difference between the smaller two numbers is 4. What is the difference between the cubes of the smaller two numbers? 19. There are 20 geese numbered 1 through 20 standing in a line. The even numbered geese are standing at the front in the order 2, 4, . . . , 20, where 2 is at the front of the line. Then the odd numbered geese are standing behind them in the order, 1, 3, 5, . . . , 19, where 19 is at the end of the line. The geese want to rearrange themselves in order, so that they are ordered 1, 2, . . . , 20 (1 is at the front), and they do this by successively swapping two adjacent geese. What is the minimum number of swaps required to achieve this formation? 20. Let ABC be a right triangle with a right angle at C. Two lines, one parallel to AC and the other parallel to BC, intersect on the hypotenuse AB. The lines cut the triangle into two triangles and a rectangle. The two triangles have areas 512 and 32. What is the area of the rectangle? 21. If

2012

20112011

= xx

for some positive integer x, how many positive integer factors does x have? 22. Find the largest prime number p such that when 2012! is written in base p, it has at least p trailing zeroes. 23. Let ABC be an equilateral triangle with side length 1. This triangle is rotated by some angle about its center to form triangle DEF. The intersection of ABC and DEF is an equilateral hexagon with an area that is 54 the area of ABC. The side length of this hexagon can be expressed in the form m n where m and n are relatively prime positive integers. What is m + n? 24. Find the number of ordered pairs of positive integers (a, b) with a + b prime, 1 ≤ a, b ≤ 100, and is an integer.

ab+1 a+b

January 2012

OMO 2012

Page 5

25. Let a, b, c be the roots of the cubic x3 + 3x2 + 5x + 7. Given that P is a cubic polynomial such that P (a) = b + c, P (b) = c + a, P (c) = a + b, and P (a + b + c) = −16, find P (0). 26. Xavier takes a permutation of the numbers 1 through 2011 at random, where each permutation has an equal probability of being selected. He then cuts the permutation into increasing contiguous subsequences, such that each subsequence is as long as possible. Compute the expected number of such subsequences. 27. Let a and b be real numbers that satisfy a4 + a2 b2 + b4 = 900, a2 + ab + b2 = 45. Find the value of 2ab. 28. A fly is being chased by three spiders on the edges of a regular octahedron. The fly has a speed of 50 meters per second, while each of the spiders has a speed of r meters per second. The spiders choose the (distinct) starting positions of all the bugs, with the requirement that the fly must begin at a vertex. Each bug knows the position of each other bug at all times, and the goal of the spiders is for at least one of them to catch the fly. What is the maximum c so that for any r < c, the fly can always avoid being caught? 29. How many positive integers a with a ≤ 154 are there such that the coefficient of xa in the expansion of (1 + x7 + x14 + · · · + x77 )(1 + x11 + x22 + · · · + x77 ) is zero? 30. The Lattice Point Jumping Frog jumps between lattice points in a coordinate plane that are exactly 1 unit apart. The Lattice Point Jumping Frog starts at the origin and makes 8 jumps, ending at the origin. Additionally, it never lands on a point other than the origin more than once. How many possible paths could the frog have taken? 31. Let ABC be a triangle inscribed in circle Γ, centered at O with radius 333. Let M be the midpoint of AB, N be the midpoint of AC, and D be the point where line AO intersects BC. Given that lines M N and BO concur on Γ and that BC = 665, find the length of segment AD. 32. The sequence {an } satisfies a0 = 201, a1 = 2011, and an = 2an−1 + an−2 for all n ≥ 2. Let S=

∞ X i=1

What is

ai−1 a2i − a2i−1

1 S?

33. You are playing a game in which you have 3 envelopes, each containing a uniformly random amount of money between 0 and 1000 dollars. (That is, for any real 0 ≤ a < b ≤ 1000, the probability that the b−a amount of money in a given envelope is between a and b is 1000 .) At any step, you take an envelope and look at its contents. You may choose either to keep the envelope, at which point you finish, or discard it and repeat the process with one less envelope. If you play to optimize your expected winnings, your expected winnings will be E. What is bEc, the greatest integer less than or equal to E?

January 2012

OMO 2012

Page 6

34. Let p, q, r be real numbers satisfying (p + q)(q + r)(r + p) = 24 pqr (p − 2q)(q − 2r)(r − 2p) = 10. pqr Given that pq + rq + pr can be expressed in the form compute m + n.

m n,

where m, n are relatively prime positive integers,

35. Let s(n) be the number of 1’s in the binary representation of n. Find the number of ordered pairs of integers (a, b) with 0 ≤ a < 64, 0 ≤ b < 64 and s(a + b) = s(a) + s(b) − 1. 36. Let sn be the number of solutions to a1 + a2 + a3 + a4 + b1 + b2 = n, where a1 , a2 , a3 and a4 are elements of the set {2, 3, 5, 7} and b1 and b2 are elements of the set {1, 2, 3, 4}. Find the number of n for which sn is odd. 37. In triangle ABC, AB = 1 and AC = 2. Suppose there exists a point P in the interior of triangle ABC such that ∠P BC = 70◦ , and that there are points E and D on segments AB and AC, such that ∠BP E = ∠EP A = 75◦ and ∠AP D = ∠DP C = 60◦ . Let BD meet CE at Q, and let AQ meet BC at F. If M is the midpoint of BC, compute the degree measure of ∠M P F. 38. Let S denote the sum of the 2011th powers of the roots of the polynomial (x − 20 )(x − 21 ) · · · (x − 22010 ) − 1. How many 1’s are in the binary expansion of S? 39. For positive integers n, let ν3 (n) denote the largest integer k such that 3k divides n. Find the number of subsets S (possibly containing 0 or 1 elements) of {1, 2, . . . , 81} such that for any distinct a, b ∈ S, ν3 (a − b) is even. 40. Suppose x, y, z, and w are positive reals such that x2 + y 2 −

wz xy = w2 + z 2 + = 36 2 2 xz + yw = 30.

Find the largest possible value of (xy + wz)2 . 41. Find the remainder when

63 2011 X i −i i=2

i2 − 1

.

is divided by 2016. 42. In triangle ABC, sin ∠A = 45 and ∠A < 90◦ Let D be a point outside triangle ABC such that 3 ∠BAD = ∠DAC and ∠BDC = 90◦ . Suppose that AD = 1 and that BD CD = 2 . If AB + AC can be expressed in the form

√ a b c

where a, b, c are pairwise relatively prime integers, find a + b + c?

43. An integer x is selected at random between 1 and 2011! inclusive. The probability that xx − 1 is divisible by 2011 can be expressed in the form m n , where m and n are relatively prime positive integers. Find m.

January 2012

OMO 2012

Page 7

44. Given a set of points in space, a jump consists of taking two points in the set, P and Q, removing P from the set, and replacing it with the reflection of P over Q. Find the smallest number n such that for any set of n lattice points in 10-dimensional-space, it is possible to perform a finite number of jumps so that some two points coincide. 45. Let K1 , K2 , K3 , K4 , K5 be 5 distinguishable keys, and let D1 , D2 , D3 , D4 , D5 be 5 distinguishable doors. For 1 ≤ i ≤ 5, key Ki opens doors Di and Di+1 (where D6 = D1 ) and can only be used once. The keys and doors are placed in some order along a hallway. Key$ha walks into the hallway, picks a key and opens a door with it, such that she never obtains a key before all the doors in front of it are unlocked. In how many such ways can the keys and doors be ordered if Key$ha can open all the doors? 46. Let f is a function from the set of positive integers to itself such that f (x) ≤ x2 for all natural numbers x, and f (f (f (x))f (f (y))) = xy for all natural numbers x and y. Find the number of possible values of f (30). √ 47. Let ABCD be an isosceles trapezoid with bases AB = 5 and CD = 7 and legs BC = AD = 2 10. A circle ω with center O passes through A, B, C, and D. Let M be the midpoint of segment CD, and ray AM meet ω again at E. Let N be the midpoint of BE and P be the intersection of BE with CD. Let Q be the intersection of ray ON with ray DC. There is a point R on the circumcircle of P N Q such that ∠P RC = 45◦ . The length of DR can be expressed in the form m n where m and n are relatively prime positive integers. What is m + n? 48. Suppose that 982 X

7i

2

i=1

can be expressed in the form 983q + r, where q and r are integers and 0 ≤ r ≤ 492. Find r. 49. Find the magnitude of the product of all complex numbers c such that the recurrence defined by x1 = 1, x2 = c2 − 4c + 7, and xn+1 = (c2 − 2c)2 xn xn−1 + 2xn − xn−1 also satisfies x1006 = 2011. 50. In tetrahedron SABC, the circumcircles of faces SAB, SBC, and SCA each have radius 108 The inscribed sphere of SABC, centered at I, has radius 35. Additionally, SI = 125. Let R isp the largest possible value of the circumradius of face ABC. Give that R can be expressed in the form m n , where m and n are relatively prime positive integers, find m + n.

January 2012

OMO 2012

Acknowledgments Test Directors Ray Li, Anderson Wang, and Alex Zhu

Head Problem Writers Ray Li, Anderson Wang, and Alex Zhu

Problem Contributors Mitchell Lee, Ray Li, Anderson Wang, and Alex Zhu

Proofreaders Timothy Chu, Mitchell Lee, Victor Wang, David Yang, and George Xing

Website Manager Mitchell Lee

Page 8

The Online Math Open Fall Contest October 18 - 29, 2013

Acknowledgements Contest Directors • Evan Chen

Head Problem Writers • Evan Chen • Michael Kural • David Stoner

Problem Contributors, Proofreaders, and Test Solvers • Ray Li • Calvin Deng • Mitchell Lee • James Tao • Anderson Wang • Victor Wang • David Yang • Alex Zhu

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in one contest but not the other. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2013 Fall Contest will consist of 30 problems; the answer to each problem will be a nonnegative integer not exceeding 263 − 2 = 9223372036854775806. The contest window will be October 18 - 29, 2013, from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids, including scientific calculators, graphing calculators, or computer programs is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate with each other about the contest while the contest is running. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the ”hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. (Problem m is harder than problem n if fewer teams solve problem m OR if the number of solves is equal and m > n.) 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Fall 2013 October 18 - 29, 2013 1. Determine the value of 142857 + 285714 + 428571 + 571428. 2. The figure below consists of several unit squares, M of which are white and N of which are green. Compute 100M + N .

3. A palindromic table is a 3 × 3 array of letters such that the words in each row and column read the same forwards and backwards. An example of such a table is shown below. O N O

M M M

O N O

How many palindromic tables are there that use only the letters O and M ? (The table may contain only a single letter.) 4. Suppose a1 , a2 , a3 , . . . is an increasing arithmetic progression of positive integers. Given that a3 = 13, compute the maximum possible value of aa1 + aa2 + aa3 + aa4 + aa5 . 5. A wishing well is located at the point (11, 11) in the xy-plane. Rachelle randomly selects an integer y from the set {0, 1, . . . , 10}. Then she randomly selects, with replacement, two integers a, b from the set {1, 2, . . . , 10}. The probability the line through (0, y) and (a, b) passes through the well can be expressed as m n , where m and n are relatively prime positive integers. Compute m + n. 6. Find the number of integers n with n ≥ 2 such that the remainder when 2013 is divided by n is equal to the remainder when n is divided by 3. 7. Points M , N , P are selected on sides AB, AC, BC, respectively, of triangle ABC. Find the area of triangle M N P given that AM = M B = BP = 15 and AN = N C = CP = 25. 8. Suppose that x1 < x2 < · · · < xn is a sequence of positive integers such that xk divides xk+2 for each k = 1, 2, . . . , n − 2. Given that xn = 1000, what is the largest possible value of n? 9. Let AXY ZB be a regular pentagon with area 5 inscribed in a circle with center O. Let Y 0 denote the reflection of Y over AB and suppose C is the center of a circle passing through A, Y 0 and B. Compute the area of triangle ABC. 10. In convex quadrilateral AEBC, ∠BEA = ∠CAE = 90◦ and AB = 15, BC = 14 and CA = 13. Let D be the foot of the altitude from C to AB. If ray CD meets AE at F , compute AE · AF . 11. Four orange lights are located at the points (2, 0), (4, 0), (6, 0) and (8, 0) in the xy-plane. Four yellow lights are located at the points (1, 0), (3, 0), (5, 0), (7, 0). Sparky chooses one or more of the lights to turn on. In how many ways can he do this such that the collection of illuminated lights is symmetric around some line parallel to the y-axis? 12. Let an denote the remainder when (n + 1)3 is divided by n3 ; in particular, a1 = 0. Compute the remainder when a1 + a2 + · · · + a2013 is divided by 1000. 1

OMO Fall 2013 October 18 - 29, 2013 13. In the rectangular table shown below, the number 1 is written in the upper-left hand corner, and every number is the sum of the any numbers directly to its left and above. The table extends infinitely downwards and to the right. 1 1 1 1 1 ··· 1 2 3 4 5 ··· 1 3 6 10 15 · · · 1 4 10 20 35 · · · 1 5 15 35 70 · · · .. .. .. .. .. . . . . . . . . Wanda the Worm, who is on a diet after a feast two years ago, wants to eat n numbers (not necessarily distinct in value) from the table such that the sum of the numbers is less than one million. However, she cannot eat two numbers in the same row or column (or both). What is the largest possible value of n? 14. In the universe of Pi Zone, points are labeled with 2 × 2 arrays of positive reals. One can teleport from point M to point M 0 if M can be obtained from  M 0 by multiplying either by some    a row or column   1 2 1 20 1 20 positive real. For example, one can teleport from to and then to . 3 4 3 40 6 80 A tourist attraction is a point where each of the entries of the associated array is either 1, 2, 4, 8 or 16. A company wishes to build a hotel on each of several points so that at least one hotel is accessible from every tourist attraction by teleporting, possibly multiple times. What is the minimum number of hotels necessary? 15. Find the positive integer n such that f (f (· · · f (n) · · · )) = 20142 + 1 | {z } 2013 f ’s

where f (n) denotes the nth positive integer which is not a perfect square. 16. Al has the cards 1, 2, . . . , 10 in a row in increasing order. He first chooses the cards labeled 1, 2, and 3, and rearranges them among their positions in the row in one of six ways (he can leave the positions unchanged). He then chooses the cards labeled 2, 3, and 4, and rearranges them among their positions in the row in one of six ways. (For example, his first move could have made the sequence 3, 2, 1, 4, 5, . . . , and his second move could have rearranged that to 2, 4, 1, 3, 5, . . . .) He continues this process until he has rearranged the cards with labels 8, 9, 10. Determine the number of possible orderings of cards he can end up with. 17. Let ABXC be a parallelogram. Points K, P, Q lie on BC in this order such that BK = 13 KC and BP = P Q = QC = 13 BC. Rays XP and XQ meet AB and AC at D and E, respectively. Suppose that AK ⊥ BC, EK − DK = 9 and BC = 60. Find AB + AC. 18. Given an n × n grid of dots, let f (n) be the largest number of segments between adjacent dots which can be drawn such that (i) at most one segment is drawn between each pair of dots, and (ii) each dot has 1 or 3 segments coming from it. (For example, f (4) = 16.) Compute f (2000). 19. Let σ(n) be the number of positive divisors of n, and let rad n be the product of the distinct prime divisors of n. By convention, rad 1 = 1. Find the greatest integer not exceeding ∞ X σ(n)σ(n rad n) 100 n2 σ(rad n) n=1

! 13 .

20. A positive integer n is called mythical if every divisor of n is two less than a prime. Find the unique mythical number with the largest number of divisors. 2

OMO Fall 2013 October 18 - 29, 2013 21. Let ABC be a triangle with AB = 5, AC = 8, and BC = 7. Let D be on side AC such that AD = 5 and CD = 3. Let I be the incenter of triangle ABC and E be the intersection of the perpendicular √ a b bisectors of ID and BC. Suppose DE = c where a and c are relatively prime positive integers, and b is a positive integer not divisible by the square of any prime. Find a + b + c. 22. Find the sum of all integers m with 1 ≤ m ≤ 300 such that for any integer n with n ≥ 2, if 2013m divides nn − 1 then 2013m also divides n − 1. 23. Let ABCDE be a regular pentagon, and let F be a point on AB with ∠CDF = 55◦ . Suppose F C and BE meet at G, and select H on the extension of CE past E such that ∠DHE = ∠F DG. Find the measure of ∠GHD, in degrees. √ 1 24. The real numbers a0 , a1 , . . . , a2013 and b0 , b1 , . . . , b2013 satisfy an = 63 2n + 2 + an−1 and bn = √ 1 2n + 2 − b for every integer n = 1, 2, . . . , 2013. If a = b and b = a2013 , compute n−1 0 2013 0 96 2013 X

(ak bk−1 − ak−1 bk ) .

k=1

25. Let ABCD be a quadrilateral with AD = 20 and BC = 13. The area of 4ABC is 338 and the area of 4DBC is 212. Compute the smallest possible perimeter of ABCD. 26. Let ABC be a triangle with AB = 13, AC = 25, and tan A = 43 . Denote the reflections of B, C across AC, AB by D, E, respectively, and let O be the circumcenter of triangle ABC. Let P be a point such d of the that 4DP O ∼ 4P EO, and let X and Y be the midpoints of the major and minor arcs BC circumcircle of triangle ABC. Find P X · P Y . 27. Ben has a big blackboard, initially empty, and Francisco has a fair coin. Francisco flips the coin 2013 times. On the nth flip (where n = 1, 2, . . . , 2013), Ben does the following if the coin flips heads: (i) If the blackboard is empty, Ben writes n on the blackboard. (ii) If the blackboard is not empty, let m denote the largest number on the blackboard. If m2 + 2n2 is divisible by 3, Ben erases m from the blackboard; otherwise, he writes the number n. No action is taken when the coin flips tails. If probability that the blackboard is empty after all 2013 flips is 2k2u+1 , where u, v, and k are nonnegative integers, compute k. (2v+1) 28. Let n denote the product of the first 2013 primes. Find the sum of all primes p with 20 ≤ p ≤ 150 such that (i) p+1 2 is even but is not a power of 2, and (ii) there exist pairwise distinct positive integers a, b, c for which an (a − b)(a − c) + bn (b − c)(b − a) + cn (c − a)(c − b) is divisible by p but not p2 . 29. Kevin has 255 cookies, each labeled with a unique nonempty subset of {1, 2, 3, 4, 5, 6, 7, 8}. Each day, he chooses one cookie uniformly at random out of the cookies not yet eaten. Then, he eats that cookie, and all remaining cookies that are labeled with a subset of that cookie (for example, if he chooses the cookie labeled with {1, 2}, he eats that cookie as well as the cookies with {1} and {2}). The expected value of the number of days that Kevin eats a cookie before all cookies are gone can be expressed in the form m n , where m and n are relatively prime positive integers. Find m + n. 30. Let P (t) = t3 + 27t2 + 199t + 432. Suppose a, b, c, and x are distinct positive reals such that P (−a) = P (−b) = P (−c) = 0, and r r r r a+b+c b+c+x c+a+x a+b+x = + + . x a b c If x =

m n

for relatively prime positive integers m and n, compute m + n. 3

The Online Math Open Winter Contest January 4, 2013–January 14, 2013

Acknowledgments Contest Directors Ray Li, James Tao, Victor Wang

Head Problem Writers Evan Chen, Ray Li, Victor Wang

Additional Problem Contributors James Tao, Anderson Wang, David Yang, Alex Zhu

Proofreaders and Test Solvers Evan Chen, Calvin Deng, Mitchell Lee, James Tao, Anderson Wang, David Yang, Alex Zhu

Website Manager Ray Li

LATEX/Document Manager Evan Chen

Contest Information Format The test will start Friday, January 4 and end Monday, January 14. You will have until 7pm EST on January 14 to submit your answers. The test consists of 50 short answer questions, each of which has a nonnegative integer answer. The problem difficulties range from those of AMC problems to those of Olympiad problems. Problems are ordered in roughly increasing order of difficulty.

Team Guidelines Students may compete in teams of up to four people. Participating students must not have graduated from high school. International students may participate. No student can be a part of more than one team. The members of each team do not get individual accounts; they will all share the team account. Each team will submit its final answers through its team account. Though teams can save drafts for their answers, the current interface does not allow for much flexibility in communication between team members. We recommend using Google Docs and Spreadsheets to discuss problems and compare answers, especially if teammates cannot communicate in person. Teams may spend as much time as they like on the test before the deadline.

Aids Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids are not allowed. This is includes (but is not limited to) Geogebra and graphing calculators. Published print and electronic resources are not permitted. (This is a change from last year’s rules.) Four-function calculators are permitted on the Online Math Open. That is, calculators which perform only the four basic arithmetic operations (+-*/) may be used. Any other computational aids such as scientific and graphing calculators, computer programs and applications such as Mathematica, and online databases are prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors.

Clarifications Clarifications will be posted as they are answered. For the Fall 2012-2013 Contest, they will be posted at here. If you have a question about a problem, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer.

Scoring Each problem will be worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. Problem X is defined to be “harder” than Problem Y if and only if (i) X was solved by less teams than Y , OR (ii) X and Y were solved by the same number of teams and X appeared later in the test than Y . Note: This is a change from prior tiebreaking systems. problems by approximate difficulty.

However, we will still order the

Results After the contest is over, we will release the answers to the problems within the next day. If you have a protest about an answer, you may send an email to [email protected] (Include “Protest” in the subject). Solutions and results will be released in the following weeks.

January 2012

Winter OMO 2012-2013

Page 1

1. Let x be the answer to this problem. For what real number a is the answer to this problem also a−x? 2. The number 123454321 is written on a blackboard. Evan walks by and erases some (but not all) of the digits, and notices that the resulting number (when spaces are removed) is divisible by 9. What is the fewest number of digits he could have erased? 3. Three lines m, n, and ` lie in a plane such that no two are parallel. Lines m and n meet at an acute angle of 14◦ , and lines m and ` meet at an acute angle of 20◦ . Find, in degrees, the sum of all possible acute angles formed by lines n and `. 4. For how many ordered pairs of positive integers (a, b) with a, b < 1000 is it true that a times b is equal to b2 divided by a? For example, 3 times 9 is equal to 92 divided by 3.

Figure 1: xkcd 759 5. At the Mountain School, Micchell is assigned a submissiveness rating of 3.0 or 4.0 for each class he takes. His college potential is then defined as the average of his submissiveness ratings over all classes taken. After taking 40 classes, Micchell has a college potential of 3.975. Unfortunately, he needs a college potential of at least 3.995 to get into the South Harmon Institute of Technology. Otherwise, he becomes a rock. Assuming he receives a submissiveness rating of 4.0 in every class he takes from now on, how many more classes does he need to take in order to get into the South Harmon Institute of Technology? 6. Circle S1 has radius 5. Circle S2 has radius 7 and has its center lying on S1 . Circle S3 has an integer radius and has its center lying on S2 . If the center of S1 lies on S3 , how many possible values are there for the radius of S3 ? 7. Jacob’s analog clock has 12 equally spaced tick marks on the perimeter, but all the digits have been erased, so he doesn’t know which tick mark corresponds to which hour. Jacob takes an arbitrary tick mark and measures clockwise to the hour hand and minute hand. He measures that the minute hand is 300 degrees clockwise of the tick mark, and that the hour hand is 70 degrees clockwise of the same tick mark. If it is currently morning, how many minutes past midnight is it? 8. How many ways are there to choose (not necessarily distinct) integers a, b, c from the set {1, 2, 3, 4} c such that a(b ) is divisible by 4? 9. David has a collection of 40 rocks, 30 stones, 20 minerals and 10 gemstones. An operation consists of removing three objects, no two of the same type. What is the maximum number of operations he can possibly perform? 10. At certain store, a package of 3 apples and 12 oranges costs 5 dollars, and a package of 20 apples and 5 oranges costs 13 dollars. Given that apples and oranges can only be bought in these two packages, what is the minimum nonzero amount of dollars that must be spent to have an equal number of apples and oranges? 11. Let A, B, and C be distinct points on a line with AB = AC = 1. Square ABDE and equilateral triangle ACF are drawn on the same side of line BC. What is the degree measure of the acute angle formed by lines EC and BF ?

January 2012

Winter OMO 2012-2013

Page 2

12. There are 25 ants on a number line; five at each of the coordinates 1, 2, 3, 4, and 5. Each minute, one ant moves from its current position to a position one unit away. What is the minimum number of minutes that must pass before it is possible for no two ants to be on the same coordinate? 13. There are three flies of negligible size that start at the same position on a circular track with circumference 1000 meters. They fly clockwise at speeds of 2, 6, and k meters per second, respectively, where k is some positive integer with 7 ≤ k ≤ 2013. Suppose that at some point in time, all three flies meet at a location different from their starting point. How many possible values of k are there? 14. What is the smallest perfect square larger than 1 with a perfect square number of positive integer factors? 15. A permutation a1 , a2 , . . . , a13 of the numbers from 1 to 13 is given such that ai > 5 for i = 1, 2, 3, 4, 5. Determine the maximum possible value of aa1 + aa2 + aa3 + aa4 + aa5 . 16. Let S1 and S2 be two circles intersecting at points A and B. Let C and D be points on S1 and S2 respectively such that line CD is tangent to both circles and A is closer to line CD than B. If ∠BCA = 52◦ and ∠BDA = 32◦ , determine the degree measure of ∠CBD. 17. Determine the number of ordered pairs of positive integers (x, y) with y < x ≤ 100 such that x2 − y 2 and x3 − y 3 are relatively prime. (Two numbers are relatively prime if they have no common factor other than 1.) 18. Determine the absolute value of the sum b2013 sin 0◦ c + b2013 sin 1◦ c + · · · + b2013 sin 359◦ c, where bxc denotes the greatest integer less than or equal to x. (You may use the fact that sin n◦ is irrational for positive integers n not divisible by 30.) 19. A, B, C are points in the plane such that ∠ABC = 90◦ . Circles with diameters BA and BC meet at D. If BA = 20 and BC = 21, then the length of segment BD can be expressed in the form m n where m and n are relatively prime positive integers. What is m + n? n for 20. Let a1 , a2 , . . . , a2013 be a permutation of the numbers from 1 to 2013. Let An = a1 +a2 +···+a n n = 1, 2, . . . , 2013. If the smallest possible difference between the largest and smallest values of A1 , A2 , . . . , A2013 is m n , where m and n are relatively prime positive integers, find m + n.

21. Dirock has a very neat rectangular backyard that can be represented as a 32 × 32 grid of unit squares. The rows and columns are each numbered 1, 2, . . . , 32. Dirock is very fond of rocks, and places a rock in every grid square whose row and column number are both divisible by 3. Dirock would like to build a rectangular fence with vertices at the centers of grid squares and sides parallel to the sides of the yard such that a) The fence does not pass through any grid squares containing rocks; b) The interior of the fence contains exactly 5 rocks. In how many ways can this be done? 22. In triangle ABC, AB = 28, AC = 36, and BC = 32. Let D be the point on segment BC satisfying ∠BAD = ∠DAC, and let E be the unique point such that DE k AB and line AE is tangent to the circumcircle of ABC. Find the length of segment AE.

January 2012

Winter OMO 2012-2013

Page 3

23. A set of 10 distinct integers S is chosen. Let M be the number of nonempty subsets of S whose elements have an even sum. What is the minimum possible value of M ? Clarifications. • S is the “set of 10 distinct integers” from the first sentence. 24. For a permutation π of the integers from 1 to 10, define S(π) =

9 X

(π(i) − π(i + 1)) · (4 + π(i) + π(i + 1)),

i=1

where π(i) denotes the ith element of the permutation. Suppose that M is the maximum possible value of S(π) over all permutations π of the integers from 1 to 10. Determine the number of permutations π for which S(π) = M . 25. Positive integers x, y, z ≤ 100 satisfy 1099x + 901y + 1110z = 59800 109x + 991y + 101z = 44556 Compute 10000x + 100y + z. 26. In triangle ABC, F is on segment AB such that CF bisects ∠ACB. Points D and E are on line CF such that lines AD, BE are perpendicular to CF . M is the midpoint of AB. If M E = 13, AD = 15, and BE = 25, find AC + CB. 27. Geodude wants to assign one of the integers 1, 2, 3, . . . , 11 to each lattice point (x, y, z) in a 3D Cartesian coordinate system. In how many ways can Geodude do this if for every lattice parallelogram ABCD, the positive difference between the sum of the numbers assigned to A and C and the sum of the numbers assigned to B and D must be a multiple of 11? (A lattice point is a point with all integer coordinates. A lattice parallelogram is a parallelogram with all four vertices lying on lattice points.) Clarifications. • The “positive difference” between two real numbers x and y is the quantity |x − y|. 28. Let S be the set of all lattice points (x, y) in the plane satisfying |x| + |y| ≤ 10. Let P1 , P2 , . . . , P2013 be a sequence of 2013 (not necessarily distinct) points such that for every point Q in S, there exists at least one index i such that 1 ≤ i ≤ 2013 and Pi = Q. Suppose that √ the minimum possible value of |P1 P2 | + |P2 P3 | + · · · + |P2012 P2013 | can be expressed in the form a + b c, where a, b, c are positive integers and c is not divisible by the square of any prime. Find a + b + c. (A lattice point is a point with all integer coordinates.) Clarifications. • k = 2013, i.e. the problem should read, “. . . there exists at least one index i such that 1 ≤ i ≤ 2013 . . . ”. An earlier version of the test read 1 ≤ i ≤ k. 29. Let φ(n) denote the number of positive integers less than or equal to n that are relatively prime to n, and let d(n) denote the number of positive integer divisors of n. For example, φ(6) = 2 and d(6) = 4. Find the sum of all odd integers n ≤ 5000 such that n | φ(n)d(n). 30. Pairwise distinct points P1 , P2 , . . . , P16 lie on the perimeter of a square with side length 4 centered at O such that |Pi Pi+1 | = 1 for i = 1, 2, . . . , 16. (We take P17 to be the point P1 .) We construct points Q1 , Q2 , . . . , Q16 as follows: for each i, a fair coin is flipped. If it lands heads, we define Qi to be Pi ; otherwise, we define Qi to be the reflection of Pi over O. (So, it is possible for some of the Qi to −−→ −−→ −−−→ coincide.) Let D be the length of the vector OQ1 + OQ2 + · · · + OQ16 . Compute the expected value 2 of D .

January 2012

Winter OMO 2012-2013

Page 4

31. Beyond the Point of No Return is a large lake containing 2013 islands arranged at the vertices of a regular 2013-gon. Adjacent islands are joined with exactly two bridges. Christine starts on one of the islands with the intention of burning all the bridges. Each minute, if the island she is on has at least one bridge still joined to it, she randomly selects one such bridge, crosses it, and immediately burns it. Otherwise, she stops. If the probability Christine burns all the bridges before she stops can be written as prime positive integers m and n, find the remainder when m + n is divided by 1000.

m n

for relatively

32. In 4ABC with incenter I, AB = 61, AC = 51, and BC = 71. The circumcircles of triangles AIB and AIC meet line BC at points D (D 6= B) and E (E 6= C), respectively. Determine the length of segment DE. 33. Let n be a positive integer. E. Chen and E. Chen play a game on the n2 points of an n × n lattice grid. They alternately mark points on the grid such that no player marks a point that is on or inside a non-degenerate triangle formed by three marked points. Each point can be marked only once. The game ends when no player can make a move, and the last player to make a move wins. Determine the number of values of n between 1 and 2013 (inclusive) for which the first player can guarantee a win, regardless of the moves that the second player makes. 34. For positive integers n, let s(n) denote the sum of the squares of the positive integers less than or equal to n that are relatively prime to n. Find the greatest integer less than or equal to X s(n) , n2

n|2013

where the summation runs over all positive integers n dividing 2013. 35. The rows and columns of a 7 × 7 grid are each numbered 1, 2, . . . , 7. In how many ways can one choose 8 cells of this grid such that for every two chosen cells X and Y , either the positive difference of their row numbers is at least 3, or the positive difference of their column numbers is at least 3? Clarifications. • The “or” here is inclusive (as by convention, despite the “either”), i.e. X and Y are permitted if and only if they satisfy the row condition, the column condition, or both. 36. Let ABCD be a nondegenerate isosceles trapezoid with integer side lengths such that BC k AD and AB = BC = CD. Given that the distance between the incenters of triangles ABD and ACD is 8!, determine the number of possible lengths of segment AD. 37. Let M be a positive integer. At a party with 120 people, 30 wear red hats, 40 wear blue hats, and 50 wear green hats. Before the party begins, M pairs of people are friends. (Friendship is mutual.) Suppose also that no two friends wear the same colored hat to the party. During the party, X and Y can become friends if and only if the following two conditions hold: a) There exists a person Z such that X and Y are both friends with Z. (The friendship(s) between Z, X and Z, Y could have been formed during the party.) b) X and Y are not wearing the same colored hat. Suppose the party lasts long enough so that all possible friendships are formed. Let M1 be the largest value of M such that regardless of which M pairs of people are friends before the party, there will always be at least one pair of people X and Y with different colored hats who are not friends after the party. Let M2 be the smallest value of M such that regardless of which M pairs of people are friends before the party, every pair of people X and Y with different colored hats are friends after the party. Find M1 + M2 .

January 2012

Winter OMO 2012-2013

Page 5

Clarifications. • The definition of M2 should read, “Let M2 be the smallest value of M such that. . . ”. An earlier version of the test read “largest value of M ”. 38. Triangle ABC has sides AB = 25, BC = 30, and CA = 20. Let P, Q be the points on segments AB, AC, respectively, such that AP = 5 and AQ = 4. Suppose lines BQ and CP intersect at R and the circumcircles of 4BP R and 4CQR intersect at a second point S 6= R. If the length of segment SA can be expressed in the form √mn for positive integers m, n, where n is not divisible by the square of any prime, find m + n. 39. Find the number of 8-digit base-6 positive integers (a1 a2 a3 a4 a5 a6 a7 a8 )6 (with leading zeros permitted) such that (a1 a2 . . . a8 )6 | (ai+1 ai+2 . . . ai+8 )6 for i = 1, 2, . . . , 7, where indices are taken modulo 8 (so a9 = a1 , a10 = a2 , and so on). 40. Let ABC be a triangle with AB = 13, BC = 14, and AC = 15. Let M be the midpoint of BC and let Γ be the circle passing through A and tangent to line BC at M . Let Γ intersect lines AB and AC at points D and E, respectively, and let N be the midpoint of DE. Suppose line M N intersects lines AB and AC at points P and O, respectively. If the ratio M N : N O : OP can be written in the form a : b : c with a, b, c positive integers satisfying gcd(a, b, c) = 1, find a + b + c. 41. While there do not exist pairwise distinct real numbers a, b, c satisfying a2 + b2 + c2 = ab + bc + ca, there do exist complex numbers with that property. Let a, b, c √ be complex√numbers such that a2 + b2 + c2 = ab + bc + ca and |a + b + c| = 21. Given that |a − b| = 2 3, |a| = 3 3, compute |b|2 + |c|2 . Clarifications. • The problem should read |a + b + c| = 21. An earlier version of the test read |a + b + c| = 7; that value is incorrect. • |b|2 + |c|2 should be a positive integer, not a fraction; an earlier version of the test read “. . . for relatively prime positive integers m and n. Find m + n.” 42. Find the remainder when

100 Y

(1 − i2 + i4 )

i=0

is divided by 101. 43. In a tennis tournament, each competitor plays against every other competitor, and there are no draws. Call a group of four tennis players “ordered” if there is a clear winner and a clear loser (i.e., one person who beat the other three, and one person who lost to the other three.) Find the smallest integer n for which any tennis tournament with n people has a group of four tennis players that is ordered. 44. Suppose tetrahedron P ABC has volume 420 and satisfies AB √ = 13, BC = 14, and CA = 15. The minimum possible surface area of P ABC can be written as m+n k, where m, n, k are positive integers and k is not divisible by the square of any prime. Compute m + n + k. 45. Let N denote the number of ordered 2011-tuples of positive integers (a1 , a2 , . . . , a2011 ) with 1 ≤ a1 , a2 , . . . , a2011 ≤ 20112 such that there exists a polynomial f of degree 4019 satisfying the following three properties: • f (n) is an integer for every integer n; • 20112 | f (i) − ai for i = 1, 2, . . . , 2011; • 20112 | f (n + 2011) − f (n) for every integer n.

January 2012

Winter OMO 2012-2013

Page 6

Find the remainder when N is divided by 1000. 46. Let ABC be a triangle with ∠B − ∠C = 30◦ . Let D be the point where the A-excircle touches line BC, O the circumcenter of triangle ABC, and X, Y the intersections of the altitude from A with the AO incircle with X in between A and Y . Suppose points A, O and D are collinear. If the ratio AX can be √ a+b c expressed in the form d for positive integers a, b, c, d with gcd(a, b, d) = 1 and c not divisible by the square of any prime, find a + b + c + d. 47. Let f (x, y) be a function from ordered pairs of positive integers to real numbers such that f (1, x) = f (x, 1) =

1 x

and f (x + 1, y + 1)f (x, y) − f (x, y + 1)f (x + 1, y) = 1

for all ordered pairs of positive integers (x, y). If f (100, 100) = integers m, n, compute m + n.

m n

for two relatively prime positive

48. ω is a complex number such that ω 2013 = 1 and ω m 6= 1 for m = 1, 2, . . . , 2012. Find the number of ordered pairs of integers (a, b) with 1 ≤ a, b ≤ 2013 such that (1 + ω + · · · + ω a )(1 + ω + · · · + ω b ) 3 is the root of some polynomial with integer coefficients and leading coefficient 1. (Such complex numbers are called algebraic integers.) √ 49. In 4ABC, CA = 1960 2, CB = 6720, and ∠C = 45◦ . Let K, L, M lie on BC, CA, and AB such that AK ⊥ BC, BL ⊥ CA, and AM = BM . Let N , O, P lie on KL, BA, and BL such that AN = KN , BO = CO, and A lies on line N P . If H is the orthocenter of 4M OP , compute HK 2 . Clarifications. • Without further qualification, “XY” denotes line XY. 50. Let S denote the set of words W = w1 w2 . . . wn of any length n ≥ 0 (including the empty string λ), with each letter wi from the set {x, y, z}. Call two words U, V similar if we can insert a string s ∈ {xyz, yzx, zxy} of three consecutive letters somewhere in U (possibly at one of the ends) to obtain V or somewhere in V (again, possibly at one of the ends) to obtain U , and say a word W is trivial if for some nonnegative integer m, there exists a sequence W0 , W1 , . . . , Wm such that W0 = λ is the empty string, Wm = W , and Wi , Wi+1 are similar for i = 0, 1, . . . , m − 1. Given that for two relatively prime positive integers p, q we have  n p X 225 = f (n) , q 8192 n≥0

where f (n) denotes the number of trivial words in S of length 3n (in particular, f (0) = 1), find p+q.

The Online Math Open Spring Contest April 4 - 15, 2014

Contest Director • Evan Chen

Contributors and Readers • Ray Li • Robin Park

Problem Czars

• Victor Wang

• Evan Chen • Michael Kural • Sammy Luo

Website Manager • Douglas Chen

• Yang Liu

LATEX/Python Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in whichever contests they like. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2014 Spring Contest will consist of 30 problems; the answer to each problem will be a nonnegative integer not exceeding 232 − 1 = 4294967295. The contest window will be April 4 - 15, 2014, from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids are prohibited, including scientific calculators, graphing calculators, or computer programs. All problems on the Online Math Open are solvable without a calculator. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate about the contest until the contest ends. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Problem m is harder than problem n if fewer teams solve problem m, or if the number of solves is equal and m > n. Remaining ties will be broken by the second hardest problem solved, and so on. 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Spring 2014 April 4 - 15, 2014 1. In English class, you have discovered a mysterious phenomenon – if you spend n hours on an essay, your score on the essay will be 100 (1 − 4−n ) points if 2n is an integer, and 0 otherwise. For example, if you spend 30 minutes on an essay you will get a score of 50, but if you spend 35 minutes on the essay you somehow do not earn any points. It is 4AM, your English class starts at 8:05AM the same day, and you have four essays due at the start of class. If you can only work on one essay at a time, what is the maximum possible average of your essay scores? 2. Consider two circles of radius one, and let O and O0 denote their centers. Point M is selected on either circle. If OO0 = 2014, what is the largest possible area of triangle OM O0 ? 3. Suppose that m and n are relatively prime positive integers with A = A=

m n,

where

2 + 4 + 6 + · · · + 2014 1 + 3 + 5 + · · · + 2013 − . 1 + 3 + 5 + · · · + 2013 2 + 4 + 6 + · · · + 2014

Find m. In other words, find the numerator of A when A is written as a fraction in simplest form. 4. The integers 1, 2, . . . , n are written in order on a long slip of paper. The slip is then cut into five pieces, so that each piece consists of some (nonempty) consecutive set of integers. The averages of the numbers on the five slips are 1234, 345, 128, 19, and 9.5 in some order. Compute n. 5. Joe the teacher is bad at rounding. Because of this, he has come up with his own way to round grades, where a grade is a nonnegative decimal number with finitely many digits after the decimal point. Given a grade with digits a1 a2 . . . am .b1 b2 . . . bn , Joe first rounds the number to the nearest 10−n+1 th place. He then repeats the procedure on the new number, rounding to the nearest 10−n+2 th, then rounding the result to the nearest 10−n+3 th, and so on, until he obtains an integer. For example, he rounds the number 2014.456 via 2014.456 → 2014.46 → 2014.5 → 2015. There exists a rational number M such that a grade x gets rounded to at least 90 if and only if x ≥ M . If M = pq for relatively prime integers p and q, compute p + q. 6. Let Ln be the least common multiple of the integers 1, 2, . . . , n. For example, L10 = 2,520 and L30 = 2,329,089,562,800. Find the remainder when L31 is divided by 100,000. 7. How many integers n with 10 ≤ n ≤ 500 have the property that the hundreds digit of 17n and 17n + 17 are different? 8. Let a1 , a2 , a3 , a4 , a5 be real numbers satisfying 2a1 + a2 + a3 + a4 + a5 = 1 + 18 a4 2a2 + a3 + a4 + a5 = 2 + 41 a3 2a3 + a4 + a5 = 4 + 21 a2 2a4 + a5 = 6 + a1 Compute a1 + a2 + a3 + a4 + a5 . 9. Eighteen students participate in a team selection test with three problems, each worth up to seven points. All scores are nonnegative integers. After the competition, the results are posted by Evan in a table with 3 columns: the student’s name, score, and rank (allowing ties), respectively. Here, a student’s rank is one greater than the number of students with strictly higher scores (for example, if seven students score 0, 0, 7, 8, 8, 14, 21 then their ranks would be 6, 6, 5, 3, 3, 2, 1 respectively). When Richard comes by to read the results, he accidentally reads the rank column as the score column and vice versa. Coincidentally, the results still made sense! If the scores of the students were x1 ≤ x2 ≤ · · · ≤ x18 , determine the number of possible values of the 18-tuple (x1 , x2 , . . . , x18 ). In other words, determine the number of possible multisets (sets with repetition) of scores. 1

OMO Spring 2014 April 4 - 15, 2014 10. Let A1 A2 . . . A4000 be a regular 4000-gon. Let X be the foot of the altitude from A1986 onto diagonal A1000 A3000 , and let Y be the foot of the altitude from A2014 onto A2000 A4000 . If XY = 1, what is the area of square A500 A1500 A2500 A3500 ? 11. Let X be a point inside convex quadrilateral ABCD with ∠AXB + ∠CXD = 180◦ . If AX = 14, BX = 11, CX = 5, DX = 10, and AB = CD, find the sum of the areas of 4AXB and 4CXD. 12. The points A, B, C, D, E lie on a line ` in this order. Suppose T is a point not on ` such that ∠BT C = ∠DT E, and AT is tangent to the circumcircle of triangle BT E. If AB = 2, BC = 36, and CD = 15, compute DE. 13. Suppose that g and h are polynomials of degree 10 with integer coefficients such that g(2) < h(2) and g(x)h(x) =

 10  X k + 11 k=0

k

x

20−k



    21 − k k−1 21 k−1 − x + x 11 11

holds for all nonzero real numbers x. Find g(2). 14. Let ABC be a triangle with incenter I and AB = 1400, AC = 1800, BC = 2014. The circle centered at I passing through A intersects line BC at two points X and Y . Compute the length XY . 15. In Prime Land, there are seven major cities, labelled C0 , C1 , . . . , C6 . For convenience, we let Cn+7 = Cn for each n = 0, 1, . . . , 6; i.e. we take the indices modulo 7. Al initially starts at city C0 . Each minute for ten minutes, Al flips a fair coin. If the coin land heads, and he is at city Ck , he moves to city C2k ; otherwise he moves to city C2k+1 . If the probability that Al is back at city C0 after 10 m , find m. moves is 1024 √ 16. Say a positive integer n is radioactive if one of its prime factors is strictly greater than n. For example, 2012 = 22 · 503, 2013 = 3 · 11 · 61 and 2014 = 2 · 19 · 53 are all radioactive, but 2015 = 5 · 13 · 31 is not. How many radioactive numbers have all prime factors less than 30? 17. Let AXY BZ be a convex pentagon inscribed in a circle with diameter AB. The tangent to the circle at Y intersects lines BX and BZ at L and K, respectively. Suppose that AY bisects ∠LAZ and AY = Y Z. If the minimum possible value of AK + AX can be written as m + 10n + 100k.

m n

+





AL AB

2

k, where m, n and k are positive integers with gcd(m, n) = 1, compute

18. Find the number of pairs (m, n) of integers with −2014 ≤ m, n ≤ 2014 such that x3 + y 3 = m + 3nxy has infinitely many integer solutions (x, y). 19. Find the sum of all positive integers n such that τ (n)2 = 2n, where τ (n) is the number of positive integers dividing n. 20. Let ABC be an acute triangle with circumcenter O, and select E on AC and F on AB so that BE ⊥ AC, CF ⊥ AB. Suppose ∠EOF − ∠A = 90◦ and ∠AOB − ∠B = 30◦ . If the maximum possible ◦ measure of ∠C is m n · 180 for some positive integers m and n with m < n and gcd(m, n) = 1, compute m + n. √ 21. Let b = 21 (−1 + 3 5). Determine the number of rational numbers which can be written in the form a2014 b2014 + a2013 b2013 + · · · + a1 b + a0 where a0 , a1 , . . . , a2014 are nonnegative integers less than b. 2

OMO Spring 2014 April 4 - 15, 2014 22. Let f (x) be a polynomial with integer coefficients such that f (15)f (21)f (35) − 10 is divisible by 105. Given f (−34) = 2014 and f (0) ≥ 0, find the smallest possible value of f (0). 23. Let Γ1 and Γ2 be circles in the plane with centers O1 and O2 and radii 13 and 10, respectively. Assume O1 O2 = 2. Fix a circle Ω with radius 2, internally tangent to Γ1 at P and externally tangent to Γ2 at Q . Let ω be a second variable circle internally tangent to Γ1 at X and externally tangent to Γ2 at Y . Line P Q meets Γ2 again at R, line XY meets Γ2 again at Z, and lines P Z and XR meet at M . As ω varies, the locus of point M encloses a region of area positive integers. Compute p + q.

p q π,

where p and q are relatively prime

24. Let P denote the set of planes in three-dimensional space with positive x, y, and z intercepts summing to one. A point (x, y, z) with min{x, y, z} > 0 lies on exactly one plane in P. What is the maximum −1 possible integer value of 41 x2 + 2y 2 + 16z 2 ? 25. If

∞ X

1 1

+

n=1

1 1 2 + ··· + n  n+100 100

=

p q

for relatively prime positive integers p, q, find p + q. 26. Qing initially writes the ordered pair (1, 0) on a blackboard. Each minute, if the pair (a, b) is on the board, she erases it and replaces it with one of the pairs (2a − b, a), (2a + b + 2, a) or (a + 2b + 2, b). Eventually, the board reads (2014, k) for some nonnegative integer k. How many possible values of k are there? 27. A frog starts at 0 on a number line and plays a game. On each turn the frog chooses at random to jump 1 or 2 integers to the right or left. It stops moving if it lands on a nonpositive number or a number on which it has already landed. If the expected number of times it will jump is pq for relatively prime positive integers p and q, find p + q. 28. In the game of Nim, players are given several piles of stones. On each turn, a player picks a nonempty pile and removes any positive integer number of stones from that pile. The player who removes the last stone wins, while the first player who cannot move loses. Alice, Bob, and Chebyshev play a 3-player version of Nim where each player wants to win but avoids losing at all costs (there is always a player who neither wins nor loses). Initially, the piles have sizes 43, 99, x, y, where x and y are positive integers. Assuming that the first player loses when all players play optimally, compute the maximum possible value of xy. 29. Let ABCD be a tetrahedron whose six side lengths are all integers, and let N denote the sum of these side lengths. There exists a point P inside ABCD such that the feet from P onto the faces of the tetrahedron are the orthocenter of 4ABC, centroid of 4BCD, circumcenter of 4CDA, and orthocenter of 4DAB. If CD = 3 and N < 100,000, determine the maximum possible value of N . 30. For a positive integer n, an n-branch B is an ordered tuple (S1 , S2 , . . . , Sm ) of nonempty sets (where m is any positive integer) satisfying S1 ⊂ S2 ⊂ · · · ⊂ Sm ⊆ {1, 2, . . . , n}. An integer x is said to appear in B if it is an element of the last set Sm . Define an n-plant to be an (unordered) set of n-branches {B1 , B2 , . . . , Bk }, and call it perfect if each of 1, 2, . . . , n appears in exactly one of its branches. Let Tn be the number of distinct perfect n-plants (where T0 = 1), and suppose that for some positive real number x we have the convergence   n X (ln x) = 6 . ln  Tn · n! 29 n≥0

If x =

m n

for relatively prime positive integers m and n, compute m + n.

3

The Online Math Open Fall Contest October 17 - 28, 2014

Acknowledgements Head Problem Writers • Evan Chen • Michael Kural • Sammy Luo • Yang Liu • Robin Park • Ryan Alweiss

Problem Contributors, Proofreaders, and Test Solvers • Ray Li • Victor Wang • Jack Gurev

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in whichever contests they like. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2014 Fall Contest will consist of 30 problems; the answer to each problem will be an integer between 0 and 231 − 1 = 2147483647 inclusive. The contest window will be October 17 - 28, 2014 from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids, including scientific calculators, graphing calculators, or computer programs is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate with each other about the contest while the contest is running. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. (Problem m is harder than problem n if fewer teams solve problem m OR if the number of solves is equal and m > n.) 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Fall 2014 October 17 - 28, 2014 1. Carl has a rectangle whose side lengths are positive integers. This rectangle has the property that when he increases the width by 1 unit and decreases the length by 1 unit, the area increases by x square units. What is the smallest possible positive value of x? 2. Suppose (an ), (bn ), (cn ) are arithmetic progressions. Given that a1 + b1 + c1 = 0 and a2 + b2 + c2 = 1, compute a2014 + b2014 + c2014 . 3. Let B = (20, 14) and C = (18, 0) be two points in the plane. For every line ` passing through B, we color red the foot of the perpendicular from C to `. The set of red points enclose a bounded region of area A. Find bAc (that is, find the greatest integer not exceeding A). 4. A crazy physicist has discovered a new particle called an emon. He starts with two emons in the plane, situated a distance 1 from each other. He also has a crazy machine which can take any two emons and create a third one in the plane such that the three emons lie at the vertices of an equilateral triangle. After he has five total emons, let P be the product of the 52 = 10 distances between the 10 pairs of emons. Find the greatest possible value of P 2 . 5. A crazy physicist has discovered a new particle called an omon. He has a machine, which takes two omons of mass a and b and entangles them; this process destroys the omon with mass a, preserves the one with mass b, and creates a new omon whose mass is 21 (a + b). The physicist can then repeat the process with the two resulting omons, choosing which omon to destroy at every step. The physicist initially has two omons whose masses are distinct positive integers less than 1000. What is the maximum possible number of times he can use his machine without producing an omon whose mass is not an integer? 6. For an olympiad geometry problem, Tina wants to draw an acute triangle whose angles each measure a multiple of 10◦ . She doesn’t want her triangle to have any special properties, so none of the angles can measure 30◦ or 60◦ , and the triangle should definitely not be isosceles. How many different triangles can Tina draw? (Similar triangles are considered the same.) 7. Define the function f (x, y, z) by z

y

x

z

y

f (x, y, z) = xy − xz + y z − y x + z x . Evaluate f (1, 2, 3) + f (1, 3, 2) + f (2, 1, 3) + f (2, 3, 1) + f (3, 1, 2) + f (3, 2, 1). 8. Let a and b be randomly selected three-digit integers and suppose a > b. We say that a is clearly bigger than b if each digit of a is larger than the corresponding digit of b. If the probability that a is clearly bigger than b is m n , where m and n are relatively prime integers, compute m + n. 9. Let N = 2014!+2015!+2016!+· · ·+9999!. How many zeros are at the end of the decimal representation of N ? 10. Find the sum of the decimal digits of   51525354555657 . . . 979899 . 50 Here bxc is the greatest integer not exceeding x. 11. Given a triangle ABC, consider the semicircle with diameter EF on BC tangent to AB and AC. If BE = 1, EF = 24, and F C = 3, find the perimeter of 4ABC. 12. Let a, b, c be positive real numbers for which 5 = b + c, a If a + b + c =

m n

10 = c + a, b

and

13 = a + b. c

for relatively prime positive integers m and n, compute m + n. 1

OMO Fall 2014 October 17 - 28, 2014 13. Two ducks, Wat and Q, are taking a math test with 1022 other ducklings. The test has 30 questions, and the nth question is worth n points. The ducks work independently on the test. Wat gets the 1 nth problem correct with probability n12 while Q gets the nth problem correct with probability n+1 . Unfortunately, the remaining ducklings each answer all 30 questions incorrectly. Just before turning in their test, the ducks and ducklings decide to share answers! On any question which Wat and Q have the same answer, the ducklings change their answers to agree with them. After this process, what is the expected value of the sum of all 1024 scores? 14. What is the greatest common factor of 12345678987654321 and 12345654321? √

15. Let φ = 1+2 5 . A base-φ number (an an−1 . . . a1 a0 )φ , where 0 ≤ an , an−1 , . . . , a0 ≤ 1 are integers, is defined by (an an−1 . . . a1 a0 )φ = an · φn + an−1 · φn−1 + . . . + a1 · φ1 + a0 . Compute the number of base-φ numbers (bj bj−1 . . . b1 b0 )φ which satisfy bj 6= 0 and (bj bj−1 . . . b1 b0 )φ = (100 . . . 100)φ . {z } | Twenty 1000 s

16. Let OABC be a tetrahedron such that ∠AOB = ∠BOC = ∠COA = 90◦ and its faces have integral surface areas. If [OAB] = 20 and [OBC] = 14, find the sum of all possible values of [OCA][ABC]. (Here [4] denotes the area of 4.) 17. Let ABC be a triangle with area 5 and BC = 10. Let E and F be the midpoints of sides AC and AB respectively, and let BE and CF intersect at G. Suppose that quadrilateral AEGF can be inscribed in a circle. Determine the value of AB 2 + AC 2 . 18. We select a real number α uniformly and at random from the interval (0, 500). Define  1000 1000  1 X X m+α . α m=1 n=m n

S=

Let p denote the probability that S ≥ 1200. Compute 1000p. 19. In triangle ABC, AB = 3, AC = 5, and BC = 7. Let E be the reflection of A over BC, and let line BE meet the circumcircle of ABC again at D. Let I be the incenter of 4ABD. Given that cos2 ∠AEI = m n , where m and n are relatively prime positive integers, determine m + n. (0)

(0)

(0)

20. Let n = 2188 = 37 + 1 and let A0 , A1 , . . . , An−1 be the vertices of a regular n-gon (in that order) (i) with center O . For i = 1, 2, . . . , 7 and j = 0, 1, . . . , n − 1, let Aj denote the centroid of the triangle (i−1)

4Aj

(i−1)

(i−1)

Aj+37−i Aj+2·37−i .

Here the subscripts are taken modulo n. If (7)

|OA2014 | (0) |OA2014 |

=

p q

for relatively prime positive integers p and q, find p + q. 21. Consider a sequence x1 , x2 , · · · x12 of real numbers such that x1 = 1 and for n = 1, 2, . . . , 10 let xn+2 =

(xn+1 + 1)(xn+1 − 1) . xn √

Suppose xn > 0 for n = 1, 2, . . . , 11 and x12 = 0. Then the value of x2 can be written as positive integers a, b, c with a > b and no square dividing a or b. Find 100a + 10b + c. 2

√ a+ b c

for

OMO Fall 2014 October 17 - 28, 2014 22. Find the smallest positive integer c for which the following statement holds: Let k and n be positive integers. Suppose there exist pairwise distinct subsets S1 , S2 , . . . , S2k of {1, 2, . . . , n}, such that Si ∩ Sj 6= ∅ and Si ∩ Sj+k 6= ∅ for all 1 ≤ i, j ≤ k. Then 1000k ≤ c · 2n . 23. For a prime q, let Φq (x) = xq−1 + xq−2 + · · · + x + 1. Find the sum of all primes p such that 3 ≤ p ≤ 100 and there exists an odd prime q and a positive integer N satisfying     N 2Φq (p) ≡ 6≡ 0 (mod p). Φq (p) N 24. Let A = A0 A1 A2 A3 · · · A2013 A2014 be a regular 2014-simplex, meaning the 2015 vertices of A lie in 2014-dimensional Euclidean space and there exists a constant c > 0 such that Ai Aj = c for any 0 ≤ i < j ≤ 2014. Let O = (0, 0, 0, . . . , 0), A0 = (1, 0, 0, . . . , 0), and suppose Ai O has length 1 for i = 0, 1, . . . , 2014. Set P = (20, 14, 20, 14, . . . , 20, 14). Find the remainder when P A20 + P A21 + · · · + P A22014 is divided by 106 . 25. Kevin has a set S of 2014 points scattered on an infinitely large planar gameboard. Because he is bored, he asks Ashley to evaluate x = 4f4 + 6f6 + 8f8 + 10f10 + · · · while he evaluates y = 3f3 + 5f5 + 7f7 + 9f9 + · · · , where fk denotes the number of convex k-gons whose vertices lie in S but none of whose interior points lie in S. However, since Kevin wishes to one-up everything that Ashley does, he secretly positions the points so that y − x is as large as possible, but in order to avoid suspicion, he makes sure no three points lie on a single line. Find |y − x|. 26. Let ABC be a triangle with AB = 26, AC = 28, BC = 30. Let X, Y , Z be the midpoints of arcs BC, CA, AB (not containing the opposite vertices) respectively on the circumcircle of ABC. Let P be the midpoint of arc BC containing point A. Suppose lines BP and XZ meet at M , while lines CP and XY meet at N . Find the square of the distance from X to M N . 27. Let p = 216 + 1 be a prime, and let S be the set of positive integers not divisible by p. Let f : S → {0, 1, 2, . . . , p − 1} be a function satisfying f (x)f (y) ≡ f (xy) + f (xy p−2 )

(mod p)

and f (x + p) = f (x)

for all x, y ∈ S. Let N be the product of all possible nonzero values of f (81). Find the remainder when when N is divided by p. 28. Let S be the set of all pairs (a, b) of real numbers satisfying 1 + a + a2 + a3 = b2 (1 + 3a) and 1 + 2a + 3a2 = b2 − 5b . Find A + B + C, where Y Y X A= a, B = b, and C = ab. (a,b)∈S

(a,b)∈S

(a,b)∈S

29. Let ABC be a triangle with circumcenter O, incenter I, and circumcircle Γ. It is known that AB = 7, \ of Γ, and let D denote the intersection BC = 8, CA = 9. Let M denote the midpoint of major arc BAC of Γ with the circumcircle of 4IM O (other than M ). Let E denote the reflection of D over line IO. Find the integer closest to 1000 · BE CE . + . . . + n1 . Compute the remainder when   p−1 X 2p − 2n (p − 1)! Hn · 4n · p−n n=1

30. Let p = 216 + 1 be an odd prime. Define Hn = 1 +

is divided by p. 3

1 2

+

1 3

The Online Math Open Spring Contest April 3 - 14, 2015

Acknowledgements Head Problem Writers • Yang Liu • Michael Kural • Robin Park • Evan Chen

Problem Contributors, Proofreaders, and Test Solvers • Sammy Luo • Ryan Alweiss • Ray Li • Victor Wang • Jack Gurev

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in whichever contests they like. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2015 Spring Contest will consist of 30 problems; the answer to each problem will be an integer between 0 and 231 − 1 = 2147483647 inclusive. The contest window will be April 3 - 14, 2015 from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids, including scientific calculators, graphing calculators, or computer programs is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate with each other about the contest while the contest is running. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. (Problem m is harder than problem n if fewer teams solve problem m OR if the number of solves is equal and m > n.) 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Spring 2015 April 3 - 14, 2015 1. What is the largest positive integer which is equal to the sum of its digits? 2. A classroom has 30 students, each of whom is either male or female. For every student S, we define his or her ratio to be the number of students of the opposite gender as S divided by the number of students of the same gender as S (including S). Let Σ denote the sum of the ratios of all 30 students. Find the number of possible values of Σ. 3. On a large wooden block there are four twelve-hour analog clocks of varying accuracy. At 7PM on April 3, 2015, they all correctly displayed the time. The first clock is accurate, the second clock is two times as fast as the first clock, the third clock is three times as fast as the first clock, and the last clock doesn’t move at all. How many hours must elapse (from 7PM) before the times displayed on the clocks coincide again? (The clocks do not distinguish between AM and PM.)

11 12 1

11 12 1 10

2

9

3

8

4 7

6

5

10

11 12 1 2

9

3

8

4 7

I

6

7:00

5:06

1:44

10:22

5

10

11 12 1 2

9

3

8

4 7

6

5

III

II

10

2

9

3

8

4 7

6

5

IV

Omnes vulnerant, postuma necat 4. Find the sum of all distinct possible values of x2 − 4x + 100, where x is an integer between 1 and 100, inclusive. 5. Let ABC be an isosceles triangle with ∠A = 90◦ . Points D and E are selected on sides AB and AC, √ and points X√and Y are the feet of the altitudes from D and E to side BC. Given that AD = 48 2 and AE = 52 2, compute XY . 6. We delete the four corners of a 8×8 chessboard. How many ways are there to place eight non-attacking rooks on the remaining squares? 7. A geometric progression of positive integers has n terms; the first term is 102015 and the last term is an odd positive integer. How many possible values of n are there? 8. Determine the number of sequences of positive integers 1 = x0 < x1 < · · · < x10 = 105 with the property that for each m = 0, . . . , 9 the number xxm+1 is a prime number. m 9. Find the sum of the decimal digits of the number 5

99 X

k(k + 1)(k 2 + k + 1).

k=1

10. Nicky has a circle. To make his circle look more interesting, he draws a regular 15-gon, 21-gon, and 35-gon such that all vertices of all three polygons lie on the circle. Let n be the number of distinct vertices on the circle. Find the sum of the possible values of n. 11. Let S be a set. We say S is D∗ -finite if there exists a function f : S → S such that for every nonempty proper subset Y ( S, there exists a y ∈ Y such that f (y) ∈ / Y . The function f is called a witness of S. How many witnesses does {0, 1, · · · , 5} have? 12. At the Intergalactic Math Olympiad held in the year 9001, there are 6 problems, and on each problem you can earn an integer score from 0 to 7. The contestant’s score is the product of the scores on the 6 problems, and ties are broken by the sum of the 6 problems. If 2 contestants are still tied after this, their ranks are equal. In this olympiad, there are 86 = 262144 participants, and no two get the same score on every problem. Find the score of the participant whose rank was 76 = 117649. 1

OMO Spring 2015 April 3 - 14, 2015 13. Let ABC be a scalene triangle whose side lengths are positive integers. It is called stable if its three side lengths are multiples of 5, 80, and 112, respectively. What is the smallest possible side length that can appear in any stable triangle? 14. Let ABCD be a square with side length 2015. A disk with unit radius is packed neatly inside corner A (i.e. tangent to both AB and AD). Alice kicks the disk, which bounces off CD, BC, AB, DA, DC in that order, before landing neatly into corner B. What is the total distance the center of the disk travelled? 15. Let a, b, c, and d be positive real numbers such that a2 + b2 − c2 − d2 = 0

and a2 − b2 − c2 + d2 =

56 (bc + ad). 53

ab+cd Let M be the maximum possible value of bc+ad . If M can be expressed as relatively prime positive integers, find 100m + n.

m n,

where m and n are

16. Joe is given a permutation p = (a1 , a2 , a3 , a4 , a5 ) of (1, 2, 3, 4, 5). A swap is an ordered pair (i, j) with 1 ≤ i < j ≤ 5, and this allows Joe to swap the positions i and j in the permutation. For example, if Joe starts with the permutation (1, 2, 3, 4, 5), and uses the swaps (1, 2) and (1, 3), the permutation becomes (1, 2, 3, 4, 5) → (2, 1, 3, 4, 5) → (3, 1, 2, 4, 5).  5 Out of all 2 = 10 swaps, Joe chooses 4 of them to be in a set of swaps S. Joe notices that from p he could reach any permutation of (1, 2, 3, 4, 5) using only the swaps in S. How many different sets are possible? 17. Let A, B, M, C, D be distinct points on a line such that AB = BM = M C = CD = 6. Circles ω1 and ω2 with centers O1 and O2 and radius 4 and 9 are tangent to line AD at A and D respectively such that O1 , O2 lie on the same side of line AD. Let P be the point such that P B ⊥ O1 M and P C ⊥ O2 M. Determine the value of P O22 − P O12 . 18. Alex starts with a rooted tree with one vertex (the root). For a vertex v, let the size of the subtree of v be S(v). Alex plays a game that lasts nine turns. At each turn, he randomly selects a vertex in the tree, and adds a child vertex to that vertex. After nine turns, he has ten total vertices. Alex selects one of these vertices at random (call the vertex v1 ). The expected value of S(v1 ) is of the form m n for relatively prime positive integers m, n. Find m + n. Note: In a rooted tree, the subtree of v consists of its indirect or direct descendants (including v itself). 19. Let ABC be a triangle with AB = 80, BC = 100, AC = 60. Let D, E, F lie on BC, AC, AB such that CD = 10, AE = 45, BF = 60. Let P be a point in the plane of triangle ABC. minimum possible √ √ The √ value of AP + BP + CP + DP + EP + F P can be expressed in the form x + y + z for integers x, y, z. Find x + y + z. 20. Consider polynomials P of degree 2015, all of whose coefficients are in the set {0, 1, . . . , 2010}. Call such a polynomial good if for every integer m, one of the numbers P (m) − 20, P (m) − 15, P (m) − 1234 is divisible by 2011, and there exist integers m20 , m15 , m1234 such that P (m20 ) − 20, P (m15 ) − 15, P (m1234 ) − 1234 are all multiples of 2011. Let N be the number of good polynomials. Find the remainder when N is divided by 1000. 21. Let A1 A2 A3 A4 A5 be a regular pentagon inscribed in a circle with area −−−−→ points Bi and Ci lie on ray Ai Ai+1 such that

where indices are taken modulo 5. The value of P) can be expressed as 100a + 10b + c.

For each i = 1, 2, . . . , 5,

and Ci Ai · Ci Ai+1 = Ci A2i+2

Bi Ai · Bi Ai+1 = Bi Ai+2 √ a+b 5 , c

√ 5+ 5 10 π.

[B1 B2 B3 B4 B5 ] [C1 C2 C3 C4 C5 ]

(where [P] denotes the area of polygon

where a, b, and c are integers, and c > 0 is as small as possible. Find 2

OMO Spring 2015 April 3 - 14, 2015 22. For a positive integer n let n# denote the product of all primes less than or equal to n (or 1 if there are no such primes), and let F (n) denote the largest integer k for which k# divides n. Find the remainder when F (1) + F (2) + F (3) + · · · + F (2015# − 1) + F (2015#) is divided by 3999991. 23. Let N = 12! and denote by X the set of positive divisors of N other than 1. An pseudo-ultrafilter U is a nonempty subset of X such that for any a, b ∈ X: • If a divides b and a ∈ U then b ∈ U . • If a, b ∈ U then gcd(a, b) ∈ U . • If a, b ∈ / U then lcm(a, b) ∈ / U. How many such pseudo-ultrafilters are there? 24. Suppose we have 10 balls and 10 colors. For each ball, we (independently) color it one of the 10 colors, then group the balls together by color at the end. If S is the expected value of the square of the number of distinct colors used on the balls, find the sum of the digits of S written as a decimal. 25. Let V0 = ∅ be the empty set and recursively define Vn+1 to be the set of all 2|Vn | subsets of Vn for each n = 0, 1, . . . . For example V2 = {∅, {∅}}

and V3 = {∅, {∅} , {{∅}} , {∅, {∅}}} .

A set x ∈ V5 is called transitive if each element of x is a subset of x. How many such transitive sets are there? 26. Consider a sequence T0 , T1 , . . . of polynomials defined recursively by T0 (x) = 2, T1 (x) = x, and Tn+2 (x) = xTn+1 (x)−Tn (x) for each nonnegative integer n. Let Ln be the sequence of Lucas Numbers, defined by L0 = 2, L1 = 1, and Ln+2 = Ln + Ln+1 for every nonnegative integer n. Find the remainder when T0 (L0 ) + T1 (L2 ) + T2 (L4 ) + · · · + T359 (L718 ) is divided by 359. 27. Let ABCD be a quadrilateral satisfying ∠BCD = ∠CDA. Suppose rays AD and BC meet at E, and let Γ be the circumcircle of ABE. Let Γ1 be a circle tangent to ray CD past D at W , segment AD at X, and internally tangent to Γ. Similarly, let Γ2 be a circle tangent to ray DC past C at Y , segment BC at Z, and internally tangent to Γ. Let P be the intersection of W X and Y Z, and suppose P lies on Γ. If F is the E-excenter of triangle ABE, and AB = 544, AE = 2197, BE = 2299, then find m + n, where F P = m n with m, n relatively prime positive integers. 28. Find the number of ordered pairs (P (x), Q(x)) of polynomials with integer coefficients such that 2 P (x)2 + Q(x)2 = x4096 − 1 . 29. Let ABC be an acute scalene triangle with incenter I, and let M be the circumcenter of triangle BIC. Points D, B 0 , and C 0 lie on side BC so that ∠BIB 0 = ∠CIC 0 = ∠IDB = ∠IDC = 90◦ . Define P = AB ∩ M C 0 , Q = AC ∩ M B 0 , S = M D ∩ P Q, and K = SI ∩ DF , where segment EF is a diameter of the incircle selected so that S lies in the interior of segment AE. It is known that KI = 15x, √ SI = 20x + 15, BC = 20x5/2 , and DI = 20x3/2 , where x = ab (n + p) for some positive integers a, b, n, p, with p prime and gcd(a, b) = 1. Compute a + b + n + p. 30. Let S be the value of

∞ X d(n) +

Pν2 (n) m=1

n=1

(m − 3)d n

n 2m

 ,

where d(n) is the number of divisors of n and ν2 (n) is the exponent of 2 in the prime factorization of n. If S can be expressed as (ln m)n for positive integers m and n, find 1000n + m.

3

The Online Math Open Fall Contest November 6 – 17, 2015

Acknowledgements Head Problem Authors • Yang Liu (Chief of Problems) • Ashwin Sah • Yannick Yao

Problem Contributors • Evan Chen • Michael Kural • James Lin • Michael Ma

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in whichever contests they like. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2015 Fall Contest will consist of 30 problems; the answer to each problem will be an integer between 0 and 231 − 1 = 2147483647 inclusive. The contest window will be November 6 – 17, 2015 from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids, including scientific calculators, graphing calculators, or computer programs is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate with each other about the contest while the contest is running. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. (Problem m is harder than problem n if fewer teams solve problem m OR if the number of solves is equal and m > n.) 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Fall 2015 November 6 – 17, 2015 1. Evalute

s        8 9 15 16 + + + . 2 2 2 2

2. At a national math contest, students are being housed in single rooms and double rooms; it is known that 75% of the students are housed in double rooms. What percentage of the rooms occupied are double rooms? 3. How many integers between 123 and 321 inclusive have exactly two digits that are 2? 4. Let ω be a circle with diameter AB and center O. We draw a circle ωA through O and A, and another circle ωB through O and B; the circles ωA and ωB intersect at a point C distinct from O. Assume √ that all three circles ω, ωA , ωB are congruent. If CO = 3, what is the perimeter of 4ABC? 5. Merlin wants to buy a magical box, which happens to be an n-dimensional hypercube with side length 1 cm. The box needs to be large enough to fit his wand, which is 25.6 cm long. What is the minimal possible value of n? 6. Farmer John has a (flexible) fence of length L and two straight walls that intersect at a corner perpendicular to each other. He knows that if he doesn’t use any walls, he can enclose a maximum possible area of A0 , and when he uses one of the walls or both walls, he gets a maximum area of A1 and A2 A2 1 respectively. If n = A A0 + A1 , find b1000nc. 7. Define sequence {an } as following: a0 = 0, a1 = 1, and ai = 2ai−1 − ai−2 + 2 for all i ≥ 2. Determine the value of a1000 . 8. The two numbers 0 and 1 are initially written in a row on a chalkboard. Every minute thereafter, Denys writes the number a + b between all pairs of consecutive numbers a, b on the board. How many odd numbers will be on the board after 10 such operations? 9. Let s1 , s2 , . . . be an arithmetic progression of positive integers. Suppose that ss1 = x + 2,

ss2 = x2 + 18,

and ss3 = 2x2 + 18.

Determine the value of x. 10. For any positive integer n, define a function f by f (n) = 2n + 1 − 2blog2 nc+1 . Let f m denote the function f applied m times.. Determine the number of integers n between 1 and 65535 inclusive such that f n (n) = f 2015 (2015). 11. A trapezoid ABCD lies on the xy-plane. The slopes of lines BC and AD are both 31 , and the slope of line AB is − 23 . Given that AB = CD and BC < AD, the absolute value of the slope of line CD can be expressed as m n , where m, n are two relatively prime positive integers. Find 100m + n. 12. Let a, b, c be the distinct roots of the polynomial P (x) = x3 − 10x2 + x − 2015. The cubic polynomial Q(x) is monic and has distinct roots bc − a2 , ca − b2 , ab − c2 . What is the sum of the coefficients of Q? 13. You live in an economy where all coins are of value 1/k for some positive integer k (i.e. 1, 1/2, 1/3, . . . ). You just recently bought a coin exchanging machine, called the Cape Town Machine. For any integer n > 1, this machine can take in n of your coins of the same value, and return a coin of value equal to the sum of values of those coins (provided the coin returned is part of the economy). Given that the product of coins values that you have is 2015−1000 , what is the maximum number of times you can use the machine over all possible starting sets of coins?

1

OMO Fall 2015 November 6 – 17, 2015 14. Let a1 , a2 , . . . , a2015 be a sequence of positive integers in [1, 100]. Call a nonempty contiguous subsequence of this sequence good if the product of the integers in it leaves a remainder of 1 when divided by 101. In other words, it is a pair of integers (x, y) such that 1 ≤ x ≤ y ≤ 2015 and ax ax+1 . . . ay−1 ay ≡ 1

(mod 101).

Find the minimum possible number of good subsequences across all possible (ai ). 15. A regular 2015-simplex P has 2016 vertices in 2015-dimensional space such that the distances between every pair of vertices are equal. Let S be the set of points contained inside P that are closer to its center than any of its vertices. The ratio of the volume of S to the volume of P is m n , where m and n are relatively prime positive integers. Find the remainder when m + n is divided by 1000. 16. Given a (nondegenerate) triangle ABC with positive integer angles (in degrees), construct squares BCD1 D2 , ACE1 E2 outside the triangle. Given that D1 , D2 , E1 , E2 all lie on a circle, how many ordered triples (∠A, ∠B, ∠C) are possible? 17. Let x1 . . . , x42 be real numbers such that 5xi+1 − xi − 3xi xi+1 = 1 for each 1 ≤ i ≤ 42, with x1 = x43 . Find the product of all possible values for x1 + x2 + · · · + x42 . 18. Given an integer n, an integer 1 ≤ a ≤ n is called n-well if   n = a. bn/ac Let f (n) be the number of n-well numbers, for each integer n ≥ 1. Compute f (1)+f (2)+. . .+f (9999). 19. For any set S, let P (S) be its power set, the set of all of its subsets. Over all sets A of 2015 arbitrary finite sets, let N be the maximum possible number of ordered pairs (S, T ) such that S ∈ P (A), T ∈ P (P (A)), S ∈ T , and S ⊆ T . (Note that by convention, a set may never contain itself.) Find the remainder when N is divided by 1000. 20. Amandine and Brennon play a turn-based game, with Amadine starting. On their turn, a player must select a positive integer which cannot be represented as a sum of nonnegative multiples of any of the previously selected numbers. For example, if 3, 5 have been selected so far, only 1, 2, 4, 7 are available to be picked; if only 3 has been selected so far, all numbers not divisible by three are eligible. A player loses immediately if they select the integer 1. Call a number n feminist if gcd(n, 6) = 1 and if Amandine wins if she starts with n. Compute the sum of the feminist numbers less than 40. 21. Toner Drum and Celery Hilton are both running for president. A total of 2015 people cast their vote, giving 60% to Toner Drum. Let N be the number of “representative” sets of the 2015 voters that could have been polled to correctly predict the winner of the election (i.e. more people in the set voted for Drum than Hilton). Compute the remainder when N is divided by 2017. 22. Let W = . . . x−1 x0 x1 x2 . . . be an infinite periodic word consisting of only the letters a and b. The minimal period of W is 22016 . Say that a word U appears in W if there are indices k ≤ ` such that U = xk xk+1 . . . x` . A word U is called special if U a, U b, aU, bU all appear in W . (The empty word is considered special) You are given that there are no special words of length greater than 2015. Let N be the minimum possible number of special words. Find the remainder when N is divided by 1000. 23. Let p = 2017, a prime number. Let N be the number of ordered triples (a, b, c) of integers such that 1 ≤ a, b ≤ p(p − 1) and ab − ba = p · c. Find the remainder when N is divided by 1000000. 24. Let ABC be an acute triangle with incenter I; ray AI meets the circumcircle Ω of ABC at M 6= A. Suppose T lies on line BC such that ∠M IT = 90◦ . Let K be the foot of the altitude from I to T M . 77 BK m Given that sin B = 55 73 and sin C = 85 , and CK = n in lowest terms, compute m + n. 2

OMO Fall 2015 November 6 – 17, 2015 25. Define kA − Bk = (xA − xB )2 + (yA − yB )2 for every two points A = (xA , yA ) and B = (xB , yB ) in the plane. Let S be the set of points (x, y) in the plane for which x, y ∈ {0, 1, . . . , 100}. Find the number of functions f : S → S such that kA − Bk ≡ kf (A) − f (B)k (mod 101) for any A, B ∈ S. 26. Let ABC be a triangle with AB = 72, AC = 98, BC = 110, and circumcircle Γ, and let M be the midpoint of arc BC not containing A on Γ. Let A0 be the reflection of A over BC, and suppose M B meets AC at D, while M C meets AB at E. If M A0 meets DE at F , find the distance from F to the center of Γ.   27. For integers 0 ≤ m, n ≤ 64, let α(m, n) be the number of nonnegative integers k for which m/2k and  n/2k are both odd integers. Consider a 65 × 65 matrix M whose (i, j)th entry (for 1 ≤ i, j ≤ 65) is (−1)α(i−1,j−1) . Compute the unique integer 0 ≤ r < 1000 such that det M ≡ r (mod 1000). 28. Let N be the number of 2015-tuples of (not necessarily distinct) subsets (S1 , S2 , . . . , S2015 ) of {1, 2, . . . , 2015} such that the number of permutations σ of {1, 2, . . . , 2015} satisfying σ(i) ∈ Si for all 1 ≤ i ≤ 2015 is odd. Let k2 , k3 be the largest integers such that 2k2 |N and 3k3 |N respectively. Find k2 + k3 . 29. Given vectors v1 , . . . , vn and the string v1 v2 . . . vn , we consider valid expressions formed by inserting n − 1 sets of balanced parentheses and n − 1 binary products, such that every product is surrounded by a parentheses and is one of the following forms: • A “normal product” ab, which takes a pair of scalars and returns a scalar, or takes a scalar and vector (in any order) and returns a vector. • A “dot product” a · b, which takes in two vectors and returns a scalar. • A “cross product” a × b, which takes in two vectors and returns a vector. An example of a valid expression when n = 5 is (((v1 · v2 )v3 ) · (v4 × v5 )), whose final output is a scalar. An example of an invalid expression is (((v1 × (v2 × v3 )) × (v4 · v5 )); even though every product is surrounded by parentheses, in the last step one tries to take the cross product of a vector and a scalar. Denote by Tn the number of valid expressions (with T1 = 1), and let Rn denote the remainder when Tn is divided by 4. Compute R1 + R2 + R3 + . . . + R1,000,000 . 30. Ryan is learning number theory. He reads about the M¨ obius function µ : N → Z, defined by µ(1) = 1 and X µ(n) = − µ(d) d|n d6=n

for n > 1 (here N is the set of positive integers). However, Ryan doesn’t like negative numbers, so he invents his own function: the dubious function δ : N → N, defined by the relations δ(1) = 1 and X δ(n) = δ(d) d|n d6=n

for n > 1. Help Ryan determine the value of 1000p + q, where p, q are relatively prime positive integers satisfying ∞ p X δ(15k ) = . q 15k k=0

3

The Online Math Open Spring Contest March 18 - 29, 2016

Acknowledgements Head Problem Staff • Yang Liu • James Lin • Michael Kural • Yannick Yao

Problem Contributors and Test Solvers • Ashwin Sah • Michael Ma • Vincent Huang • Tristan Shin

Website Manager • Douglas Chen

Python/LATEX Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in whichever contests they like. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2016 Spring Contest will consist of 30 problems; the answer to each problem will be an integer between 0 and 231 − 1 = 2147483647 inclusive. The contest window will be March 18 - 29, 2016 from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids, including scientific calculators, graphing calculators, or computer programs is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate with each other about the contest while the contest is running. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. (Problem m is harder than problem n if fewer teams solve problem m OR if the number of solves is equal and m > n.) 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Spring 2016 March 18 - 29, 2016 1. Let An denote the answer to the nth problem on this contest (n = 1, . . . , 30); in particular, the answer to this problem is A1 . Compute 2A1 (A1 + A2 + · · · + A30 ). 2. Let x, y, and z be real numbers such that x + y + z = 20 and x + 2y + 3z = 16. What is the value of x + 3y + 5z? 3. A store offers packages of 12 pens for $10 and packages of 20 pens for $15. Using only these two types of packages of pens, find the greatest number of pens $173 can buy at this store. 4. Given that x is a real number, find the minimum value of f (x) = |x+1|+3|x+3|+6|x+6|+10|x+10|. 5. Let ` be a line with negative slope passing through the point (20, 16). What is the minimum possible area of a triangle that is bounded by the x-axis, y-axis, and `? 6. In a round-robin basketball tournament, each basketball team plays every other basketball team exactly once. If there are 20 basketball teams, what is the greatest number of basketball teams that could have at least 16 wins after the tournament is completed? 7. Compute the number of ordered quadruples of positive integers (a, b, c, d) such that a! · b! · c! · d! = 24!. 8. Let ABCDEF be a regular hexagon of side length 3. Let X, Y, and Z be points on segments AB, CD, and √ EF such that AX = CY = EZ = 1. The area of triangle XY Z can be expressed in the form a b where a, b, c are positive integers such that b is not divisible by the square of any prime and c gcd(a, c) = 1. Find 100a + 10b + c. 9. Let f (n) = 1 × 3 × 5 × · · · × (2n − 1). Compute the remainder when f (1) + f (2) + f (3) + · · · + f (2016) is divided by 100. 10. Lazy Linus wants to minimize his amount of laundry over the course of a week (seven days), so he decides to wear only three different T-shirts and three different pairs of pants for the week. However, he doesn’t want to look dirty or boring, so he decides to wear each piece of clothing for either two or three (possibly nonconsecutive) days total, and he cannot wear the same outfit (which consists of one T-shirt and one pair of pants) on two different (not necessarily consecutive) days. How many ways can he choose the outfits for these seven days? 11. For how many positive integers x less than 4032 is x2 − 20 divisible by 16 and x2 − 16 divisible by 20? 12. A 9-cube is a nine-dimensional hypercube (and hence has 29 vertices, for example). How many fivedimensional faces does it have? (An n dimensional hypercube is defined to have vertices at each of the points (a1 , a2 , · · · , an ) with ai ∈ {0, 1} for 1 ≤ i ≤ n.) 13. For a positive integer n, let f (n) be the integer formed by reversing the digits of n (and removing any leading zeroes). For example f (14172) = 27141. Define a sequence of numbers {an }n≥0 by a0 = 1 and for all i ≥ 0, ai+1 = 11ai or ai+1 = f (ai ) . How many possible values are there for a8 ? 14. Let ABC be a triangle with BC = 20 and CA = 16, and let I be its incenter. If the altitude from A to BC, the perpendicular bisector of AC, and the line through I perpendicular to AB intersect at a √ common point, then the length AB can be written as m + n for positive integers m and n. What is 100m + n? 15. Let a, b, c, d be four real numbers such that a + b + c + d = 20 and ab + bc + cd + da = 16. Find the maximum possible value of abc + bcd + cda + dab. 1

OMO Spring 2016 March 18 - 29, 2016 16. Jay is given a permutation {p1 , p2 , . . . , p8 } of {1, 2, . . . , 8}. He may take two dividers and split the permutation into three non-empty sets, and he concatenates each set into a single integer. In other words, if Jay chooses a, b with 1 ≤ a < b < 8, he will get the three integers p1 p2 . . . pa , pa+1 pa+2 . . . pb , and pb+1 pb+2 . . . p8 . Jay then sums the three integers into a sum N = p1 p2 . . . pa + pa+1 pa+2 . . . pb + pb+1 pb+2 . . . p8 . Find the smallest positive integer M such that no matter what permutation Jay is given, he may choose two dividers such that N ≤ M . 17. A set S ⊆ N satisfies the following conditions: (a) If x, y ∈ S (not necessarily distinct), then x + y ∈ S. (b) If x is an integer and 2x ∈ S, then x ∈ S. Find the number of pairs of integers (a, b) with 1 ≤ a, b ≤ 50 such that if a, b ∈ S then S = N. 18. Kevin is in kindergarten, so his teacher puts a 100 × 200 addition table on the board during class. The teacher first randomly generates distinct positive integers a1 , a2 , . . . , a100 in the range [1, 2016] corresponding to the rows, and then she randomly generates distinct positive integers b1 , b2 , . . . , b200 in the range [1, 2016] corresponding to the columns. She then fills in the addition table by writing the number ai + bj in the square (i, j) for each 1 ≤ i ≤ 100, 1 ≤ j ≤ 200. During recess, Kevin takes the addition table and draws it on the playground using chalk. Now he can play hopscotch on it! He wants to hop from (1, 1) to (100, 200). At each step, he can jump in one of 8 directions to a new square bordering the square he stands on a side or at a corner. Let M be the minimum possible sum of the numbers on the squares he jumps on during his path to (100, 200) (including both the starting and ending squares). The expected value of M can be expressed in the form pq for relatively prime positive integers p, q. Find p + q. 19. Let Z≥0 denote the set of nonnegative integers. Define a function f : Z≥0 → Z with f (0) = 1 and f (n) = 512bn/10c f (bn/10c) for all n ≥ 1. Determine the number of nonnegative integers n such that the hexadecimal (base 16) representation of f (n) contains no more than 2500 digits. 20. Define A(n) as the average of all positive divisors of the positive integer n. Find the sum of all solutions to A(n) = 42. 21. Say a real number r is repetitive if there exist two distinct complex numbers z1 , z2 with |z1 | = |z2 | = 1 and {z1 , z2 } = 6 {−i, i} such that z1 (z13 + z12 + rz1 + 1) = z2 (z23 + z22 + rz2 + 1). There exist real numbers a, b such that a real number r is repetitive if and only if a < r ≤ b. If the value of |a| + |b| can be expressed in the form pq for relatively prime positive integers p and q, find 100p + q. 22. Let ABC be a triangle with AB = 5, BC = 7, CA = 8, and circumcircle ω. Let P be a point inside −→ −−→ −−→ ABC such that P A : P B : P C = 2 : 3 : 6. Let rays AP , BP , and √ CP intersect ω again at X, Y , p q and Z, respectively. The area of XY Z can be expressed in the form where p and r are relatively r prime positive integers and q is a positive integer not divisible by the square of any prime. What is p + q + r? 23. Let S be the set of all 20172 lattice points (x, y) with x, y ∈ {0} ∪ {20 , 21 , · · · , 22015 }. A subset X ⊆ S is called BQ if it has the following properties: 2

OMO Spring 2016 March 18 - 29, 2016 (a) X contains at least three points, no three of which are collinear. (b) One of the points in X is (0, 0). (c) For any three distinct points A, B, C ∈ X, the orthocenter of 4ABC is in X. (d) The convex hull of X contains at least one horizontal line segment. Determine the number of BQ subsets of S. 24. Bessie and her 2015 bovine buddies work at the Organic Milk Organization, for a total of 2016 workers. They have a hierarchy of bosses, where obviously no cow is its own boss. In other words, for some pairs of employees (A, B), B is the boss of A. This relationship satisfies an obvious condition: if B is the boss of A and C is the boss of B, then C is also a boss of A. Business has been slow, so Bessie hires an outside organizational company to partition the company into some number of groups. To promote growth, every group is one of two forms. Either no one in the group is the boss of another in the group, or for every pair of cows in the group, one is the boss of the other. Let G be the minimum number of groups needed in such a partition. Find the maximum value of G over all possible company structures. 25. Given a prime p and positive integer k, an integer n with 0 ≤ n < p is called a (p, k)-Hofstadterian residue if there exists an infinite sequence of integers n0 , n1 , n2 , . . . such that n0 ≡ n and nki+1 ≡ ni (mod p) for all integers i ≥ 0. If f (p, k) is the number of (p, k)-Hofstadterian residues, then compute 2016 X f (2017, k). k=1

26. Let S be the set of all pairs (a, b) of integers satisfying 0 ≤ a, b ≤ 2014. For any pairs s1 = (a1 , b1 ), s2 = (a2 , b2 ) ∈ S, define s1 + s2 = ((a1 + a2 )2015 , (b1 + b2 )2015 ) and s1 × s2 = ((a1 a2 + 2b1 b2 )2015 , (a1 b2 + a2 b1 )2015 ), where n2015 denotes the remainder when an integer n is divided by 2015. Compute the number of functions f : S → S satisfying f (s1 + s2 ) = f (s1 ) + f (s2 ) and f (s1 × s2 ) = f (s1 ) × f (s2 ) for all s1 , s2 ∈ S. 27. Let ABC be a triangle with circumradius 2 and ∠B − ∠C = 15◦ . Denote its circumcenter as O, orthocenter as H, and centroid as G. Let the reflection of H over O be L, and let lines AG and AL intersect the circumcircle again at X and Y , respectively. Define B1 and C1 as the points on the circumcircle of ABC √ such that BB1 k AC and CC1 k AB, and let lines √ XY and B1 C1 intersect at Z. Given that OZ = 2 5, then AZ 2 can be expressed in the form m − n for positive integers m and n. Find 100m + n. 28. Let N be the number of polynomials P (x1 , x2 , . . . , x2016 ) of degree at most 2015 with coefficients in the set {0, 1, 2} such that P (a1 , a2 , · · · , a2016 ) ≡ 1 (mod 3) for all (a1 , a2 , · · · , a2016 ) ∈ {0, 1}2016 . Compute the remainder when v3 (N ) is divided by 2011, where v3 (N ) denotes the largest integer k such that 3k |N. 29. Yang the Spinning Square Sheep is a square in the plane such that his four legs are his four vertices. Yang can do two different types of tricks: (a) Yang can choose one of his sides, then reflect himself over the side. (b) Yang can choose one of his legs, then rotate 90◦ counterclockwise around the leg. 3

OMO Spring 2016 March 18 - 29, 2016 Yang notices that after 2016 tricks, each leg ends up in exactly the same place the leg started out in! Let there be N ways for Yang to perform his 2016 tricks. What is the remainder when N is divided by 100000? √ √ √ √ 30. In triangle ABC, AB = 3 30 − 10, BC = 12, and CA = 3 30 + 10. Let M be the midpoint of AB and N be the midpoint of AC. Denote l as the line passing through the circumcenter O and orthocenter H of ABC, and let E and F be the feet of the perpendiculars from B and C to l, respectively. Let l0 be the reflection of l in BC such that l0 intersects lines AE and AF at P and Q, respectively. Let lines BP and CQ intersect at K. X, Y , and Z are the reflections of K over the perpendicular bisectors of sides BC, CA, and AB, respectively, and R and S are the midpoints of XY and XZ, respectively. If lines M R and N S intersect at T , then the length of OT can be expressed in the form pq for relatively prime positive integers p and q. Find 100p + q.

4

The Online Math Open Fall Contest November 4 – 15, 2016

Acknowledgements Tournament Director • James Lin

Problem Authors • Vincent Huang • Yang Liu • Michael Ren • Ashwin Sah • Tristan Shin • Yannick Yao

Website Manager • Evan Chen • Douglas Chen

LATEX/Python Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in whichever contests they like. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2016 Fall Contest will consist of 30 problems; the answer to each problem will be an integer between 0 and 231 − 1 = 2147483647 inclusive. The contest window will be November 4 – 15, 2016 from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids, including scientific calculators, graphing calculators, or computer programs is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate with each other about the contest while the contest is running. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. (Problem m is harder than problem n if fewer teams solve problem m OR if the number of solves is equal and m > n.) 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Fall 2016 November 4 – 15, 2016 1. Kevin is in first grade, so his teacher asks him to calculate 20 + 1 · 6 + k, where k is a real number revealed to Kevin. However, since Kevin is rude to his Aunt Sally, he instead calculates (20+1)·(6+k). Surprisingly, Kevin gets the correct answer! Assuming Kevin did his computations correctly, what was his answer? 2. Yang has a standard 6-sided die, a standard 8-sided die, and a standard 10-sided die. He tosses these three dice simultaneously. The probability that the three numbers that show up form the side lengths of a right triangle can be expressed as m n , for relatively prime positive integers m and n. Find 100m + n. 3. In a rectangle ABCD, let M and N be the midpoints of sides BC and CD, respectively, such that AM √ is perpendicular to M N . Given that the length of AN is 60, the area of rectangle ABCD is m n for positive integers m and n such that n is not divisible by the square of any prime. Compute 100m + n. 100

4. Let G = 1010

(a.k.a. a googolplex). Then log(log

can be expressed in the form the digits of m + n.

m n

(log10 G)

G)

G

for relatively prime positive integers m and n. Determine the sum of

5. Jay notices that there are n primes that form an arithmetic sequence with common difference 12. What is the maximum possible value for n? 2

6. For a positive integer n, define n? = 1n · 2n−1 · 3n−2 · · · (n − 1) · n1 . Find the positive integer k for which 7?9? = 5?k?. 7. The 2016 players in the Gensokyo Tennis Club are playing Up and Down the River. The players first randomly form 1008 pairs, and each pair is assigned to a tennis court (The courts are numbered from 1 to 1008). Every day, the two players on the same court play a match against each other to determine a winner and a loser. For 2 ≤ i ≤ 1008, the winner on court i will move to court i − 1 the next day (and the winner on court 1 does not move). Likewise, for 1 ≤ j ≤ 1007, the loser on court j will move to court j + 1 the next day (and the loser on court 1008 does not move). On Day 1, Reimu is playing on court 123 and Marisa is playing on court 876. Find the smallest positive integer value of n for which it is possible that Reimu and Marisa play one another on Day n. 8. For a positive integer n, define the nth triangular number Tn to be n(n+1) , and define the nth square 2 number Sn to be n2 . Find the value of v s u r q u p t S62 + T63 S61 + T62 · · · S2 + T3 S1 + T2 . 9. In quadrilateral ABCD, AB = 7, BC = 24, CD = 15, DA = 20, and AC = 25. Let segments AC and BD intersect at E. What is the length of EC? 10. Let a1 < a2 < a3 < a4 be positive integers such that the following conditions hold: • gcd(ai , aj ) > 1 holds for all integers 1 ≤ i < j ≤ 4. • gcd(ai , aj , ak ) = 1 holds for all integers 1 ≤ i < j < k ≤ 4. Find the smallest possible value of a4 . 11. Let f be a random permutation on {1, 2, . . . , 100} satisfying f (1) > f (4) and f (9) > f (16). The probability that f (1) > f (16) > f (25) can be written as m n where m and n are relatively prime positive integers. Compute 100m + n. Note: In other words, f is a function such that {f (1), f (2), . . . , f (100)} is a permutation of {1, 2, . . . , 100}. 1

OMO Fall 2016 November 4 – 15, 2016 m

12. For each positive integer n ≥ 2, define k (n) to be the largest integer m such that (n!) What is the minimum possible value of n + k (n)?

divides 2016!.

13. Let A1 B1 C1 be a triangle with A1 B1 = 16, B1 C1 = 14, and C1 A1 = 10. Given a positive integer i and a triangle Ai Bi Ci with circumcenter Oi , define triangle Ai+1 Bi+1 Ci+1 in the following way: (a) Ai+1 is on side Bi Ci such that Ci Ai+1 = 2Bi Ai+1 . (b) Bi+1 6= Ci is the intersection of line Ai Ci with the circumcircle of Oi Ai+1 Ci . (c) Ci+1 6= Bi is the intersection of line Ai Bi with the circumcircle of Oi Ai+1 Bi . Find ∞ X [Ai Bi Ci ]

!2 .

i=1

Note: [K] denotes the area of K. 14. In Yang’s number theory class, Michael K, Michael M, and Michael R take a series of tests. Afterwards, Yang makes the following observations about the test scores: • Michael K had an average test score of 90, Michael M had an average test score of 91, and Michael R had an average test score of 92. • Michael K took more tests than Michael M, who in turn took more tests than Michael R. • Michael M got a higher total test score than Michael R, who in turn got a higher total test score than Michael K. (The total test score is the sum of the test scores over all tests) What is the least number of tests that Michael K, Michael M, and Michael R could have taken combined? 15. Two bored millionaires, Bilion and Trilion, decide to play a game. They each have a sufficient supply of $1, $2, $5, and $10 bills. Starting with Bilion, they take turns putting one of the bills they have into a pile. The game ends when the bills in the pile total exactly $1,000,000, and whoever makes the last move wins the $1,000,000 in the pile (if the pile is worth more than $1,000,000 after a move, then the person who made the last move loses instead, and the other person wins the amount of cash in the pile). Assuming optimal play, how many dollars will the winning player gain? 16. For her zeroth project at Magic School, Emilia needs to grow six perfectly-shaped apple trees. First she plants six tree saplings at the end of Day 0. On each day afterwards, Emilia attempts to use her magic to turn each sapling into a perfectly-shaped apple tree, and for each sapling she succeeds in turning it into a perfectly-shaped apple tree that day with a probability of 21 . (Once a sapling is turned into a perfectly-shaped apple tree, it will stay a perfectly-shaped apple tree.) The expected number of days it will take Emilia to obtain six perfectly-shaped apple trees is m n for relatively prime positive integers m and n. Find 100m + n. 17. Let n be a positive integer. S is a set of points such that the points in S are arranged in a regular 2016-simplex grid, with an edge of the simplex having n points in S. (For example, the 2-dimensional n(n + 1) analog would have points arranged in an equilateral triangle grid). Each point in S is labeled 2 with a real number such that the following conditions hold: • Not all the points in S are labeled with 0. • If ` is a line that is parallel to an edge of the simplex and that passes through at least one point in S, then the labels of all the points in S that are on ` add to 0. • The labels of the points in S are symmetric along any such line `.

2

OMO Fall 2016 November 4 – 15, 2016 Find the smallest positive integer n such that this is possible. Note: A regular 2016-simplex has 2017 vertices in 2016-dimensional space such that the distances between every pair of vertices are equal. 18. Find the smallest positive integer k such that there exist positive integers M, O > 1 satisfying (O · M · O)k = (O · M ) · (N · O · M ) · (N · O · M ) · . . . · (N · O · M ), | {z } 2016 (N ·O·M )s

where N = OM . Note: This is edited from the previous text, which did not clarify that N OM represented N · O · M , for example. 19. Let S be the set of all polynomials Q(x, y, z) with coefficients in {0, 1} such that there exists a homogeneous polynomial P (x, y, z) of degree 2016 with integer coefficients and a polynomial R(x, y, z) with integer coefficients so that P (x, y, z)Q(x, y, z) = P (yz, zx, xy) + 2R(x, y, z) and P (1, 1, 1) is odd. Determine the size of S. Note: A homogeneous polynomial of degree d consists solely of terms of degree d. 20. For a positive integer k, define the sequence {an }n≥0 such that a0 = 1 and for all positive integers n, an is the smallest positive integer greater than an−1 for which an ≡kan−1 (mod 2017). What is the number of positive integers 1 ≤ k ≤ 2016 for which a2016 = 1 + 2017 ? 2 21. Mark the Martian and Bark the Bartian live on planet Blok, in the year 2019. Mark and Bark decide to play a game on a 10 × 10 grid of cells. First, Mark randomly generates a subset S of {1, 2, . . . , 2019} with |S| = 100. Then, Bark writes each of the 100 integers in a different cell of the 10 × 10 grid. Afterwards, Bark constructs a solid out of this grid in the following way: for each grid cell, if the number written on it is n, then she stacks n 1 × 1 × 1 blocks on top of one other in that cell. Let B be the largest possible surface area of the resulting solid, including the bottom of the solid, over all possible ways Bark could have inserted the 100 integers into the grid of cells. Find the expected value of B over all possible sets S Mark could have generated. 22. Let ABC be a triangle with AB = 3 and AC = 4. It is given that there does not exist a point D, different from A and not lying on line BC, such that the Euler line of ABC coincides with the Euler line of DBC. The square of the product of all possible lengths of BC can be expressed in the form √ m + n p, where m, n, and p are positive integers and p is not divisible by the square of any prime. Find 100m + 10n + p. Note: For this problem, consider every line passing through the center of an equilateral triangle to be an Euler line of the equilateral triangle. Hence, if D is chosen such that DBC is an equilateral triangle and the Euler line of ABC passes through the center of DBC, then consider the Euler line of ABC to coincide with ”the” Euler line of DBC. 23. Let N denote the set of positive integers. Let f : N → N be a function such that the following conditions hold: • For any n ∈ N, we have f (n)|n2016 . • For any a, b, c ∈ N satisfying a2 + b2 = c2 , we have f (a)f (b) = f (c). Over all possible functions f , determine the number of distinct values that can be achieved by f (2014)+ f (2) − f (2016).

3

OMO Fall 2016 November 4 – 15, 2016 24. Let P (x, y) be a polynomial such that degx (P ), degy (P ) ≤ 2020 and P (i, j) =

  i+j i

over all 20212 ordered pairs (i, j) with 0 ≤ i, j ≤ 2020. Find the remainder when P (4040, 4040) is divided by 2017. Note: degx (P ) is the highest exponent of x in a nonzero term of P (x, y). degy (P ) is defined similarly. 25. Let X1 X2 X3 be a triangle with X1 X2 = 4, X2 X3 = 5, X3 X1 = 7, and centroid G. For all integers n ≥ 3, define the set Sn to be the set of n2 ordered pairs (i, j) such that 1 ≤ i ≤ n and 1 ≤ j ≤ n. Then, for each integer n ≥ 3, when given the points X1 , X2 , . . . , Xn , randomly choose an element (i, j) ∈ Sn and define Xn+1 to be the midpoint of Xi and Xj . The value of ∞ X



E Xi+4 G

i=0

2



 i ! 3 4

m can be expressed in the form p + q ln 2 + r ln 3 for rational numbers p, q, r. Let |p| + |q| + |r| = for n relatively prime positive integers m and n. Compute 100m + n. Note: E(x) denotes the expected value of x. 26. Let ABC be a triangle with BC = 9, CA = 8, and AB = 10. Let the incenter and incircle of ABC be I and γ, respectively, and let N be the midpoint of major arc BC of the cirucmcircle of ABC. Line N I meets the circumcircle of ABC a second time at P . Let the line through I perpendicular to AI meet segments AB, AC, and AP at C1 , B1 , and Q, respectively. Let B2 lie on segment CQ such that line B1 B2 is tangent to γ, and let C2 lie on segment BQ such that line C1 C2 tangent to γ. The length of B2 C2 can be expressed in the form m n for relatively prime positive integers m and n. Determine 100m + n. 27. Compute the number of monic polynomials q(x) with integer coefficients of degree 12 such that there exists an integer polynomial p(x) satisfying q(x)p(x) = q(x2 ). 28. Let ABC be a triangle with AB = 34, BC = 25, and CA = 39. Let O, H, and ω be the circumcenter, orthocenter, and circumcircle of 4ABC, respectively. Let line AH meet ω a second time at A1 and let the reflection of H over the perpendicular bisector of BC be H1 . Suppose the line through O perpendicular to A1 O meets ω at two points Q and R with Q on minor arc AC and R on minor arc AB. Denote H as the hyperbola passing through A, B, C, H, H1 , and suppose HO meets H again at P . Let X, Y be points with XH k AR k Y P, XP k AQ k Y H. Let P1 , P2 be points on the tangent to H at P with XP1 k OH k Y P2 and let P3 , P4 be points on the tangent to H at H with XP3 k OH k Y P4 . If P1 P4 and P2 P3 meet at N , and ON may be written in the form ab where a, b are positive coprime integers, find 100a + b. 29. Let n be a positive integer. Yang the Saltant Sanguivorous Shearling is on the side of a very steep mountain that is embedded in the coordinate plane. There is a blood river along the line y = x, which Yang may reach but is not permitted to go above (i.e. Yang is allowed to be located at (2016, 2015) and (2016, 2016), but not at (2016, 2017)). Yang is currently located at (0, 0) and wishes to reach (n, 0). Yang is permitted only to make the following moves: • Yang may spring, which consists of going from a point (x, y) to the point (x, y + 1). • Yang may stroll, which consists of going from a point (x, y) to the point (x + 1, y). • Yang may sink, which consists of going from a point (x, y) to the point (x, y − 1).

4

OMO Fall 2016 November 4 – 15, 2016 In addition, whenever Yang does a sink, he breaks his tiny little legs and may no longer do a spring at any time afterwards. Yang also expends a lot of energy doing a spring and gets bloodthirsty, so he must visit the blood river at least once afterwards to quench his bloodthirst. (So Yang may still spring while bloodthirsty, but he may not finish his journey while bloodthirsty.) Let there be an different ways for which Yang can reach (n, 0), given that Yang is permitted to pass by (n, 0) in the middle of his journey. Find the 2016th smallest positive integer n for which an ≡ 1 (mod 5). 30. Let P1 (x), P2 (x), . . . , Pn (x) be monic, non-constant polynomials with integer coefficients and let Q(x) be a polynomial with integer coefficients such that 2016

x2

+ x + 1 = P1 (x)P2 (x) . . . Pn (x) + 2Q(x).

Suppose that the maximum possible value of 2016n can be written in the form 2b1 + 2b2 + · · · + 2bk for nonnegative integers b1 < b2 < · · · < bk . Find the value of b1 + b2 + · · · + bk .

5

The Online Math Open Spring Contest March 24 - April 4, 2017

Acknowledgements Tournament Director • James Lin

Head Problem Authors • Zack Chroman • Vincent Huang • Michael Ren • Ashwin Sah • Tristan Shin • Yannick Yao

Other Problem Contributors • Evan Chen • Yang Liu

Website Manager • Evan Chen • Douglas Chen

LATEX/Python Geek • Evan Chen

Contest Information These rules supersede any rules found elsewhere about the OMO. Please send any further questions directly to the OMO Team at [email protected].

Team Registration and Eligibility Students may compete in teams of up to four people, but no student can belong to more than one team. Participants must not have graduated from high school (or the equivalent secondary school institution in other countries). Teams need not remain the same between the Fall and Spring contests, and students are permitted to participate in whichever contests they like. Only one member on each team needs to register an account on the website. Please check the website, http://internetolympiad.org/pages/14-omo_info, for registration instructions. Note: when we say “up to four”, we really do mean “up to”! Because the time limit is so long, partial teams are not significantly disadvantaged, and we welcome their participation.

Contest Format and Rules The 2017 Spring Contest will consist of 30 problems; the answer to each problem will be an integer between 0 and 231 − 1 = 2147483647 inclusive. The contest window will be March 24 - April 4, 2017 from 7PM ET on the start day to 7PM ET on the end day. There is no time limit other than the contest window. 1. Four-function calculators (calculators which can perform only the four basic arithmetic operations) are permitted on the Online Math Open. Any other computational aids, including scientific calculators, graphing calculators, or computer programs is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors. 2. Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids, such as Geogebra and graphing calculators, are not allowed. Print and electronic publications are also not allowed. 3. Members of different teams cannot communicate with each other about the contest while the contest is running. 4. Your score is the number of questions answered correctly; that is, every problem is worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. (Problem m is harder than problem n if fewer teams solve problem m OR if the number of solves is equal and m > n.) 5. Participation in the Online Math Open is free.

Clarifications and Results Clarifications will be posted as they are answered. For the most recent contests, they will be posted at http://internetolympiad.org/pages/n/omo_problems. If you have a question about problem wording, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer. After the contest is over, we will release the answers to the problems within the next day. Please do not discuss the test until answers are released. If you have a protest about an answer, you may send an email to [email protected]. (Include “Protest” in the subject). Results will be released in the following weeks. (Results will be counted only for teams that submit answers at least once. Teams that only register an account will not be listed in the final rankings.)

OMO Spring 2017 March 24 - April 4, 2017 1. Find the smallest positive integer that is relatively prime to each of 2, 20, 204, and 2048. 2. A positive integer n is called bad if it cannot be expressed as the product of two distinct positive integers greater than 1. Find the number of bad positive integers less than 100. 3. In rectangle ABCD, AB = 6 and BC = 16. Points P, Q are chosen on the interior of side AB such that AP = P Q = QB, and points R, S are chosen on the interior of side CD such that CR = RS = SD. Find the area of the region formed by the union of parallelograms AP CR and QBSD. 4. Lunasa, Merlin, and Lyrica each has an instrument. We know the following about the prices of their instruments: • If we raise the price of Lunasa’s violin by 50% and decrease the price of Merlin’s trumpet by 50%, the violin will be $50 more expensive than the trumpet; • If we raise the price of Merlin’s trumpet by 50% and decrease the price of Lyrica’s piano by 50%, the trumpet will be $50 more expensive than the piano. Given these conditions only, there exist integers m and n such that if we raise the price of Lunasa’s violin by m% and decrease the price of Lyrica’s piano by m%, the violin must be exactly $n more expensive than the piano. Find 100m + n. 5. There are 15 (not necessarily distinct) integers chosen uniformly at random from the range from 0 to 999, inclusive. Yang then computes the sum of their units digits, while Michael computes the last three digits of their sum. The probability of them getting the same result is m n for relatively prime positive integers m, n. Find 100m + n. 6. Let ABCDEF be a regular hexagon with side length 10 inscribed in a circle ω. X, Y , and Z are points on ω such that X is on minor arc AB, Y is on minor arc CD, and Z is on minor arc EF , where X may coincide with A or B (And similarly for Y and Z). Compute the square of the smallest possible area of XY Z. 7. Let S be the set of all positive integers between 1 and 2017, inclusive. Suppose that the least common L multiple of all elements in S is L. Find the number of elements in S that do not divide 2016 . 8. A five-digit positive integer is called k-phobic if no matter how one chooses to alter at most four of the digits, the resulting number (after disregarding any leading zeroes) will not be a multiple of k. Find the smallest positive integer value of k such that there exists a k-phobic number. 9. Kevin is trying to solve an economics question which has six steps. At each step, he has a probability p of making a sign error. Let q be the probability that Kevin makes an even number of sign errors (thus answering the question correctly!). For how many values of 0 ≤ p ≤ 1 is it true that p + q = 1? 10. When Cirno walks into her perfect math class today, she sees a polynomial P (x) = 1 (of degree 0) on the blackboard. As her teacher explains, for her pop quiz today, she will have to perform one of the two actions every minute: • Add a monomial to P (x) so that the degree of P increases by 1 and P remains monic; • Replace the current polynomial P (x) by P (x + 1). For example, if the current polynomial is x2 + 2x + 3, then she will change it to (x + 1)2 + 2(x + 1) + 3 = x2 + 4x + 6. Her score for the pop quiz is the sum of coefficients of the polynomial at the end of 9 minutes. Given that Cirno (miraculously) doesn’t make any mistakes in performing the actions, what is the maximum score that she can get?

1

OMO Spring 2017 March 24 - April 4, 2017 11. Let a1 , a2 , a3 , a4 be integers with distinct absolute values. In the coordinate plane, let A1 = (a1 , a21 ), A2 = (a2 , a22 ), A3 = (a3 , a23 ) and A4 = (a4 , a24 ). Assume that lines A1 A2 and A3 A4 intersect on the m y-axis at an acute angle of θ. The maximum possible value for tan θ can be expressed in the form n for relative prime positive integers m and n. Find 100m + n. 12. Alice has an isosceles triangle M0 N0 P , where M0 P = N0 P and ∠M0 P N0 = α◦ . (The angle is measured in degrees.) Given a triangle Mi Nj P for nonnegative integers i and j, Alice may perform one of two elongations: −−→ • an M -elongation, where she extends ray P Mi to a point Mi+1 where Mi Mi+1 = Mi Nj and then removes the point Mi . −−→ • an N -elongation, where she extends ray P Nj to a point Nj+1 where Nj Nj+1 = Mi Nj and then removes the point Nj . After a series of 5 elongations, k of which were M -elongations, Alice finds that triangle Mk N5−k P is an isosceles triangle. Given that 10α is an integer, compute 10α. 13. On a real number line, the points 1, 2, 3, . . . , 11 are marked. A grasshopper starts at point 1, then jumps to each of the other 10 marked points in some order so that no point is visited twice, before returning to point 1. The maximal length that he could have jumped in total is L, and there are N possible ways to achieve this maximum. Compute L + N . 14. Let ABC be a triangle, not right-angled, with positive integer angle measures (in degrees) and circumcenter O. Say that a triangle ABC is good if the following three conditions hold: • There exists a point P 6= A on side AB such that the circumcircle of 4P OA is tangent to BO. • There exists a point Q 6= A on side AC such that the circumcircle of 4QOA is tangent to CO. • The perimeter of 4AP Q is at least AB + AC. Determine the number of ordered triples (∠A, ∠B, ∠C) for which 4ABC is good. 15. Let φ(n) denote the number of positive integers less than or equal to n which are relatively prime to n. Over all integers 1 ≤ n ≤ 100, find the maximum value of φ(n2 + 2n) − φ(n2 ). 16. Let S denote the set of subsets of {1, 2, . . . , 2017}. For two sets A and B of integers, define A ◦ B as the symmetric difference of A and B. (In other words, A ◦ B is the set of integers that are an element of exactly one of A and B.) Let N be the number of functions f : S → S such that f (A◦B) = f (A)◦f (B) for all A, B ∈ S. Find the remainder when N is divided by 1000. 17. Let ABC be a triangle with BC = 7, AB = 5, and AC = 8. Let M, N be the midpoints of sides AC, AB respectively, and let O be the circumcenter of ABC. Let BO, CO meet AC, AB at P and Q, respectively. If M N meets P Q at R and OR meets BC at S, then the value of OS 2 can be written in the form m n where m, n are relatively prime positive integers. Find 100m + n. 18. Let p be an odd prime number less than 105 . Granite and Pomegranate play a game. First, Granite picks a integer c ∈ {2, 3, . . . , p − 1}. Pomegranate then picks two integers d and x, defines f (t) = ct + d, and writes x on a sheet of paper. Next, Granite writes f (x) on the paper, Pomegranate writes f (f (x)), Granite writes f (f (f (x))), and so on, with the players taking turns writing. The game ends when two numbers appear on the paper whose difference is a multiple of p, and the player who wrote the most recent number wins. Find the sum of all p for which Pomegranate has a winning strategy.  i  is 19. For each integer 1 ≤ j ≤ 2017, let Sj denote the set of integers 0 ≤ i ≤ 22017 − 1 such that 2j−1 an odd integer. Let P be a polynomial such that

2

OMO Spring 2017 March 24 - April 4, 2017



 Y

P (x0 , x1 , . . . , x22017 −1 ) =

1 −

Y

xi  .

i∈Sj

1≤j≤2017

Compute the remainder when X

P (x0 , . . . , x22017 −1 ) ∈{0,1}22017

(x0 ,...,x22017 −1 ) is divided by 2017.

20. Let n be a fixed positive integer. For integer m satisfying |m| ≤ n, define Sm =

X i−j=m 0≤i,j≤n

2 2 lim S−n + S−n+1 + ... + Sn2

1 . Then 2i+j



n→∞

can be expressed in the form

p for relatively prime positive integers p, q. Compute 100p + q. q

21. Let Z≥0 be the set of nonnegative integers. Let f : Z≥0 → Z≥0 be a function such that, for all a, b ∈ Z≥0 : f (a)2 + f (b)2 + f (a + b)2 = 1 + 2f (a)f (b)f (a + b). Furthermore, suppose there exists n ∈ Z≥0 such that f (n) = 577. Let S be the sum of all possible values of f (2017). Find the remainder when S is divided by 2017. 22. Let S = {(x, y) | −1 ≤ xy ≤ 1} be a subset of the real coordinate plane. If the smallest real number that is greater than or equal to the area of any triangle whose interior lies entirely in S is A, compute the greatest integer not exceeding 1000A. 23. Determine the number of ordered quintuples (a, b, c, d, e) of integers with 0 ≤ a < b < c < d < e ≤ 30 for which there exist polynomials Q(x) and R(x) with integer coefficients such that xa + xb + xc + xd + xe = Q(x)(x5 + x4 + x2 + x + 1) + 2R(x). 24. For any positive integer n, let Sn denote the set of positive integers which cannot be written in the form an + 2017b for nonnegative integers a and b. Let An denote the average of the elements of Sn if the cardinality of Sn is positive and finite, and 0 otherwise. Compute $∞ % X An . 2n n=1 25. A simple hyperplane in R4 has the form k1 x1 + k2 x2 + k3 x3 + k4 x4 = 0 for some integers k1 , k2 , k3 , k4 ∈ {−1, 0, 1} that are not all zero. Find the number of regions that the set of all simple hyperplanes divide the unit ball x21 + x22 + x23 + x24 ≤ 1 into. 26. Let ABC be a triangle with AB = 13, BC = 15, AC = 14, circumcenter O, and orthocenter H, and let M, N be the midpoints of minor and major arcs BC on the circumcircle of ABC. Suppose P ∈ AB, Q ∈ AC satisfy that P, O, Q are collinear and P Q||AN , and point I satisfies IP ⊥ AB, IQ ⊥ AC. T Let H 0 be the reflection of H over line P Q, and suppose H 0 I meets P Q at a point T . If M N T can be √ m written in the form n for positive integers m, n where m is not divisible by the square of any prime, then find 100m + n. 3

OMO Spring 2017 March 24 - April 4, 2017 27. Let N be the number of functions f : Z/16Z → Z/16Z such that for all a, b ∈ Z/16Z: f (a)2 + f (b)2 + f (a + b)2 ≡ 1 + 2f (a)f (b)f (a + b)

(mod 16).

Find the remainder when N is divided by 2017. m for relatively prime positive integers m and n with m + n ≤ 10000. 28. Let S denote the set of fractions n The least fraction in S that is strictly greater than ∞  Y 1− i=0

1



102i+1

p , where p and q are relatively prime positive integers. Find 1000p + q. q √ √ 29. Let ABC be a triangle with AB = 2 6, BC = 5, CA = 26, midpoint M of BC, circumcircle Ω, and orthocenter H. Let BH intersect AC at E and CH intersect AB at F . Let R be the midpoint of EF and let N be the midpoint of AH. Let AR intersect the circumcircle of AHM again at L. Let the circumcircle of AN L intersect Ω and the circumcircle of BN C at J and O, respectively. Let circles AHM and JM O intersect again at U , and let AU intersect the circumcircle of AHC again at V 6= A. m for relatively prime positive integers The square of the length of CV can be expressed in the form n m and n. Find 100m + n. can be expressed in the form

30. Let p = 2017 be a prime. Given a positive integer n, let T be the set of all n × n matrices with entries in Z/pZ. A function f : T → Z/pZ is called an n-determinant if for every pair 1 ≤ i, j ≤ n with i 6= j, f (A) = f (A0 ), where A0 is the matrix obtained by adding the jth row to the ith row. Let an be the number of n-determinants. Over all n ≥ 1, how many distinct remainders of an are (pp − 1)(pp−1 − 1) ? possible when divided by p−1

4

The Online Math Open Fall Contest Solutions September 24-October 1, 2012

Contest Information Format The test will start Monday September 24 and end Monday October 1. You will have until 7pm EST on October 1 to submit your answers. The test consists of 30 short answer questions, each of which has a nonnegative integer answer. The problem difficulties range from those of AMC problems to those of Olympiad problems. Problems are ordered in roughly increasing order of difficulty.

Team Guidelines Students may compete in teams of up to four people. Participating students must not have graduated from high school. International students may participate. No student can be a part of more than one team. The members of each team do not get individual accounts; they will all share the team account. Each team will submit its final answers through its team account. Though teams can save drafts for their answers, the current interface does not allow for much flexibility in communication between team members. We recommend using Google Docs and Spreadsheets to discuss problems and compare answers, especially if teammates cannot communicate in person. Teams may spend as much time as they like on the test before the deadline.

Aids Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids are not allowed. This is includes (but is not limited to) Geogebra and graphing calculators. Published print and electronic resources are not permitted. (This is a change from last year’s rules.) Four-function calculators are permitted on the Online Math Open. That is, calculators which perform only the four basic arithmetic operations (+-*/) may be used. Any other computational aids such as scientific and graphing calculators, computer programs and applications such as Mathematica, and online databases is prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors.

Clarifications Clarifications will be posted as they are answered. For the Fall 2012-2013 Contest, they will be posted at here. If you have a question about a problem, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer.

Scoring Each problem will be worth one point. Ties will be broken based on the highest problem number that a team answered correctly. If there are still ties, those will be broken by the second highest problem solved, and so on.

Results After the contest is over, we will release the answers to the problems within the next day. If you have a protest about an answer, you may send an email to [email protected] (Include “Protest” in the subject). Solutions and results will be released in the following weeks.

September/October 2012

Fall OMO 2012-2013

Page 3

Note. Some of the solutions were taken from the Art of Problem Solving discussion threads; we have given due credit whenever appropriate. 1. Calvin was asked to evaluate 37 + 31 × a for some number a. Unfortunately, his paper was tilted 45 degrees, so he mistook multiplication for addition (and vice versa) and evaluated 37 × 31 + a instead. Fortunately, Calvin still arrived at the correct answer while still following the order of operations. For what value of a could this have happened? Answer:

37 .

Solution. We have to solve a linear equation 37 + 31a = 37 × 31 + a. It is easy to check that a = 37 works, and since the equation is linear, it is the only solution. (Alternatively, just solve the equation. :) ) This problem was proposed by Ray Li 2. Petya gave Vasya a number puzzle. Petya chose a digit X and said, “I am thinking of a three digit number that is divisible by 11. The hundreds digit is X and the tens digit is 3. Find the units digit.” Vasya was excited because he knew how to solve this problem, but then realized that the problem Petya gave did not have an answer. What digit X did Petya chose? Answer:

4.

Solution. The numbers X30, X31, . . . , X39 must all not be multiples of 11. It follows that X29 and X40 must be divisible by 11. From the later it is easy to see that X must be 4. This problem was proposed by Ray Li 3. Darwin takes an 11 × 11 grid of lattice points and connects every pair of points that are 1 unit apart, creating a 10 × 10 grid of unit squares. If he never retraced any segment, what is the total length of all segments that he drew? Clarifications: • The problem asks for the total length of all *unit* segments (with two lattice points in the grid as endpoints) he drew. Answer:

220 .

Solution. The horizontal segments form 11 rows with 10 unit segments each, making 110 unit horizontal segments. Similarly, there are 110 vertical segments, for 220 unit segments total, and the length is thus 220. This problem was proposed by Ray Li. 4. Let lcm(a, b) denote the least common multiple of a and b. Find the sum of all positive integers x such that x ≤ 100 and lcm(16, x) = 16x. Answer:

2500 .

Solution. The key idea is to note that the condition holds if and only if x is odd. We present one of many arguments for why this is true: One can show that for positive integers a, b, gcd(a, b) · lcm(a, b) = ab. From this, it follows that gcd(16, x) = 1, so x must be odd. We thus need to compute the sum of the odd numbers less than 100, which is 502 = 2500. In a general form, the fact key fact for the above explanation is that gcd(a, b) = 1 if and only if lcm(a, b) = ab. This problem was proposed by Ray Li.

September/October 2012

Fall OMO 2012-2013

Page 4

5. Two circles have radius 5 and 26. The smaller circle passes through center of the larger one. What is the difference between the lengths of the longest and shortest chords of the larger circle that are tangent to the smaller circle? Answer:

4.

Solution. The longest possible chord is a diameter of the larger circle, so the maximum length is 52. The shortest possible chord is intuitively the chord tangent to the smaller circle parallel to said diameter, which one can compute with pythagorean theorem to be 48. This gives the answer of 4. The above was all that was expected of participants.* However, the interested student can consider the following proof that the intuitively shortest chord actually is the shortest chord. Let the tangency point of the smaller circle with the chord divide the chord into segments of length x and y, and let d be the distance from the tangency point to the center. Clearly, we have d ≤ 10. Now we have, by power of a point 262 − d2 = xy. But by the above and AM-GM, we have 2  x+y 242 = 262 − 102 ≤ 262 − d2 = xy ≤ 2 √ whence x + y ≥ 48. (The AM-GM inequality states that 2 xy ≤ x + y for positive reals x, y.) This problem was proposed by Ray Li. 6. An elephant writes a sequence of numbers on a board starting with 1. Each minute, it doubles the sum of all the numbers on the board so far, and without erasing anything, writes the result on the board. It stops after writing a number greater than one billion. How many distinct prime factors does the largest number on the board have? Answer:

2.

Solution. After listing a few terms, we notice that the numbers on the board have the following pattern: 1, 2, 2 · 3, 2 · 32 , 2 · 33 , . . .. One can show by induction using a geometric series that every term after the first will be twice a power of 3, where the exponent increases by 1 each time. Hence the largest number on the board will have exactly 2 prime factors. This problem was proposed by Ray Li. 7. Two distinct points A and B are chosen at random from 15 points equally spaced around a circle centered at O such that each pair of points A and B has the same probability of being chosen. The probability that the perpendicular bisectors of OA and OB intersect strictly inside the circle can be expressed in the form m n , where m, n are relatively prime positive integers. Find m + n. Answer:

11 .

Solution. Notice that the condition does not change if we rotate the circle, so if we label the points 1, 2, . . . , 15, we can assume without loss of generality that A is point 1. Now, by identifying equilateral triangles, we notice that the perpendicular bisectors of OA and OB intersect on the circle when B is point 6 or point 11, that is, 120 degrees apart. Now it is easy to see that when B is one of points 6, 7,

September/October 2012

Fall OMO 2012-2013

Page 5

8, 9, 10, or 11, then the condition is false, so there are 14 − 6 = 8 possibilities for B, so the answer is 8 4 14 = 7 =⇒ 4 + 7 = 11. This problem was proposed by Ray Li. 8. In triangle ABC let D be the foot of the altitude from A. Suppose that AD = 4, BD = 3, CD = 2, and AB is extended past B to a point E such that BE = 5. Determine the value of CE 2 . Clarifications: • Triangle ABC is acute. Answer:

80 .

√ Solution. By Pythagorean theorem, AB = 5 and AC = 20 so 5 = BA = BC = BE, but because B is on side AE, of triangle ACE, triangle ACE is a right angle! (If you have not seen this before, you are encouraged to google Thale’s theorem.) Now, we have by the Pythagorean theorem on 4ACE that CE 2 = AE 2 − AC 2 = 100 − 20 = 80. This problem was proposed by Ray Li. 9. Define a sequence of integers by T1 = 2 and for n ≥ 2, Tn = 2Tn−1 . Find the remainder when T1 + T2 + · · · + T256 is divided by 255. Answer:

20 .

Solution. Notice that every term from T3 on is a multiple of 8, hence every term from T4 is of the form 28x = 256x for some integer x. Hence, T4 , T5 , . . . , T256 all leave a remainder of 1 when divided by 255. Thus, we have T1 + T2 + · · · + T256 ≡ T1 + T2 + T3 + 253 ≡ 2 + 4 + 16 + 253 ≡ 20 (mod 255), so the answer is 20. This problem was proposed by Ray Li. 10. There are 29 unit squares in the diagram below. A frog starts in one of the five (unit) squares on the top row. Each second, it hops either to the square directly below its current square (if that square exists), or to the square down one unit and left one unit of its current square (if that square exists), until it reaches the bottom. Before it reaches the bottom, it must make a hop every second. How many distinct paths (from the top row to the bottom row) can the frog take?

September/October 2012

Answer:

Fall OMO 2012-2013

Page 6

256 .

Solution. Suppose instead of only jumping down, the frog made two paths: One from the center square to the top row, one from the center square to the bottom row. (We are essentially reversing the frog’s jumps in the upper half.) Call these paths “small” paths and the paths from top row to bottom row “big” paths. The number of pairs of such small paths is equal to the total number of big paths, because each big path is just two small paths joined together. Notice that for each small path, at any point, the frog has exactly 2 options on which square he can jump to. Thus, each small path has 16 possibilities, giving 162 = 256 total possibilities. This problem was proposed by Ray Li. 11. Let ABCD be a rectangle. Circles with diameters AB and CD meet at points P and Q inside the rectangle such that P is closer to segment BC than Q. Let M and N be the midpoints of segments AB and CD. If ∠M P N = 40◦ , find the degree measure of ∠BP C. Answer:

160 .

Solution. Notice P Q is parallel to AB, and by symmetry P Q bisects ∠M P N , so ∠BM P = ∠M P Q = ∠QP N = ∠P N C = ∠M2P N = 20◦ . Because M and N are the circumcenters of the two circles, we have M B = M P and N P = N C, so ∠M BP = ∠M P B = ∠N P C = ∠N CP = 80◦ , whence ∠P BC = ∠P CB = 90 − 80 = 10◦ , so ∠BP C = 180 − ∠P BC − ∠P CB = 160◦ . This problem was proposed by Ray Li. 12. Let a1 , a2 , . . . be a sequence defined by a1 = 1 and for n ≥ 1, an+1 = Answer:

p

a2n − 2an + 3 + 1. Find a513 .

33 .

Solution. One can rearrange the recursion to (an+1 − 1)2 = (an − 1)2 + 2. Thus, the sequence (a1 − 1)2 , (a2 − 1)2 , . . . is an increasing sequence of consecutive even numbers, starting at (a1 − 1)2 = 0. Thus, (an − 1)2 = 2n − 2, so the (a513 − 1)2 = 1024, and a513 = 33. This problem was proposed by Ray Li. 13. A number is called 6-composite if it has exactly 6 composite factors. What is the 6th smallest 6composite number? (A number is composite if it has a factor not equal to 1 or itself. In particular, 1 is not composite.) Answer:

441 .

Solution. We will casework on the number of prime factors of the number. Notice that if a 6-composite number has k prime factors, then it must have 7 + k total factors (primes, composites, and 1) If the number has 1 prime factor, then the number must have 8 factors, so it must be of the form p7 . The first few of these are 27 = 128, 37 , 57 . If the number has 2 prime factors, then the number must have 9 factors, so it must be of the form p2 q 2 , or (pq)2 (It cannot be p8 or q 8 because then the other prime disappears!) The first few terms are 62 = 36, 102 = 100, 142 = 196, 152 = 225, 212 = 441. If a number has 3 prime factors, there must be 10 factors total. However, this means that if the prime powers in the prime factorization are x, y, z, then (x + 1)(y + 1)(z + 1) = 10, and x, y, z ≥ 1, and this is impossible, so no solutions here.

September/October 2012

Fall OMO 2012-2013

Page 7

If a number has k ≥ 4 prime factors, then the number must have at least 2k factors, which is always bigger than 7 + k for k ≥ 4, so no solutions here. Merging our two sets of solutions together, we find that 441 is the sixth smallest element. This problem was proposed by Ray Li. 14. When Applejack begins to buck trees, she starts off with 100 energy. Every minute, she may either choose to buck n trees and lose 1 energy, where n is her current energy, or rest (i.e. buck 0 trees) and gain 1 energy. What is the maximum number of trees she can buck after 60 minutes have passed? Clarifications: • The problem asks for the maximum *total* number of trees she can buck in 60 minutes, not the maximum number she can buck on the 61st minute. • She does not have an energy cap. In particular, her energy may go above 100 if, for instance, she chooses to rest during the first minute. Answer:

4293 .

Solution. The key observation is that if she ever rests immediately before she bucks, switching the two operations will strictly increase the number of trees she bucks. It follows that all the resting should be done at the beginning. Now we just need to compute how many times she should rest. Let’s suppose she rests n times. Then she bucks 60 − n times, bucking 100 + n, 99 + n, . . . , (100 + n) − (60 − n) + 1 = 41 + 2n trees at the respective times*. Thus, because this is an arithmetic sequence, we can compute the sum to be (100+n)+(41+2n) (60 − n) trees. This is a quadratic in n, and we can find the 2 maximum to occur at n = 6.5, so she should either rest 6 or 7 times, both of which yield an answer of 4293. (In fact, we only have to plug in one of 6 and 7 since we know a priori by the symmetry of a parabola about its vertex that the values will be the same.) This problem was proposed by Anderson Wang. 15. How many sequences of nonnegative integers a1 , a2 , . . . , an (n ≥ 1) are there such that a1 · an > 0, n−1 Y a1 + a2 + · · · + an = 10, and (ai + ai+1 ) > 0? i=1

Clarifications: • If you find the wording of the problem confusing, you can use the following, equivalent wording: “How many finite sequences of nonnegative integers are there such that (i) the sum of the elements is 10; (ii) the first and last elements are both positive; and (iii) among every pair of adjacent integers in the sequence, at least one is positive.” Answer:

19683 .

Solution. We will biject the number of sequences to the following: Consider 10 balls in a row. There are 9 spaces in between the balls. In each space, we do one of three things: i) Stick a “space divider”; ii) Stick a “divider”; iii) Do nothing. We now let the lengths of consecutive sequences of balls with no dividers in between denote the an ’s, and space dividers denote zeros in between the nonzero numbers. (It’s simple to show that this is actually a bijection—prove it!)

September/October 2012

Fall OMO 2012-2013

Page 8

As an example, let x denote a ball, D denote a divider and S denote a space-divider. Then the sequence 4, 0, 3, 1, 0, 2 would correspond to xxxxSxxxDxSxx and the sequence 10 would correspond to xxxxxxxxxx. Clearly each of the 9 spaces has 3 options, giving an answer of 39 = 19683. Comment. Due to potential ambiguity even after the clarification, both 39 −1 = 19682 and 39 = 19683 were accepted as correct answers. This problem was proposed by Ray Li. 16. Let ABC be a triangle with AB = 4024, AC = 4024, and BC = 2012. The reflection of line AC over line AB meets the circumcircle of 4ABC at a point D 6= A. Find the length of segment CD. Answer:

3521 .

Solution. Let P be the intersection of AC and BD. One can angle chase to find 4ADP ∼ 4ABC by AA similarity, so ADP is iscoseles and AD = AP = 2(DP ). But 4ADP ∼ CBP so 2012 = CB = CP = 2(BP ), so BP = 1006. Hence AP = AB − BP = 3018, and DP = AP 2 = 1509, so CD = DP + CP = 1509 + 2012 = 3521. (No algebra necessary!) This problem was proposed by Ray Li. 17. Find the number of integers a with 1 ≤ a ≤ 2012 for which there exist nonnegative integers x, y, z satisfying the equation x2 (x2 + 2z) − y 2 (y 2 + 2z) = a. Clarifications: • x, y, z are not necessarily distinct. Answer:

1256 .

Solution. First we can note that setting y = 0 and x = 1 gives 2z + 1, so all odd numbers are possible. Additionally, setting y = 0 and x = 2 gives 4(4 + 2z) = 16 + 8z, so all positive multiples of 8 strictly greater than 8 are valid. This gives 1006 odd numbers plus 2008/8−1 = 250 for a total of 1256 possible numbers. Now we show that these are all possible values of a. Notice that the left side of the equation factors as (x2 + y 2 + 2z)(x + y)(x − y), so either all the factors are even or all of them are odd. Hence, if the expression is not odd, then it must be a multiple of 8, showing that only odd numbers and multiples of 8 are attainable. Now it just remains to show 8 is not attainable. Clearly x ≥ y. and x−y must be at least 2. Then, x ≥ 2, so x2 ≥ 4, and the whole product is at least (x2 + y 2 + 2z)(x + y)(x − y) ≥ (x2 )(x)(x − y) ≥ 4 · 2 · 2 = 16. Thus, the expression cannot equal 8, so the answer is 1256. This problem was proposed by Ray Li. 18. There are 32 people at a conference. Initially nobody at the conference knows the name of anyone else. The conference holds several 16-person meetings in succession, in which each person at the meeting learns (or relearns) the name of the other fifteen people. What is the minimum number of meetings needed until every person knows everyone elses name? Answer:

6.

September/October 2012

Fall OMO 2012-2013

Page 9

Solution. Let n = 16, and suppose for contradiction that 5 meetings suffice. Construct a bipartite graph S ∪ T with S the set of 5 Kn s and T the vertices of the K2n ; draw n red edges from fixed s ∈ S to the n vertices t ∈ T such that t ∈ s (abuse of notation here, but the meaning is clear); draw blue edges between any two vertices in T sharing a common Kn . We need every two vertices of T to have a blue edge. There are 5n red edges, so some t ∈ T has red-degree less than 5n/2n, so at most 2, say to s1 , s2 . But every t 6= t in T shares a blue edge with t, so N (s1 ) ∪ N (s2 ) = T . But deg s1 = deg s2 = n, |T | = 2n, and t ∈ N (s1 ) ∩ N (s2 ), so we get a contradiction by PIE. Note that the same logic will not work when we change Kn and K2n to Kn and Kmn for some m > 2. For the construction, partition the 32 members into 4 groups of 8, and let Gi ∪ Gj be the six meetings for 1 ≤ i < j ≤ 4. Comment. As noted by Calvin Deng, the answer is in fact the same for all odd n ≥ 3. The proof that 5 meetings do not suffice still works, but the construction is significantly harder—we leave it to the interested reader. See the discussion so far on AoPS. This problem was proposed by Victor Wang. 19. In trapezoid ABCD, AB < CD, AB ⊥ BC, AB k CD, and the diagonals AC, BD are perpendicular at point P . There is a point Q on ray CA past A such that QD ⊥ DC. If AP QP + = AP QP AP BP − can be expressed in the form then AP BP m + n. Answer:

m n



51 14

4 − 2,

for relatively prime positive integers m, n. Compute

61 .

Solution. We will use the following fact multiple times in our solution: If ABC is a right triangle with D the foot of the altitude from the right angle A, then AD2 = BD · CD. (Try to prove it if you haven’t seen this before.) Without loss of generality let AP = 1, and BP = r. Using the above fact on 4ABC, we have (CP )(AP ) = BP 2 , so CP = r2 . Using it on 4BCD yields CP 2 = (BP )(DP ) so DP = r3 , and finally on 4CDQ, we have DP 2 = (CP )(P Q), so P Q = r4 . Thus, our condition becomes 1 r + 4 = r 4



51 14

4 − 2.

September/October 2012

Fall OMO 2012-2013

Page 10

We would like to find r − 1r , so we can manipulate the above to obtain the answer: 

2

1 +2= r4 1 r2 + 2 = r  2 1 1 r− = r2 + 2 − 2 = r r 1 r− = r

r2 +

1 r2

= r4 +

4 51 14 512 142 512 − 2 · 142 472 = 2 2 14 14 47 , 14



whence our final answer is 47 + 14 = 61. This problem was proposed by Ray Li. 20. The numbers 1, 2, . . . , 2012 are written on a blackboard. Each minute, a student goes up to the board, chooses two numbers x and y, erases them, and writes the number 2x + 2y on the board. This continues until only one number N remains. Find the remainder when the maximum possible value of N is divided by 1000. Answer:

538 .

Pn Solution. Let n = 2012. N is simply the the maximum value of S = k=1 2ak k over all n-tuples Pn (a1 , a2 , . . . , an ) of nonnegative integers satisfying k=1 2−ak = 1. (Why?) Suppose (a1 , a2 , . . . , an ) achieves this maximum value, so a1 ≤ a2 ≤ · · · ≤ an . Assume for contradiction that (a1 , a2 , . . . , an ) 6= (1, 2, . . . , n − 2, n − 1, n − 1); then there exists an index k and a nonnegative integer i such that ak = ak+1 = ak+2 = i. (Prove this!) Since 2−ak + 2−ak+1 + 2−ak+2 ≤ 1, i ≥ 2, so because 21 + 81 + 18 = 14 + 14 + 14 and (2i−1 − 2i )k + (2i+1 − 2i )(k + 1) + (2i+1 − 2i )(k + 2) > 0, replacing (ak , ak+1 , ak+2 ) with (ak − 1, ak+1 + 1, ak+2 + 1) increases S, contradiction. Finally, we compute N = 2n−1 n +

n−1 X

2k k = 2n−1 n + 2n (n − 2) + 2

k=1

= 2n−1 (3n − 4) + 2 = 22011 (6032) + 2 ≡ 22016 + 2

(mod 1000).

Since 22016 ≡ 0 (mod 8) and 22016 ≡ 216 = 2562 ≡ 62 = 36 (mod 125) (we use φ(125) = 100), we find N ≡ 536 + 2 = 538 (mod 1000). This problem was proposed by Victor Wang. 21. A game is played with 16 cards laid out in a row. Each card has a black side and a red side, and initially the face-up sides of the cards alternate black and red with the leftmost card black-side-up. A

September/October 2012

Fall OMO 2012-2013

Page 11

move consists of taking a consecutive sequence of cards (possibly only containing 1 card) with leftmost card black-side-up and the rest of the cards red-side-up, and flipping all of these cards over. The game ends when a move can no longer be made. What is the maximum possible number of moves that can be made before the game ends? Answer:

43690 .

Solution. Suppose that instead of colors, we used binary digits, and we said that a red side had a 0 and a black side had a 1. Notice that if we read the binary digits on the cards from left to right, the flipping sequence is equivalent to subtracting a power of 2 from the number. Because it is always possible to subtract 1 (take the rightmost black card and all the red cards to its right), we can use up to the number 8 of moves equal to the binary number at the beginning, which is 215 + 213 + · · · + 21 = 2 · 4 3−1 = 43960. Comment 1. There is a perhaps more standard “smoothing” solution to this problem that does not explicitly require the binary observation. Let g(W ) to be the “flipping” operation on a sequence of face-up sides b and r, and define f (W ) to be the answer for an initial “word” W of face-up sides b and r (here it’s (br)8 = brbr . . . br). Then f (W ) = 1 + max f (U g(brk )V ), where the maximum is taken over all representations of W in the form U brk V for some nonnegative integer k and words U, V (possibly empty). We leave the rest to the interested reader. Comment 2. It may be interesting to consider the problem in which a move must consist of at least 2 cards; see the discussion so far on AoPS. This problem was proposed by Ray Li. 22. Let c1 , c2 , . . . , c6030 be 6030 real numbers. Suppose that for any 6030 real numbers a1 , a2 , . . . , a6030 , there exist 6030 real numbers {b1 , b2 , . . . , b6030 } such that an =

n X

bgcd(k,n)

k=1

and bn =

X

cd an/d

d|n

for n = 1, 2, . . . , 6030. Find c6030 . Answer:

528 .

Solution. Let φ denote Euler’s totient function. We have an =

n X

bgcd(k,n) =

k=1

X

φ(d)bn/d

d|n

=

X d|n

φ(d)

X e|n/d

ce an/de =

X d|n

an/d

X

ce φ(d/e)

e|d

P for all choices of ai , so d|n cd φ(n/d) = [n = 1] for n = 1, 2, . . . , 6030. By strong induction we can Q show that for n ≥ 1, cn = p|n (1 − p), where the product runs over all distinct primes p dividing n.

September/October 2012

Fall OMO 2012-2013

Page 12

Indeed, we clearly have c1 = 1, and assuming the result up to n − 1 for some n > 1, it suffices to show that X Y φ(n/d) (1 − p) = 0. d|n

p|d

But the LHS is simply X

Y

S⊆{p:p|n} p∈S

(1 − p)

X

φ(n/d) =

d|n,{p:p|d}=S

X S⊆{p:p|n}

=

X

φ

n Q vp (n) p∈S p

(−1)

|S|

! Y p∈S

φ(n) = φ(n)

S⊆{p:p|n}

where we have used the fact that

P

d|m

pvp (n)−1 (1 − p)

Y (1 − 1) = 0, p|n

φ(d) = m for all positive integers m.

Finally, we have c6030 = c2·32 ·5·67 = (1 − 2)(1 − 3)(1 − 5)(1 − 67) = 528. Comment. A good grasp of multiplicative functions (which the proposer expects many contestants used without proof) makes this problem easier to handle. Indeed, if φ−1 denotes the Dirichlet inverse, then φ−1 (pk ) = 1 − p for all primes p and positive integers k, so the answer is φ−1 (6030) = φ−1 (2)φ−1 (32 )φ−1 (5)φ−1 (67) = (1 − 2)(1 − 3)(1 − 5)(1 − 67) = 528. Alternatively, one can find a P∞ P∞ φ(n) P∞ φ−1 (n) ζ(s−1) solution using the Dirichlet series n=1 φ(n) n=1 n=1 ns ns = ζ(s) and the fact that 1 = ns . This problem was proposed by Victor Wang. 23. For reals x ≥ 3, let f (x) denote the function √ −x + x 4x − 3 . f (x) = 2 Let a1 , a2 , . . ., be the sequence satisfying a1 > 3, a2013 = 2013, and for n = 1, 2, . . . , 2012, an+1 = f (an ). Determine the value of 2012 X a3i+1 a1 + . a2 + ai ai+1 + a2i+1 i=1 i Answer:

4025 . √

Solution. First note that a = −x+x2 4x−3 is a root of the quadratic a2 + ax + x2 − x3 = 0, so from an+1 = f (an ) we obtain a3i = a2i + ai ai+1 + a2i+1 . Next, note that 2012 X i=1

2012 2012 2012 X X X a3i+1 a3i+1 − a3i a3i − = = (ai+1 −ai ) = a2013 −a1 , 2 2 2 2 2 2 ai + ai ai+1 + ai+1 i=1 ai + ai ai+1 + ai+1 a + ai ai+1 + ai+1 i=1 i i=1

September/October 2012

Fall OMO 2012-2013

Page 13

so we find that a1 +

2012 X i=1

2012

X a3i+1 a3i = a + 2013 a2i + ai ai+1 + a2i+1 a2 + ai ai+1 + a2i+1 i=1 i = 2013 +

2012 X

1

i=1

= 2013 + 2012 = 4025. This problem was proposed by Ray Li. 24. In scalene 4ABC, I is the incenter, Ia is the A-excenter, D is the midpoint of arc BC of the circumcircle of ABC not containing A, and M is the midpoint of side BC. Extend ray IM past M to point P such that IM = M P . Let Q be the intersection of DP and M Ia , and R be the point on the line M Ia such QM m a that AR k DP . Given that AI AI = 9, the ratio RIa can be expressed in the form n for two relatively prime positive integers m, n. Compute m + n. Clarifications: • “Arc BC of the circumcircle” means “the arc with endpoints B and C not containing A”. Answer:

11 .

Solution. First we will show that Q is the centroid of triangle BCIa . Notice that BICP is a parallelogram, so because BI ⊥ BIa , CP ⊥ BIa , and similarly, BP ⊥ CIa . Hence, P is the orthocenter of BCIa . Furthermore, one can angle chase to show that ∠IBD = ∠BID = A+B 2 , so BD = ID, and similarly, CD = ID, so D is the circumcenter of triangle BIC. But because ∠IBIa = ∠ICIa = 90, BICIa is cyclic, so it follows that D is also the circumcenter of BCIa . Hence, DP is the Euler Line of triangle BCIa , and because M Ia is a median, Q is the centroid. WLOG, AI = 1 and AIa = 9. Now, DI = DIa = IIa /2 = 4. By AA similarity, 4ARIa ∼ 4DQIa , so MQ QIa DIa 4 2 RIa = AIa = 9 . However, because Q is the centroid of BCIa , 2M Q = QIa , so RIa = 9 , so the answer is 2 + 9 = 11. This problem was proposed by Ray Li. 25. Suppose 2012 reals are selected independently and at random from the unit interval [0, 1], and then 1 written in nondecreasing order as x1 ≤ x2 ≤ · · · ≤ x2012 . If the probability that xi+1 − xi ≤ 2011 for m i = 1, 2, . . . , 2011 can be expressed in the form n for relatively prime positive integers m, n, find the remainder when m + n is divided by 1000. Answer:

601 .

Solution 1. Let N = 2012 and M = 1, 2, . . . , N − 1.

1 2011 ;

we want the probability that xi+1 − xi ≤ M for i =

We claim that the probability xi+1 − xi > M for all i ∈ S (where S is a fixed set of indices; call this an S-violating set of points/reals) is max(0, 1 − M |S|)N . (*) Indeed, in the nontrivial case 1 − M |S| > 0, each S-violating set corresponds to a unique set of N points from the interval [0, 1 − M |S|] (and vice

September/October 2012

Fall OMO 2012-2013

Page 14

versa): for each i ∈ S, we simply “remove” the segment [xi , xi + M ) from the interval [xi , xi+1 ) (or for the other direction, we “insert” the segment [x0i , x0i + M ) at the beginning of the interval [x0i , x0i+1 )). QN −1 By (*) and PIE, the desired probability is (using properties of finite differences and j=0 ((1 − kM ) − (1 − jM )) = 0) N −1 X

(−1)k

k=0



   N −1 X N −1 N −1 max(0, 1 − kM )N = (−1)k (1 − kM )N k k k=0   N −1 N −1 X X N −1 = (−1)k (1 − kM )N −1 (1 − jM ) k j=0 k=0

N −1 X

   N −1 N (N − 1) (−M )N −1 k N −1 N − M 2 k k=0   N −1 N X N − 1 N −1 = M N −1 (−1)N −1−k k 2 k k=0    N −1 X k N −1−k N − 1 N −1 N (−1) (N − 1)! =M 2 k N −1 =

(−1)k



k=0

N 1006 · 2010! = M N −1 (N − 1)! = . 2 20112010 Thus our answer is m + n = 1006 · 2010! + 2011

2010

2010

≡ 11

    2010 2010 2 ≡ 10 + 10 + 1 ≡ 601 2 1

(mod 1000).

Solution 2. Let the xi+1 − xi = ai . Now we would like to find the volume of solutions such that 1 in 2011-D space. x2012 = x1 + a1 + · · · + a2011 ≤ 1 and (a1 , a2 , . . . , a2011 ) is in a cube side 2011 Now, notice that for any point (a1 , a2 , . . . , a2011 ) the possible solutions for x1 form a segment of size 1 − (a1 + · · · + a2011 ), so the answer is 1 1 Z 2011 Z 2011 2012! · ··· 1 − (a1 + · · · + a2011 ) da1 da2 . . . da2011 0

0

We multiply by 2012! because originally the numbers could have been in any order. The 1 integrates 1 to 201112011 and the other terms integrate to 2·2011 2012 each. Adding gives that the answer is   1 2011 2012! 2012! − = 20112011 2 · 20112012 2 · 20112011 And we can finish as in the first solution. Solution 3. Equivalently, we want the probability that y1 , y2 , . . . , yN −1 ≤ M for a random solution in nonnegative integers to y0 + y1 + · · · + yN = 1, or R∞ RM [x1 ]( 0 xt dt)N −1 ( 0 xt dt)2 R∞ . [x1 ]( 0 xt dt)N +1

September/October 2012

Fall OMO 2012-2013

Page 15

R ∞ t L−1 RM M 1 −L xt dt (note that this But 0 xt dt = xln −1 = (L−1)! x and for positive integers L, (− ln x) R∞ t 0 −1 is the gamma function when x = e , and for L = 1 we have 0 x dt = (− ln x)−1 ). Now by “convolution,” we find 1

Z

M t

!N −1 Z



x dt

[x ] 0

2 x dt = [x1 ](1 − xM )N −1 (− ln x)−(N −1) (− ln x)−2 t

0

= [x1 ](1 − xM )N −1 =

and [x1 ]

Z 0



1 N!

X

1 N!

Z



xt tN dt 0  k N −1 (−1) (1 − kM )N k 1

0≤k≤N −1, M

N +1 Z ∞ 1 1 xt dt = [x1 ](− ln x)−(N +1) = [x1 ] xt tN dt = . N! 0 N!

We finish in the same way as Solution 1. Solution 4. For any real r and positive number s let r (mod s) denote the value t ∈ [0, s) such that r−t s is an integer. For any set of reals X = {x1 , x2 , . . . , xN } with 0 ≤ x1 ≤ · · · ≤ xN ≤ 1, let yi = xi (mod N 1−1 ) and πX denote the permutation of {1, 2, . . . , N } such that 0 ≤ yπX (1) ≤ · · · ≤ yπX (N ) < 1 1 N −1 . (We can arbitrarily break ties in πX if xi and xj are congruent modulo N −1 for some indices i, j with i 6= j, as such cases are negligible—note that zero probability doesn’t imply impossibility.) Given a permutation π, let a bad pair be a pair (i, i + 1) such that π(i) > π(i + 1). Now fix a permutation σ with K bad pairs; then there exist N − K − 1 sets X such that πX = σ. (Why?) If S(N, K) denotes the number of permutations σ of {1, 2, . . . , N } with K bad pairs, then for a fixed set of values Y (X) = {y1 , y2 , . . . , yN }, there are A=

N −1 X

(N − K − 1)S(N, K)

K=0

sets X such that 0 ≤ x1 ≤ · · · ≤ xN ≤ 1 and xi+1 − xi ≤ N 1−1 for all indices i. But for any permutation σ with K bad pairs, the new permutation σ 0 defined by σ 0 (i) = N + 1 − σ(i) has N − K − 1 bad pairs. Hence S(N, K) = S(N, N − K − 1), so 2A = (N − 1)

N −1 X

S(N, K) = (N − 1)N !

K=0

by pairing up terms, whence A =

(N −1)N ! . 2 N

Finally, because there are (N − 1) sets X such that 0 ≤ x1 ≤ · · · ≤ xN ≤ 1 for a fixed set Y (X) = {y1 , y2 , . . . , yN }, and N 1−1 | 1 means each set X is equally weighted by symmetry, the desired A N! probability for fixed Y (X) is L = (N −1) N = 2(N −1)N −1 . But this value depends only on N (and in particular, not on Y (X)), so the desired probability over all valid sets X is L as well, and we’re done.

September/October 2012

Fall OMO 2012-2013

Page 16

Comment. While the second and fourth solutions are nice, they do not generalize as easily as the first and third. (Why?) The “discrete” analog (see, for instance, this discussion) is perhaps easier to solve, and can be used “asymptotically” to solve the “continuous” version presented here (e.g. by taking a limit). This problem was proposed by Victor Wang. The second solution was provided by Ray Li. The fourth solution was provided by Sohail Farhangi. 26. Find the smallest positive integer k such that     x + kb x ≡ (mod b) 12 12 for all positive integers b and x. (Note: For integers a, b, c we say a ≡ b (mod c) if and only if a − b is divisible by c.) Clarifications:  y(y−1)···(y−11) y for all integers y. In particular, • 12 = 12! Answer:

y 12



= 0 for y = 1, 2, . . . , 11.

27720 .

Solution 1. Note that for fixed k and b, f (x) =

1 b



x+kb 12







x 12

is a polynomial in x of degree at

most 12 − 1 = 11. We want to find the smallest k such that f (Z) ⊆ Z, i.e. f takes on only integer values at integer inputs. The following observation gives us a clean characterization of such “integer-valued” polynomials. Fact. Suppose P is a polynomial in x of degree at most d. Then P is integer-valued if and only if there exist integers a0 , a1 , . . . , ad such that

P (x) =

d X i=0

ai

  x . i

Proof Outline. Consider the first d + 1 finite differences of P and use Newton interpolation. (See Lemma 1 in the first link for a complete proof.)  But by the Vandermonde convolution identity, 1 f (x) = b



    12   x + kb x 1 X kb x − = , 12 12 b i=1 i 12 − i

so we just need to find the smallest k such that positive integers b.

k kb−1 i i−1



=

1 kb b i



∈ Z for all i ∈ {1, 2, . . . , 12} and

We immediately see that k = lcm(1, 2, . . . , 12) = 27720 works, since then any b.

k i

∈ Z for i = 1, 2, . . . , 12 and

Proving that i | k for i = 1, 2, . . . , 12 is only slightly harder. Suppose otherwise for some fixed i;   )−1 then there exists a positive integer T such that kc−1 ≡ k(c+T (mod i) for all integers c (not i−1 i−1

September/October 2012

Fall OMO 2012-2013

necessarily positive). (Why?) Taking c = 0 and b = c + T = T , we have  But −1 = (−1)r for all nonnegative integers r, contradiction. r

Page 17

k −1 i i−1



∈ Z by assumption.

Solution 2. We start with a helpful lemma (from math.stackexchange) for the case b = p.  n Lemma. Fix a positive integer m and a prime p. Then m is periodic modulo p with (minimum) 1+blogp (m)c period equal to p . Proof (Jyrki Lahtonen). Let e = 1+blogp (m)c. It is relatively easy to show that if the base p expansions P Pe−1 of n and m are n = i≥0 ni pi and m = i=0 mi pi , with 0 ≤ ni , mi < p for all i, then   Y  n ni ≡ (mod p) k mi i≥0

by Lucas’ theorem. The periodicity then follows from the fact that adding pe to n leaves the base ni p-digits ni unchanged for i < e, yet for i ≥ e, m = 1 (as mi = 0). But then the minimum period i e divides p and must be a power of p, so similar reasoning shows that pe is in fact the minimum period. The lemma immediately shows that 27720 = lcm(1, 2, . . . , 12) | k, so it remains to show that k = lcm(1, 2, . . . , 12) works.  e+r  n Using the notation from the proof of the lemma, it now suffices to prove that p1+r | n+pm − m = m n pe+r e [t ](1 + t) ((1 + t) − 1) for all n ≥ 0 and r ≥ 0. (We leave n < 0 to the reader.) As p > m, it’s  e+r e+r e+r  e+r  enough to show that p1+r | p l for l = 1, 2, . . . , pe − 1. But p l = p l p l−1−1 ≡ 0 (mod p1+r ) since pe - l, so we’re done. Comment. In the second solution, we can also finish with the fact that if f (t)−g(t) has all coefficients divisible by ps for two polynomials f, g with integer coefficients, then f (t)p − g(t)p has all coefficients divisible by ps+1 . (Just write f (t) = g(t) + ph(t) to prove this.) Indeed, it then follows by induction e+r e r on r ≥ 0 that (1 + t)p − (1 + tp )p has all coefficients divisible by p1+r . This problem was proposed by Alex Zhu. The second solution was provided by Lawrence Sun. 27. Let ABC be a triangle with circumcircle ω. Let the bisector of ∠ABC meet segment AC at D and circle ω at M 6= B. The circumcircle of 4BDC meets line AB at E 6= B, and CE meets ω at P 6= C. The bisector of ∠P M C meets segment AC at Q 6= C. Given that P Q = M C, determine the degree measure of ∠ABC. Answer:

80 .

Solution. Let the angles of the triangle be A, B, and C. We can angle chase to find ∠ACP, = ∠DCE = ∠DBE = ∠ABM = ∠M BC. Thus, it follows that arcs AP, AM , and M C have the same d = AM d , and because M Q is length, so AP = AM = M C. Thus, AP = P Q. Now, note that by AP the bisector of ∠P M C, Q is the incenter of triangle P M C. \ = 180 − 3B Now we can angle chase all the angles in terms of B. P\ AM C = 3B, so ∠P M C = P BC 2 2 . ∠P M C 3B By Q being the incenter of triangle M P C, we have ∠P QC = 90 + 2 = 180 − 4 , so ∠AQP = 3B 180 − ∠P QC = 3B 4 . Furthermore, ∠P AQ = ∠P AC = ∠P M C = 180 − 2 . By AP = P Q, we have 3B 3B 180 − 2 = 4 . Solving, we find B = 80.

This problem was proposed by Ray Li.

September/October 2012

Fall OMO 2012-2013

28. Find the remainder when

16

  2 X 2k k

k=1

is divided by 2 Answer:

16

Page 18

16

(3 · 214 + 1)k (k − 1)2

−1

+ 1. (Note: It is well-known that 216 + 1 = 65537 is prime.)

28673 . n

Solution. Let n = 4, p = 22 + 1 = 65537, S denote the sum in the problem; observe taht 3 · 214 + 1 ≡ 16 4−1 (mod p) and for k 6= 1, (k−1)2 −1 ≡ (k−1)−1 (mod p) by Fermat’s little theorem. It’s well-known   r  P 1 2r r − 12 (e.g. from the derivation of the generating function (1 − 4x)− 2 = r≥0 2r r r x ) that r = (−4) for all r ≥ 0. Thus   1   p−1  p−1 p−1 X X X 2k −k (−1)k p−1 −1 k −2 −1 2 S≡ 4 (k − 1) = (−1) (k − 1) ≡ (mod p). k k k−1 k k=2

k=2

By Wilson’s theorem,

 p i

k=2

≡ pi (−1)i−1 (mod p) for i = 1, 2, . . . , p − 1, so

 p−1   3p−1    p−1  p−1  X p p 2 2 2 pS ≡ = p−3 − k−1 k 1 0 2

(mod p2 )

k=2

by the Vandermonde convolution identity. Standard computations yield   p−3 p−3 p−3  3p−1  Y p+1−2i 2 2 2 Y X p + p + 1 − 2i 2 2 2 1 + p  ≡ = p−3 i 2i p + 1 − 2i 2 i=1 i=1 i=1

(mod p2 ).

Using Wilson’s theorem in the same manner as above, this expression simplifies (using the binomial theorem) to       p−1 p p p−1 ((2 − 2p ) − (p − 1)) 1 − 2 2p−1 − − ≡ 2 2 0 2 3 p2 − 2p + 1 ≡ 2p−1 − + p (mod p2 ), ≡ 2p−1 − 1 − 2 2 whence pS ≡ 2p−1 − 1 +

p 2

(mod p2 ). Finally, we have 2n

n

n n 2p−1 − 1 1 22 − 1 22 + 2 S≡ + ≡ 2n + ≡ −22 −n + 22 −1 + 1 = 28673 p 2 2 +1 2

as desired. (We use the fact that

x2s −1 x+1

(mod p),

= x2s−1 − x2s−2 ± · · · + x − 1 ≡ −2s (mod x + 1).)

This problem was proposed by Victor Wang. 29. In the Cartesian plane, let Si,j = {(x, y) | i ≤ x ≤ j}. For i = 0, 1, . . . , 2012, color Si,i+1 pink if i is even and gray if i is odd. For a convex polygon P in the plane, let d(P ) denote its pink density, i.e. the fraction of its total area that is pink. Call a polygon P pinxtreme if it lies completely in the region

September/October 2012

Fall OMO 2012-2013

Page 19

S0,2013 and has at least one vertex on each of the lines x = 0 and x = 2013. Given that the minimum value of d(P ) over all non-degenerate convex pinxtreme polygons P in the plane can be expressed in the form Answer:

√ (1+ p)2 q2

for positive integers p, q, find p + q.

2025079 .

Solution. Let M = 1006 and N = 2M + 1 = 2013. Suppose P = A1 A2 . . . Am B1 B2 . . . Bn , where A1 , Bn lie on x = 0 and Am , B1 lie on x = N with A1 above Bn and Am above B1 . As d(P ) is a (positively)-weighted average of (i) d(A1 A2 . . . Am ), (ii) d(A1 Am B1 Bn ), and (iii) d(B1 B2 . . . Bn ), we just need to consider (i) and (ii) to find the desired minimum ((i) and (iii) are analogous)—in each case, the relevant polygon is convex and pinxtreme. We first introduce a helpful lemma. Lemma. If X is a (not necessarily pinxtreme) non-degenerate convex polygon contained in S0,N with each of its vertices on a line of the form x = i (where 0 ≤ i ≤ N ), then d(X) = 12 . Proof. Induction on the number of vertices. Immediately from the lemma, we have d(A1 Am B1 Bn ) = 21 in case (ii), so it remains to consider case (i). By a simple induction, one can show that d(A1 A2 . . . Am ) is a (positively)-weighted average of the d(A1 Ai Am ) for i = 2, 3, . . . , m − 1. (The interested reader may work the details out.) The rest is standard computation. If Ai is in a pink region, then d(A1 Ai Am ) ≥ 12 , so we can assume Ai is in the gray region S2j−1,2j for some j ∈ [1, M ]. If Aj lies on the line x =2j − 1 + t (where t 1−t 0 ≤ t ≤ 1), then ratio chasing yields d(A1 Ai Am ) = 21 1 − t+2j−1 (1−t)+(2M +1−2j) . For fixed t, this quantity is minimized when (t + 2j − 1)((1 − t) + (2M + 1 − 2j)), a quadratic in j with negative leading coefficient, is as small as possible. But concave functions are minimized on the boundary, so we can assume by symmetry that j = 1. Finally, the desired minimum is 2  q (N −1)(N −2)   1+ 2 1 t(1 − t) , 1− = min 2 (1 + t)(N − 1 − t) N t∈[0,1] 2 so our answer is p + q = 1006 · 2011 + 2013 = 2025079 (this is a quadratic problem, so calculus is not necessary). Comment 1. One can do a lot of preliminary smoothing on P (which in fact works when 2013 is replaced by a positive even integer—try it!), but in the end the convexity/weighted averages idea seems essential.  

t(1−t) Comment 2. There is a nice way (by Lewis Chen) to find mint∈[0,1] 12 1 − (1+t)(N −1−t) . Indeed, if a = 1 + t and b = N − 1 − t, then this quantity simply becomes ! !2 !2 r r (N −1)(N −2) 1 (N − 1)(N − 2) 1 (N − 1)(N − 2) 1 1 2 + ≥ 1+ = 2 1+ N a b N (a + b) 2 N 2

by Titu’s lemma (there is also a direct interpretation for this expression), with equality at r (N − 1)(N − 2) N q b=a =⇒ a = ∈ (1, 2), 2 (N −1)(N −2) 1+ 2

September/October 2012

Fall OMO 2012-2013

Page 20

which is valid (as then t ∈ (0, 1)). This problem was proposed by Victor Wang. 30. Let P (x) denote the polynomial 3

9 X

k

x +2

k=0

1209 X

k

x +

k=10

146409 X

xk .

k=1210

Find the smallest positive integer n for which there exist polynomials f, g with integer coefficients satisfying xn − 1 = (x16 + 1)P (x)f (x) + 11 · g(x). Answer:

35431200 . 4

2

Solution. Let p = 11 and m = 10; then we can define Q(x) = (x − 1)P (x) = xmp + xmp + xm − 3. Working in Fp , we see that Q0 (1) = m 6= 0, so 1 is not a double root of Q and P (1) 6= 0 (this can also n −1 or equivalently, Q(x) | xn − 1. be verified directly). Thus P (x) | xn − 1 iff P (x) | xx−1 We now show that for positive integers n, (i) Q(x) | xn −1 (in Fp ) iff m(p6 −1) | n and (ii) x16 +1 | xn −1 2 2 6 iff 32 | n. The “if” direction is easy since Q(x) | Q(x)p − Q(x) = Q(xp ) − Q(x) = xmp − xm (and Q(0) 6= 0) and x16 + 1 | x32 − 1. The “only if” direction for (ii) is also easy. (Why?) For the “only if” direction of (i), first observe that Q(x) | xn − 1 =⇒ m | n. (Why?) If n = mN , then 4 2 we find f (x) = xp + xp + x − 3 | xN − 1. From the “if” direction, it will be enough to consider the 6 case 0 < N ≤ p − 1. (Why?) Let N = p4 A + B, where 0 ≤ A ≤ p2 − 1 and 0 ≤ B ≤ p4 − 1. If we set 2

S(x) = (3 − x − xp )A xB − 1; then

2

0 ≡ xN − 1 ≡ (3 − x − xp )A xB − 1 = S(x)

(mod f (x)). 2

But since (A, B) 6= (0, 0), p2 A + B ≥ deg f = p4 (otherwise we would need (3 − x − xp )A xB = 1). In particular, A, B > 0. Now write 4

2

0 ≡ S(x) = g(x)xp + h(x) ≡ (3 − x − xp )g(x) + h(x)

(mod f (x))

for polynomials g, h with deg h < p4 ; observe that since B < p4 , [xB ]h(x) = [xB ]S(x) = 3A 6= 0. Clearly deg g = deg S − p4 = p2 A + B − p4 , 2

2

so deg (3 − x − xp )g(x) ≤ p2 +p2 (p2 −1)+(p4 −1)−p4 = p4 −1 and thus (3−x−xp )g(x)+h(x) = 0 (in 2 Fp ). Yet from earlier we have [xB ]h(x) 6= 0, so [xB ](3−x−xp )g(x) 6= 0 and then p2 +p2 A+B −p4 ≥ B forces A = p2 − 1. Hence 2

2

2

0 ≡ (3 − x − xp )S(x) = (3 − x − xp )A+1 xB − (3 − x − xp ) 2

4

2

2

= (3 − xp − xp )xB − (3 − x − xp ) ≡ xB+1 + xp + x − 3 whence B = p4 − 1. Along with A = p2 − 1 this implies N = p6 − 1, as desired.

(mod f (x)),

September/October 2012

Fall OMO 2012-2013

Page 21

Combining (i) and (ii), we must have 2m(p6 − 1) = lcm(32, m(p6 − 1)) | n (it’s not difficult to find 6 6 v2 (m(p6 − 1)) = 4). On the other hand, P (x) | Q(x) | xm(p −1) − 1 while x16 + 1 | xm(p −1) + 1, so 6 (x16 + 1)P (x) | x2m(p −1) − 1 and the desired answer is 2m(p6 − 1) = 35431200. 4

2

Solution 2. Let f (x) = xp + xp + x − 3 as in the previous solution; here we present another proof of the crucial fact that f (x) | xN − 1 if and only if p6 − 1 | N . Since p 6= 3, f (x) | xN − 1 is equivalent 4 2 to xp + xp + x − 1 | xN − 3−N by Fermat’s little theorem (consider f (3x)). Now define the sequence {ci }∞ i=−∞ by ci = 0 for i < 0, c0 = 1, and for i > 0, ci = ci−1 + ci−p2 + ci−p4 . Then in fact f (x) | xN − 1 if and only if 3−N cN ≡ 1 (mod p) and cN −1 ≡ cN −2 ≡ · · · ≡ cN −p4 +1 ≡ 0 (mod p). (**) (Why?)  Observe that a+b+c ≡ 0 (mod p) whenever a + b + c ≥ p2 and 0 ≤ a, b, c < p2 , e.g. since if a > 0, a,b,c   a+b+c−1 then a+b+c = a+b+c and p2 - a. (***) a,b,c a a−1,b,c Lemma. Let i be a nonnegative integer less than p6 − 1. If i + 1 = d2 d1 d0 in base p2 (possibly with leading zeros), then   d0 + d1 + d2 (d0 + d1 + d2 )! (mod p). ci ≡ = d0 !d1 !d2 ! d0 , d1 , d2 Proof Outline. We proceed by strong induction on i ≥ 0, where the base case i = 0 is clear. Now suppose 1 ≤ i ≤ p6 − 2 and assume the result up to i − 1. The inductive step then follows from generalization of Pascal’s identity and (***), since ci = ci−1 + ci−p2 + ci−p4 . (There are two possible issues to consider: (i) leading zeros among d1 , d2 and (ii) carries—we leave the details to the interested reader, but note that (***) is quite important.) By (***) and the lemma, we find that cp6 −2 ≡ cp6 −3 ≡ · · · ≡ cp6 −p4 ≡ 0 (mod p), so  2  p −1+0+0 cp6 −1 = cp6 −2 + cp6 −p2 −1 + cp6 −p4 −1 ≡ 0 + 0 + = 1 (mod p). p2 − 1, 0, 0 But we also get c(d2 +1)(p4 −p2 )−1 ≡ [td2 ](1 + t)p

2

−1

d2 +(p2 −1−d2 )+0 d2 ,p2 −1−d2 ,0



6≡ 0 (mod p) for d2 = 0, 1, . . . , p2 − 1 (e.g. since

p2

6 ≡ [td2 ] 1+t 1+t 6≡ 0 (mod p)), so we see that p − 1 is the smallest N such that cN −1 ≡ 6

cN −2 ≡ · · · ≡ cN −p4 +1 ≡ 0 (mod p). But 3−(p −1) cp6 −1 ≡ cp6 −1 ≡ 1 (mod p) by Fermat’s little theorem, so by (**) p6 − 1 is in fact the smallest N such that f (x) | xN − 1, whence f (x) | xN − 1 if and only if p6 − 1 | N (in terms of the ci , this follows from the fact that ci ≡ ci+p6 −1 (mod p) for all i ≥ 0, which in turn follows from ci ≡ ci+p6 −1 (mod p) for i ∈ [−(p4 − 1), 0]). Comment. This problem was inspired by POTD 9/13 from WOOT 2010-2011 (restricted access): “Define the sequence an = n for n = 0, 1, . . . 4 and an = an−1 + an−5 for n ≥ 5. Suppose that r1 , r2 , r3 are the respective remainders when a50 , a100 , a150 are divided by 5. Find 100 · r1 + 10 · r2 + r3 .” Both solutions above, particularly the second (with its “magical formula”), can be motivated by this simpler 4 2 2 case (replacing xp + xp + x − 1 by xp + xp + x − 1 and then by xp + x − 1). Indeed, the “2-digit” p analog of x + x − 1 allows some sort of finite difference/degree considerations, which might not be as clear in the “3-digit” case. For instance, one solution to the simpler version goes as follows: we work modulo p. To prove that the period of the sequence divides p2 − 1, it suffices to find two consecutive, congruent p-tuplets. Notice

September/October 2012

Fall OMO 2012-2013

Page 22

that (a−p , a−p+1 , . . . , a−2 , a−1 ) = (p − 1, 1, 1, . . . , 1, 1) (simply extending the definition of the ai to negative i). By double induction on k and then i with Pascal’s identity, we can prove that for 1 ≤ k ≤ p − 2 and 0 ≤ i ≤ p − 1,     k+i k+i akp+i ≡ − (mod p). k+1 k−1 (This can be found by experimenting in groups of p; it’s sort of motivated by finite differences.) It then follows through some simple evaluation that (ap2 −p−1 , ap2 −p , . . . , ap2 −3 , ap2 −2 ) ≡ (p − 1, 1, 1, . . . , 1, 1). This problem was proposed by Victor Wang. The second solution was provided by Brian Chen.

September/October 2012

Fall OMO 2012-2013

Acknowledgments Contest Directors Ray Li, James Tao, Victor Wang

Head Problem Writers Ray Li, Victor Wang

Problem Contributors Ray Li, James Tao, Anderson Wang, Victor Wang, David Yang, Alex Zhu

Proofreaders and Test Solvers Mitchell Lee, James Tao, Anderson Wang, David Yang, Alex Zhu

Website Manager Ray Li

Page 23

The Online Math Open Solutions January 16-23, 2012

Note: Some of the solutions were taken from the Art of Problem Solving discussion threads. We have given the posters due credit at the ends of the solutions. 1. The average of two positive real numbers is equal to their difference. What is the ratio of the larger number to the smaller one? Solution. The answer is 3 . Let the numbers be x and y and assume without loss of generality x > y. Then we have It follows that x + y = 2x − 2y, so x = 3y and the answer is 3.

x+y 2

= x − y.

This problem was proposed by Ray Li. 2. How many ways are there to arrange the letters A, A, A, H, H in a row so that the sequence HA appears at least once? Solution. The answer is 9 . Every sequence is legal except AAAHH. Thus there are

5 2



− 1 = 9 sequences of letters.

This problem was proposed by Ray Li. 3. A lucky number is a positive number whose digits are only 4 or 7. What is the 17th smallest lucky number? Clarifications: • Lucky numbers are positive. • “only 4 or 7“ includes combinations of 4 and 7, as well as only 4 and only 7. That is, 4 and 47 are both lucky numbers. Solution. The answer is 4474 . There are 2 1-digit lucky numbers, 4 2-digit lucky numbers, and 8 3-digit lucky numbers. Thus we want the 3rd smallest 4-digit lucky number. We list them: 4444, 4447, 4474, 4477, ... so our answer is 4474. This problem was proposed by Ray Li. The solution was provided by ksun48. 4. How many positive even numbers have an even number of digits and are less than 10000? Solution. The answer is 4545 . Exactly half of the 90 2-digit numbers and exactly half of the 9000 4-digit numbers are even, giving a total of 90+9000 = 4545 numbers. 2 This problem was proposed by Ray Li. 5. Congruent circles Γ1 and Γ2 have radius 2012, and the center of Γ1 lies on Γ2 . Suppose that Γ1 and Γ2 intersect at A and B. The line through A perpendicular to AB meets Γ1 and Γ2 again at C and D, respectively. Find the length of CD. Solution. The answer is 4024 . The center of Γ2 , which we denote O2 , must lie on Γ1 , which we denote O1 , because their centers are 2012 apart. Also, ∠CO1 A = 60◦ , because ∠O2 O1 A = ∠O2 O1 B = 60◦ . Similarly, ∠DO2 A = 60◦ . Thus 4CO1 A and 4DO2 A are equilateral. This implies that CA = DA = 2012, so CD = 4024. This problem was proposed by Ray Li. The solution was provided by ksun48. 6. Alice’s favorite number has the following properties: • It has 8 distinct digits.

January 2012

OMO Solutions 2012

Page 3

• The digits are decreasing when read from left to right. • It is divisible by 180. What is Alice’s favorite number? Solution. The answer is 97654320 . Because Alice’s favorite number is divisible by 180, it must end in a 0. It must also be divisible by 20, so the penultimate digit must be even. The number has decreasing distinct digits, so it must be a 2. Finally, the number must be divisible by 9, which means the sum of the digits must be divisible by 9. The number must contain all the digits from 0 to 9 exactly once except 2 of them, and it is already missing 1. The remaining sum must be 36, so the other missing digit is 8. Thus our integer is 97654320. This problem was proposed by Anderson Wang. The solution was provided by ksun48. 7. A board 64 inches long and 4 inches high is inclined so that the long side of the board makes a 30 degree angle with the ground. √ The distance from the highest point on the board to the ground can be expressed in the form a + b c where a, b, c are positive integers and c is not divisible by the square of any prime. What is a + b + c? Clarifications: • The problem is intended to be a two-dimensional problem. The board’s dimensions are 64 by 4. The long side of the board makes a 30 degree angle with the ground. One corner of the board is touching the ground. Solution. The answer is 37 . Call the vertices of the board A, B, C, D where A is the vertex on the ground and AB is the long side of the board. The height of point B, by 30-60-90 triangles is 64 · 21 , and the difference in heights of √ √ C and B is, again by 30-60-90 triangles is 4 · 23 . This gives that C has a height of 32 + 2 3, so the answer is 32 + 2 + 3 = 37. This problem was proposed by Ray Li. 8. An 8 × 8 × 8 cube is painted red on 3 faces and blue on 3 faces such that no corner is surrounded by three faces of the same color. The cube is then cut into 512 unit cubes. How many of these cubes contain both red and blue paint on at least one of their faces? Clarifications: • The problem asks for the number of cubes that contain red paint on at least one face and blue paint on at least one other face, not for the number of cubes that have both colors of paint on at least one face (which can’t even happen). Solution. The answer is 56 . The blue faces and red faces meet at 8 edges. Each edge has 8 cubes. The 8 vertices are each counted twice, so our final answer is 8 · 8 − 8 = 56. This problem was proposed by Ray Li. The solution was provided by KingSmasher3. 9. At a certain grocery store, cookies may be bought in boxes of 10 or 21. What is the minimum positive number of cookies that must be bought so that the cookies may be split evenly among 13 people? Solution. The answer is 52 . The number of cookies must be a multiple of 3. It is easy to see that 13, 26, 39 are all impossible, but 52 = 2 × 21 + 10, so the answer is 52. This problem was proposed by Ray Li.

January 2012

OMO Solutions 2012

Page 4

10. A drawer has 5 pairs of socks. Three socks are chosen at random. If the probability that there is a pair among the three is m n , where m and n are relatively prime positive integers, what is m + n? Solution. The answer is 4 . There are 5 ways to chose a pair, then 8 ways to chose the remaining sock, giving a probability of 5·8 1  10 = 3 , 3 so the answer is 1 + 3 = 4. This problem was proposed by Ray Li. 11. If

1 1 1 1 1 1 + 3+ 4+ + ··· = + , x 2x2 4x 8x 16x5 64 m and x can be expressed in the form n , where m, n are relatively prime positive integers, find m + n. Solution. The answer is 131 . This is simply a geometric series: 1 1 1 1 1/x 1 2 1 1 + + 3+ 4+ + ··· = = =⇒ = . x 2x2 4x 8x 16x5 1 − 1/2x 64 2x − 1 64

Solving, we find 128 = 2x − 1 =⇒ x =

129 2 ,

so the answer is 129 + 2 = 131.

This problem was proposed by Ray Li. The solution was provided by tc1729. 12. A cross-pentomino is a shape that consists of a unit square and four other unit squares each sharing a different edge with the first square. If a cross-pentomino is inscribed in a circle of radius R, what is 100R2 ?

Solution. The answer is 250 . By the Pythagorean theorem, the distance from center to any corner is is 100 ·

5 2

q

12 2

+

32 2

=

q

5 2,

so the answer

= 250.

This problem was proposed by Ray Li. The solution was provided by BarbieRocks. 13. A circle ω has center O and radius r. A chord BC of ω also has length r, and the tangents to ω at B and C meet at A. Ray AO meets ω at D past O, and ray OA meets the circle centered at A with radius AB at E past A. Compute the degree measure of ∠DBE. Solution. The answer is 135 . Our strategy is to first find ∠BDE and ∠BED, then subtract their sum from 180 to get the desired answer. Note that 4BOC is equilateral, so ∠BOC = 60 and ∠BOA = 30. By inscribed angles, angle BDE is half this, or 15 degrees. Now examine 4ABO. ∠ABO is right since AB is a tangent, and ∠BOA = 30, so ∠BAO = 60. Therefore, ∠BED = 30 by inscribed angles, and the answer is 180 − 30 − 15 = 135 degrees. This problem was proposed by Ray Li. The solution was provided by professordad.

January 2012

OMO Solutions 2012

Page 5

14. Al told Bob that he was thinking of 2011 distinct positive integers. He also told Bob the sum of those integers. From this information, Bob was able to determine all 2011 integers. How many possible sums could Al have told Bob? Solution. The answer is 2 . Let s = 1 + 2 + · · · + 2010 + 2011. If the sum S told is larger than s + 1, then the integers could be either 1, 2, . . . , 2009, 2010, 2011 + S − s, or 1, 2, . . . , 2009, 2011, 2010 + S − s. Clearly the sum is at least s, so the only possibilities are s and s + 1, and the answer is 2. This problem was proposed by Ray Li. The solution was provided by mavropnevma. 15. Five bricklayers working together finish a job in 3 hours. Working alone, each bricklayer takes at most 36 hours to finish the job. What is the smallest number of minutes it could take the fastest bricklayer to complete the job alone? Solution. The answer is 270 . Let the time of the fastest bricklayer be t. To minimize t, let the other 4 workers take 36 hours each. Now let the amount of work be 1 (whatever unit). By the D = RT formula, we have 1 1 36

whence

1 t

+

1 9

= 13 , and t =

9 2

+

1 36

+

1 36

+

1 36

+

1 t

= 3,

hours or 270 minutes.

This problem was proposed by Ray Li. The solution was provided by professordad. 16. Let A1 B1 C1 D1 A2 B2 C2 D2 be a unit cube, with A1 B1 C1 D1 and A2 B2 C2 D2 opposite square faces, and let M be the center of face A2 B2 C2 D2 . Rectangular pyramid M A1 B1 C√ 1 D1 is cut out of the cube. If the surface area of the remaining solid can be expressed in the form a + b, where a and b are positive integers and b is not divisible by the square of any prime, find a + b. Solution. The answer is 10 . The solid’s surface area is 5 unit squares (5 square units), p √ and 4 isosceles triangles. The base √ of each 2 + (1)2 = triangle is just 1, and the height is (1/2) 5/2, so the area of each triangle is 5/4, and √ √ 4 triangles, for an area of the triangles is 5. The total area is 5 + 5, so a + b = 10. This problem was proposed by Alex Zhu. 17. Each pair of vertices of a regular 10-sided polygon is connected by a line segment. How many unordered pairs of distinct parallel line segments can be chosen from these segments? Solution. The answer is 80 . There are two possibilities: either the diagonals face a side (i.e. are parallel to some side), or the diagonals face a vertex. For each case, there are 5 possible directions (1 for each pair of vertices and sides). In the first case, there are 5 diagonals for each direction, giving 52 = 10 pairs for each direction.  In the second case there are 4 diagonals for each direction, giving 42 = 6 pairs for each direction. This gives 5 × 10 + 5 × 6 = 80 total pairs. This problem was proposed by Ray Li. 18. The sum of the squares of three positive numbers is 160. One of the numbers is equal to the sum of the other two. The difference between the smaller two numbers is 4. What is the positive difference between the cubes of the smaller two numbers? Clarifications: • The problem should ask for the positive difference. Solution. The answer is 320 .

January 2012

OMO Solutions 2012

Page 6

Let the largest of the three be a. We have a2 + b2 + c2 = 160 a=b+c b−c=4 Plugging in a = b+c into the first equation gives 2b2 +2bc+2c2 = 160, so b2 +bc+c2 = 80. Multiplying this by b − c = 4 gives b3 − c3 = 320. This problem was proposed by Ray Li. The solution was provided by professordad. 19. There are 20 geese numbered 1 through 20 standing in a line. The even numbered geese are standing at the front in the order 2, 4, . . . , 20, where 2 is at the front of the line. Then the odd numbered geese are standing behind them in the order, 1, 3, 5, . . . , 19, where 19 is at the end of the line. The geese want to rearrange themselves in order, so that they are ordered 1, 2, . . . , 20 (1 is at the front), and they do this by successively swapping two adjacent geese. What is the minimum number of swaps required to achieve this formation? Solution. The answer is 55 . We can successively swap 1, 3, 5, . . . , 19 into their proper positions. This takes 10 swaps for 1, then 9 swaps for 3, and so on, giving 10 + 9 + 8 + · · · + 1 = 55 total swaps. To see that 55 is the minimum, notice that initially the number of pairs of geese (a, b) such that a < b but geese a is after geese b is 55, (one can use a similar counting argument to above) and the number of there bad pairs decreases by at most 1 with each swap. Because when the geese are ordered, there are 0 such bad pairs, we need at least 55 swaps, so the answer is 55. Note: In general, for any permutation π of a sequence of integers, the number of pairs (a, b) such that a < b and a comes after b is known as the number of inversions of the permutation. This problem was proposed by Ray Li. 20. Let ABC be a right triangle with a right angle at C. Two lines, one parallel to AC and the other parallel to BC, intersect on the hypotenuse AB. The lines cut the triangle into two triangles and a rectangle. The two triangles have areas 512 and 32. What is the area of the rectangle? Solution. The answer is 256 . Let the rectangle be P QRC, where P is on AC, Q is on AB, and R is on BC. Let AP = a, P Q = b, QR = c, and BR = d. From similar triangles, we have ad = bc. Also, cd = 64, and ab = 1024 from the given information. Multiplying these gives abcd = 1024 · 64. Since ad = bc, ad = bc = 32 · 8 = 256. This problem was proposed by Ray Li. The solution was provided by professordad. 21. If

2012

20112011

= xx

for some positive integer x, how many positive integer factors does x have? Solution. The answer is 2012 . Notice that x = 20112011 . Because 2011 is prime, x has 2012 positive integer factors. This problem was proposed by Alex Zhu. 22. Find the largest prime number p such that when 2012! is written in base p, it has at least p trailing zeroes. Solution. The answer is 43 . The number of trailing zeros when 2012! is written in base p is given by b

2012 2012 c + b 2 c + · · · > p. p p

January 2012

OMO Solutions 2012

Page 7

Thus, we have 2012 2012 2012 2012 2012 = + 2 + ··· > b c + b 2 c + · · · > p, p−1 p p p p whence p(p − 1) < 2012. It follows that because p is a prime p ≤ 43. It is easy to check that p = 43 satisfies the originally inequality, so 43 is the answer. This problem was proposed by Alex Zhu. 23. Let ABC be an equilateral triangle with side length 1. This triangle is rotated by some angle about its center to form triangle DEF. The intersection of ABC and DEF is an equilateral hexagon with an area that is 45 the area of ABC. The side length of this hexagon can be expressed in the form m n where m and n are relatively prime positive integers. What is m + n? Solution. The answer is 7 . Let O be the center of the two triangles. Let the hexagon be P QRST U with P, Q on side AB. Notice that O is equidistant from every side of the hexagon, so the areas of triangles OP Q, OQR, ORS, . . . 2 of the area of ABC. Let s be the length of are all equal. In particular, they are all equal to 16 · 45 = 15 side P Q, and let h be the height of ABC. Because the height of OP Q is h3 , we have s · h3 [OP Q] 2 = = [ABC] 1·h 15 so it follows that s =

2 5

and the answer is 2 + 5 = 7.

Note: Here [XY Z] denotes the area of triangle XY Z. This problem was proposed by Ray Li. 24. Find the number of ordered pairs of positive integers (a, b) with a + b prime, 1 ≤ a, b ≤ 100, and is an integer.

ab+1 a+b

Solution. The answer is 51 . ab+a+b+1 = (a+1)(b+1) must be an integer, whence a + b|a + 1 or a + b|b + 1, so Notice ab+1 a+b + 1 = a+b a+b a = 1 or b = 1. It follows that we need a + 1 or b + 1 to be a prime. Since there are 26 primes less than or equal to 101, (the maximum possible value of a + 1) we obtain 26 × 2 = 52 pairs (a, b), but we overcount the a = b = 1 case, so the answer is 51 .

This problem was proposed by Alex Zhu. 25. Let a, b, c be the roots of the cubic x3 + 3x2 + 5x + 7. Given that P is a cubic polynomial such that P (a) = b + c, P (b) = c + a, P (c) = a + b, and P (a + b + c) = −16, find P (0). Solution. The answer is 11 . Notice that a + b + c = −3 by Vieta’s. Let Q(x) be a polynomial such that Q(x) = P (x) + x + 3. Notice that Q(x) has a, b, c as roots by the first three conditions, so Q(x) = c(x3 + 3x2 + 5x + 7) for some constant c. By the last condition, we find c(−27 + 27 − 15 + 7) = −16, so c = 2, and Q(x) = 2x3 + 6x2 + 10x + 14. Now we have 14 = Q(0) = P (0) + 0 + 3, so P (0) = 11. This problem was proposed by Alex Zhu. 26. Xavier takes a permutation of the numbers 1 through 2011 at random, where each permutation has an equal probability of being selected. He then cuts the permutation into increasing contiguous subsequences, such that each subsequence is as long as possible. Compute the expected number of such subsequences. Clarifications: • An increasing contiguous subsequence is an increasing subsequence all of whose terms are adjacent in the original sequence. For example, 1,3,4,5,2 has two maximal increasing contiguous subsequences: (1,3,4,5) and (2).

January 2012

OMO Solutions 2012

Page 8

Solution. The answer is 1006 . When every permutation with n subsequences is written backwards, the number of subsequences in the new permutation is 2012 − n. Thus, every pair averages to our answer, 1006. This problem was proposed by Alex Zhu. The solution was provided by Draco. 27. Let a and b be real numbers that satisfy a4 + a2 b2 + b4 = 900, a2 + ab + b2 = 45. Find the value of 2ab. Solution. The answer is 25 . Dividing the two equations, we obtain a2 − ab + b2 = 20. Subtracting this from a2 + ab + b2 = 45, we obtain 2ab = 25 as desired. This problem was proposed by Ray Li. 28. A fly is being chased by three spiders on the edges of a regular octahedron. The fly has a speed of 50 meters per second, while each of the spiders has a speed of r meters per second. The spiders choose the (distinct) starting positions of all the bugs, with the requirement that the fly must begin at a vertex. Each bug knows the position of each other bug at all times, and the goal of the spiders is for at least one of them to catch the fly. What is the maximum c so that for any r < c, the fly can always avoid being caught? Solution. The answer is 25 . Suppose that r < 50 2 = 25. If the fly is on a vertex of the octahedron, then in the time it would take for the fly to crawl directly to one of the four adjacent vertices, each spider could possibly reach at most one vertex, thus stopping the fly from getting there. A spider can also block the fly by being on an edge adjacent to the fly’s vertex, but again the spider blocks only one edge. (The circles in the picture represent the range of motion of the spiders... kind of.) Because there are only three spiders, the fly can always run to another vertex. This situation repeats indefinitely, so the fly is never caught. If r > 25, then two spiders at the midpoints of opposite outer edges can contain the fly, each blocking two vertices. The third spider can pick of the fly at his leisure by making its way to the central vertex, cornering the fly on one of the four central edges. If r = 25, then the fly cannot definitely escape, though I’m not sure it’s guaranteed it gets caught, either. Regardless, our answer is c = 25. This problem was proposed by Anderson Wang. The solution was provided by ziv. 29. How many positive integers a with a ≤ 154 are there such that the coefficient of xa in the expansion of (1 + x7 + x14 + · · · + x77 )(1 + x11 + x22 + · · · + x77 ) is zero? Solution. The answer is 60 . This is the same as finding the number of nonegative integers a since the coefficient of x0 is nonzero. We claim that all the nonzero coefficients are 1, except for the coefficient of 77, which is 2. Notice that this is equivalent to finding the number of positive integers a that are not expressible in the form 7a + 11b with a ≤ 11, b ≤ 7. If 7a + 11b = 7c + 11d, constrained to 0 ≤ a, c ≤ 11 and 0 ≤ b, d ≤ 7, then either 7a + 11b = 77 or (a, b) = (c, d) showing that 77 is the only coefficient that appears more than once. Now, because the sum of the coefficients is 8 · 12 = 96 (plug in x = 1,) we have 96 − 1 distinct nonzero coefficients. This gives us 155 − 95 = 60 values of a with [xa ] = 0. This problem was proposed by Ray Li.

January 2012

OMO Solutions 2012

Page 9

30. The Lattice Point Jumping Frog jumps between lattice points in a coordinate plane that are exactly 1 unit apart. The Lattice Point Jumping Frog starts at the origin and makes 8 jumps, ending at the origin. Additionally, it never lands on a point other than the origin more than once. How many possible paths could the frog have taken? Clarifications: • The Lattice Jumping Frog is allowed to visit the origin more than twice. • The path of the Lattice Jumping Frog is an ordered path, that is, the order in which the Lattice Jumping Frog performs its jumps matters. Solution. The answer is 280 . Call a k-string a string of moves that start and end with the origin, that don’t go through the origin other than at its endpoints. If the path is an 8-string, then you trace out a polyomino. There are 3 polynominoes in this case: A 2 × 2, square, a straight segment with 3 unit squares, and an L shape. The square can be rotated in 1 way, the straight segment in 2 ways, and the L in 4 ways. For each polyomino and orientation, the origin of the coordinate system can be placed at 8 positions on the boundary, and given the polyomino, orientation, and origin location, there are 2 ways to traverse the path. This gives 2×8×(1+2+4) = 112 paths in this case. If the path has a 6-string, then the path is a dangling line segment attached to a polyomino. This case must be a domino with a dangling segment. The domino has 2 possible orientations. For each orientation there are 6 places to put the origin. If the origin is at a vertex, there are 4 places it could go, and the dangling segment has 2 possible directions. There are 2 ways to choose the traversal order (segment first or domino first), and there are 2 ways to traverse the domino. Thus there are 4 × 2 × 2 × 2 = 32 paths in this case. If the origin is not at a vertex, there are 2 places it could go, and the dangling segment has 1 possible direction. Once again there are 2 ways to choose traversal order and 2 ways to traverse the domino, giving 2 × 2 × 2 = 8 paths in this case. Because there are 2 orientations of the domino, we have 2 × (32 + 8) = 80 paths in this case. If the path only has 4-strings and 2-strings, there are three cases: (1) Two 4-strings. This is simply two unit squares attached to each other at a corner. There are two ways to choose the orientation of the squares, and 8 ways to traverse each orientation, for 16; (2) One 4-string and two 2-strings. This is just two dangling line segments attached to one corner of a unit square. There are 4 orientations, 2 ways to traverse the square, 3! = 6 ways to choose the order of the square and segments. This gives 4 · 2 · 6 = 48; (3) Four 2-strings. This is just a star. There are 4! = 24 ways to choose the order of the stars. This gives a total of 112 + 80 + 16 + 48 + 24 = 280 paths. Author’s comment: I never really intended for this problem to be this ugly. As it was in the test, the problem statement clearly implied that the frog could visit the origin more than twice, but I only intended the problem to be as hard as the first case. This problem was proposed by Ray Li. 31. Let ABC be a triangle inscribed in circle Γ, centered at O with radius 333. Let M be the midpoint of AB, N be the midpoint of AC, and D be the point where line AO intersects BC. Given that lines M N and BO concur on Γ and that BC = 665, find the length of segment AD. Solution. The answer is 444 . Let AD intersect M N at Q, and let M N intersect BO at P . Since BO = OP and M N k BC, QO = OD. We also have AQ = QD, so AD = 34 AO = 444. The length of BC isn’t needed! This problem was proposed by Alex Zhu. The solution was provided by ftong. 32. The sequence {an } satisfies a0 = 201, a1 = 2011, and an = 2an−1 + an−2 for all n ≥ 2. Let S=

∞ X i=1

ai−1 . a2i − a2i−1

January 2012

What is

OMO Solutions 2012

Page 10

1 S?

Solution. The answer is 3620 . Using partial fractions, 1 ai−1 = a2i − a2i−1 2



1 1 − ai − ai−1 ai + ai−1

 .

By the recurrence relation, ai + ai−1 = ai+1 − ai . So we get S=

 ∞ X 1 i=1

2

1 1 − ai − ai−1 ai+1 − ai

 =

1 1 = . 2(a1 − a0 ) 3620

So the answer is 3620. This problem was proposed by Ray Li. The solution was provided by ftong. 33. You are playing a game in which you have 3 envelopes, each containing a uniformly random amount of money between 0 and 1000 dollars. (That is, for any real 0 ≤ a < b ≤ 1000, the probability that the b−a .) At any step, you take an envelope and amount of money in a given envelope is between a and b is 1000 look at its contents. You may choose either to keep the envelope, at which point you finish, or discard it and repeat the process with one less envelope. If you play to optimize your expected winnings, your expected winnings will be E. What is bEc, the greatest integer less than or equal to E? Solution. The answer is 695 . For one envelope, clearly your expected winnings is 500. For two envelopes, open it. If it has over 500 you should keep it, otherwise throw it out. Hence your expected winning should be 21 ·750+ 12 ·500 = 625 Let’s say you have three envelopes. If the first envelope has over 625 you should keep it, otherwise 5 throw it out. Thus the expected winning is 38 · (625 + 1000)/2 + 58 · 625 = 11125 = 695 + 16 , hence 16 bEc = 695. This problem was proposed by Alex Zhu. The solution was provided by dinoboy. 34. Let p, q, r be real numbers satisfying (p + q)(q + r)(r + p) = 24 pqr (p − 2q)(q − 2r)(r − 2p) = 10. pqr Given that pq + rq + pr can be expressed in the form compute m + n.

m n,

where m, n are relatively prime positive integers,

Solution. The answer is 67 . Let u = pq , v = rq , and w = pr . Clearly, uvw = 1. We seek u + v + w. Note that the two equations can be rewritten as     (p + q)(q + r)(r + p) p+q q+r r+p = = (u + 1)(v + 1)(w + 1) = 24, pqr q r p and (p − 2q)(q − 2r)(r − 2p) = pqr



p − 2q q



q − 2r r



r − 2p p

 = (u − 2)(v − 2)(w − 2) = 10.

Expanding, we get uvw+uv+vw+wu+u+v+w+1 = 24 and uvw−2(uv+vw+wu)+4(u+v+w)−8 = 10. Adding twice the first equation to the second, we get 3uvw + 6(u + v + w) − 6 = 58, so u + v + w = 58+6−3 = 61 6 6 , giving an answer of 61 + 6 = 67. This problem was proposed by Alex Zhu.

January 2012

OMO Solutions 2012

Page 11

35. Let s(n) be the number of 1’s in the binary representation of n. Find the number of ordered pairs of integers (a, b) with 0 ≤ a < 64, 0 ≤ b < 64 and s(a + b) = s(a) + s(b) − 1. Solution. The answer is 648 . The condition means there is exactly 1 place where a and b both have a 1 in the same place value spot, but both have 0’s in the next (left) bit. a and b must both have 6 bits (leading 0’s allowed). Thus the number of ways to do this is 35 (if the 1’s are both in the 6th bit) + 5 · 34 (the 1 pair are in the other bits), so 648 total. This problem was proposed by Anderson Wang. The solution was provided by ksun48. 36. Let sn be the number of ordered solutions to a1 + a2 + a3 + a4 + b1 + b2 = n, where a1 , a2 , a3 and a4 are elements of the set {2, 3, 5, 7} and b1 and b2 are elements of the set {1, 2, 3, 4}. Find the number of n for which sn is odd. Clarifications: • sn is the number of ordered solutions (a1 , a2 , a3 , a4 , b1 , b2 ) to the equation, where each ai lies in {2, 3, 5, 7} and each bi lies in {1, 2, 3, 4}. Solution. The answer is 12 . We just want the number of odd coefficients in the generating function (x2 +x3 +x5 +x7 )4 (x1 +x2 +x3 + k k x4 )2 . But it is well-known that f (x)2 − f (x2 ) has all even coefficients for any f ∈ Z[x] and positive integer k (prove it!), so this is also the number of odd coefficients in (x8 +x12 +x20 +x28 )(x2 +x4 +x6 +x8 ). (Why?) The rest is straightforward computation: (x8 +x12 +x20 +x28 )(x2 +x4 +x6 +x8 ) = x10 +x12 +2x14 +2x16 +x20 +x22 +x24 +x26 +x28 +x30 +x32 +x34 +x36 , which has 12 odd coefficients. This problem was proposed by Alex Zhu. 37. In triangle ABC, AB = 1 and AC = 2. Suppose there exists a point P in the interior of triangle ABC such that ∠P BC = 70◦ , and that there are points E and D on segments AB and AC, such that ∠BP E = ∠EP A = 75◦ and ∠AP D = ∠DP C = 60◦ . Let BD meet CE at Q, and let AQ meet BC at F . If M is the midpoint of BC, compute the degree measure of ∠M P F . Solution. The answer is 25 . By Ceva’s, BE AD CF · · = 1. EA DC F B By angle bisector theorem, BE AD BP · = , EA DC PC so ∠F P C = ∠BP C/2 = 45◦ . Since 4BP C is right, ∠M P C = ∠M CP = 90◦ − ∠P BF = 20◦ . Therefore, ∠M P F = ∠F P C − ∠M P C = 25◦ . This problem was proposed by Alex Zhu and Ray Li. The solution was provided by ftong. 38. Let S denote the sum of the 2011th powers of the roots of the polynomial (x − 20 )(x − 21 ) · · · (x − 22010 ) − 1. How many 1’s are in the binary expansion of S? Solution. The answer is 2018 . Let P (x) = an xn + an−1 xn−1 + · · · + a0 . Newton’s sums tell us an S1 + an−1 = 0 an S2 + an−1 S1 + 2an−2 = 0 .. . an Sn + · · · + a1 S1 + na0 = 0,

January 2012

OMO Solutions 2012

Page 12

where Sk is the sum of the kth power of the roots. Now, suppose we subtract 1 from a0 . The first (n − 1) sums do not change, as they are not dependent on a0 . The last Sn must increase by n/an . Application to this problem: The sum of the 2011th roots is now 1+22011 +24022 +· · ·+22010·2011 +2011. Now, 2012 in binary is 4 + 8 + 16 + 64 + 128 + 256 + 512 + 1024 = 111110111002 , and the sum of the remaining terms is 1000000 · · · 10000000 · · · (where there are 2010 ones) in binary. So the digit sum is 2010 + 8 = 2018. This problem was proposed by Alex Zhu. The solution was provided by ftong. 39. For positive integers n, let ν3 (n) denote the largest integer k such that 3k divides n. Find the number of subsets S (possibly containing 0 or 1 elements) of {1, 2, . . . , 81} such that for any distinct a, b ∈ S with a > b, ν3 (a − b) is even. Clarifications: • We only need ν3 (a − b) to be even for a > b. Solution. The answer is 6859000 . In general, for n ≥ 0, we let sn denote the number of subsets of {1, 2, . . . , 3n } such that 2 | ν3 (a − b) for any distinct a, b ∈ S and tn the number of subsets with 2 - ν3 (a − b) for any distinct a, b ∈ S. Clearly s0 = t0 = 2, and for n ≥ 2, sn = t3n−1 while tn = 3sn−1 − 2. (Why?) Thus s4 = t33 = (3s2 − 2)3 = (3(3s0 − 2)3 − 2)3 = 1903 = 6859000 is the desired answer. This problem was proposed by Alex Zhu. 40. Suppose x, y, z, and w are positive reals such that x2 + y 2 −

xy wz = w2 + z 2 + = 36 2 2

and xz + yw = 30. Find the largest possible value of (xy + wz)2 . Solution. The answer is 960 . Consider a quadrilateral ABCD, with AB = w, BC = x, CD = y, DA = z, and AC = 6. By the law of cosines, the first two equations imply that cos B = 41 and cos D = − 41 , so ABCD must be cyclic. By Ptolemy’s theorem, BD · AC = wy + xz = 30, so BD = 5. √ √ Note that sin B = sin D = 1 − cos2 B = 415 , so wx sin B yz sin D [ABCD] = [ABC] + [CDA] = + = 2 2



15 (wx + yz), 8

Let θ be the angle formed by diagonals BD and AC. It is well-known that [ABCD] = BD·AC = 15, with equality holding exactly when θ = 90◦ . It follows that 2 (wx + yz)2 ≤

BD·AC 2

sin θ ≤

64 · 152 = 960. 15

Equality holds when BD ⊥ AC; we can ensure that such a configuration exists by holding AC fixed in the circumcircle of ABCD, and varying chord BD of length 5 until it is perpendicular to chord AC.

January 2012

OMO Solutions 2012

Page 13

Proof of said well-known fact: Let BD and AC meet at P . Then [ABCD] = [P AB] + [P BC] + [P CD] + [P DA] P A · P B · sin θ P B · P C · sin θ P C · P D · sin θ P D · P A · sin θ = + + + 2 2 2 2 (P A + P C)(P B + P D) BD · AC = sin θ = sin θ. 2 2 This problem was proposed by Alex Zhu. 41. Find the remainder when

63 2011 X i −i i=2

i2 − 1

.

is divided by 2016. Solution. The answer is 1011 . Solution 1: It is known for odd n and odd k that 1 + 2 + · · · + n|1k + 2k + · · · + nk . To see this, note that 1k + 2k + · · · + nk = (1k + (n − 1)k ) + (2k + (n − 2)k ) + · · · + ((

n−1 k n+1 k ) +( ) + nk , 2 2

and that each summand is a multiple of n, and that 1k + 2k + · · · + nk = (1k + nk ) + (2k + (n − 1)k ) + · · · + (( and that each summand is a multiple of

n+1 2 ,

n−1 k n+3 k n+1 k ) +( ) )+( ) , 2 2 2

so 1k + 2k + · · · + nk must be a multiple of

n(n+1) . 2

Consequently, 1k + 2k + · · · + 63k ≡ 0 (mod 2016) for all odd k. Solution 2: Let P (i) = easy).

i2011 −i i2 −1

after dividing out. Note that P (1) = 1005 (l’Hopital’s rule makes this

Let S be the sum we want. Note that P (i) is an odd function, so P (i) + P (63 − i) ≡ 0 (mod 63) and we easily get P (1) + S ≡ P (63) ≡ 0 (mod 63). Similarly, P (1) + S ≡ 0 (mod 64). So S ≡ −1005 (mod 2016) and the answer is 1011. This problem was proposed by Alex Zhu. 42. In triangle ABC, sin ∠A = 45 and ∠A < 90◦ Let D be a point outside triangle ABC such that 3 ∠BAD = ∠DAC and ∠BDC = 90◦ . Suppose that AD = 1 and that BD CD = 2 . If AB + AC can be expressed in the form

√ a b c

where a, b, c are pairwise relatively prime integers, find a + b + c?

Solution. The answer is 34 . Let A = (0, 0), D = (1, 0). Then let vectors DB and DC be [−3a, 3b] and [−2b, −2a]. Already, we have eliminated three of the conditions. Now we have B = (1 − 3a, 3b), C = (1 − 2b, −2a). We know 3b −2a tan A2 = 12 by half angle formula, so 1−3a = 21 , 1−2b = −1 we have a linear system of equations 2 . Now   2 1 1 1 which we solve to get a = 9 , b = 18 , so B = 3 , 6 , C = 89 , −4 . We can finish using distance formula 9 √ √ √ 5 4 5 11 5 to get AB + AC = 6 + 9 = 18 giving an answer of 11 + 5 + 18 = 34. Authors Comment: This problem was actually ”intended” to be a bash problem. By that, I mean that the more clever your bash, the easier the solution. This problem was proposed by Ray Li. 43. An integer x is selected at random between 1 and 2011! inclusive. The probability that xx − 1 is divisible by 2011 can be expressed in the form m n , where m and n are relatively prime positive integers. Find m.

January 2012

OMO Solutions 2012

Page 14

Solution. The answer is 1197 . Let p = 2011 (which is prime), and for k = 1, 2, . . . , p, let Sk = {x ∈ [1, 2011!] | x ≡ k (mod p)} and Pp |Tk | Tk = {x ∈ Sk : p | xx − 1}. As |S1 | = · · · = |Sp | = p1 p!, the desired probability is p1 k=1 |S . k| Now we observe that for x ∈ Sk , p | xx − 1 iff k 6= 0 and ordp (k) | x. But ordp (k) | p − 1 by Fermats little theorem and gcd(p, p − 1) = 1, so in view of the Chinese remainder theorem and the fact that |Tk | = ord1p (k) , whence Sk = k + p{0, 1, . . . , (p − 1)! − 1} (note that ordp (k) | (p − 1)!), we simply have |S k| p

p−1

p−1

k=1

k=1

k=1

1 X |Tk | 1 X |Tk | 1X 1 = = . p |Sk | p |Sk | p ordp (k) Since for every positive divisor d of p−1, there are exactly φ(d) (here φ denotes Eulers totient function) residues k with ordp (k) = d (why?), our answer is             1 X φ(d) 1 X φ(d) 1 1 1 1 1 = = 1+ 1− 1+ 1− 1+ 1− 1+ 1− , p d 2011 d 2011 2 3 5 67 d|p−1

which evaluates to

d|2010

1197 269474 .

(See if you can full justify the last sum on your own.)

This problem was proposed by Alex Zhu. 44. Given a set of points in space, a jump consists of taking two points in the set, P and Q, removing P from the set, and replacing it with the reflection of P over Q. Find the smallest number n such that for any set of n lattice points in 10-dimensional-space, it is possible to perform a finite number of jumps so that some two points coincide. Solution. The answer is 1025 . Notice that the parity of a point’s coordinates does not change when it undergoes a jump, so if we take the unit 10 dimensional cube (all coordinates at 0 or 1), we have 210 points, and no two will ever coincide because that would imply their parities are the same. Thus the answer is at least 1025. To show that 1025 works, we use induction on the number of dimensions. Base Case: Any 3 points in 1-dimensional space can be moved so that some two coincide. Proof: Jump an outer point over the middle point, maximum distance decreases. Inductive step: Consider any 2n+1 + 1 points in (n + 1)-dimensional space. We’re going to show that we can make some 2n + 1 of them lie in an n-dimensional “plane,” so that we can apply the inductive step. Let’s project the points down onto 1-dimensional space; say, by looking only at the first coordinate. Then any jump in (n+1)-space corresponds directly to a jump of the projected points (feet) in 1-space. Now divide up the points into two sets A and B based on the parity of the first coordinate. We can assume WLOG that both A and B are non-empty, else we can either divide by 2, or shift over and divide by 2, and the sequence of moves remains the same. By pigeonhole, we know that one of the sets has at least 2n + 1 elements, let that be A. Now, choose any element P of B. By manipulating the feet of any two elements a1 , a2 ∈ A and P , we can get the feet of a1 and a2 to coincide (by the base case, and parity) and thus a1 and a2 lie in the same n-dimensional plane. Now we repeat this algorithm, subsequently always treating a1 and a2 as a unit (so that they remain in the same plane whenever they jump over another point). Thus, by repeatedly manipulating the feet of P and two elements from A, we can accumulate all the points in A into n-space, and we are done. Thus, the answer is 1025. This problem was proposed by Anderson Wang. The solution was provided by ftong. 45. Let K1 , K2 , K3 , K4 , K5 be 5 distinguishable keys, and let D1 , D2 , D3 , D4 , D5 be 5 distinguishable doors. For 1 ≤ i ≤ 5, key Ki opens doors Di and Di+1 (where D6 = D1 ) and can only be used once. The keys and doors are placed in some order along a hallway. Key$ha walks into the hallway, picks a key and

January 2012

OMO Solutions 2012

Page 15

opens a door with it, such that she never obtains a key before all the doors in front of it are unlocked. In how many such ways can the keys and doors be ordered if Key$ha can open all the doors? Clarifications: • The doors and keys are in series. In other words, the doors aren’t lined up along the side of the hallway. They are blocking Key$has path to the end, and the only way she can get past them is by getting the appropriate keys along the hallway. • The doors and keys appear consecutively along the hallway. For example, she might find K1 D1 K2 D2 K3 D3 K4 D4 K5 D5 down the hallway in that order. Also, by “she never obtains a key before all the doors in front of it are unlocked, we mean that she cannot obtain a key before all the doors appearing before the key are unlocked. In essence, it merely states that locked doors cannot be passed. • The doors and keys do not need to alternate down the hallway. Solution. The answer is 187120 . If K1 is used to unlock D1 , then Di must be unlocked by Ki for all i; otherwise, if K1 is used to unlock D2 , then Di+1 must be unlocked by Ki for all i. Let A denote the set of proper configurations of the first kind (i.e. in which Di always appears after Ki ), and B of the second (i.e. in which Di+1 always appears after Ki ); then our answer is |A ∪ B| = |A| + |B| − |A ∩ B|.  8 6 4 2 First, it’s clear that |A| = |B| = 10 2 2 2 2 2 = 5!(2 · 5 − 1)!! = 113400, since proper configurations in A (and B) simply correspond to pairings (Ki , Di ) (resp. (Ki , Di+1 )) of {1, 2, . . . , 10}. It remains to compute |A ∩ B|, the number of proper configurations in which Di , Di+1 appear after Ki for all i. It suffices to count the number X of such configurations with D1 as the first door and D2 or D3 as the second, since 5 · 2 · X = |A ∩ B| by symmetry. Indeed, we can first cyclically shift the indices so that D1 is the first door, and then observe that the properness-preserving involution taking Ki → K6−i and Di → D7−i (all indices modulo 5) exchanges the second door between the sets {D2 , D3 } and {D4 , D5 }. We now do casework based on the 5-tuple (i1 , . . . , i5 ) such that Di1 , . . . , Di5 are in order from left to right. For (1, 2, 3, 4, 5) and (1, 2, 3, 5, 4), we choose (the positions of) K1 , K5 , K2 , K3 , K4 (in that order) for a total of 1 · 2 · 4 · 6 · 8 = 384 configurations; for (1, 2, 4, 5, 3) and (1, 2, 4, 3, 5), we choose K1 , K5 , K2 , K3 , K4 for 1·2·4·6·7 = 336; for (1, 2, 5, 3, 4) and (1, 2, 5, 4, 3), we choose K1 , K5 , K2 , K4 , K3 for 1·2·4·6·8 = 384; for (1, 3, 2, 4, 5) and (1, 3, 2, 5, 4), we choose K1 , K5 , K2 , K3 , K4 for 1·2·4·5·8 = 320; for the remaining four cases (with i1 = 1, i2 = 3, and i3 ∈ {4, 5}), we choose K1 , K5 , K2 , K3 , K4 for 1 · 2 · 4 · 5 · 7 = 280. Thus X = 384 · 2 + 336 · 2 + 384 · 2 + 320 · 2 + 280 · 4 = 3968 ways to do this, so |A ∩ B| = 10X = 39680 and |A ∪ B| = 2 · 113400 − 39680 = 187120. Comment: When we replace 5 by n in general, the number |A ∩ B| (39680 for n = 5) is simply 12 (2n)E2n−1 , where the Euler number En denotes the number of alternating permutations of {1, 2, . . . , n}. There is a simple way to recursively compute these numbers. (Try it!) This problem was proposed by Mitchell Lee. The solution was provided by antimonyarsenide. 46. f is a function from the set of positive integers to itself such that f (x) ≤ x2 for all natural numbers x, and f (f (f (x))f (f (y))) = xy for all natural numbers x and y. Find the number of possible values of f (30). Solution. The answer is 24 . Function f : Z+ → Z+ has the following properties for all x, y: • f (x) ≤ x2 • f (f 2 (x)f 2 (y)) = xy n fs

z }| { where f (x) = f (f (· · · f (x) · · · )). (1) means that f (1) = 1. Plugging y = 1 into (2) gives us x = f (f 2 (x)f 2 (1)) = f 3 (x) for all x. n

January 2012

OMO Solutions 2012

Page 16

Lemma 1. f is a bijection. Proof. If x 6= y and f (ax) = f (y), then x = f 3 (x) = f 3 (y) = y, a contradiction, so f is injective. Because f 3 (x) = x for all x, then for every x there exists y = f 2 (x) such that f (y) = x, so f is surjective. This means we can talk about the inverse function, f −1 . Note that f −1 = f 2 . Lemma 2. f (x)f (y) = f (xy) and f −1 (x)f −1 (y) = f −1 (xy) for all x, y. Proof. By (2), f (f −1 (x)f −1 (y)) = f (f 2 (x)f 2 (y)) = xy. Apply f −1 to both sides to get f −1 (x)f −1 (y) = f −1 (xy). This also holds true for f itself: f (x)f (y) = f (f −1 (f (x)f (y))) = f (f −1 (f (x))f −1 (f (y))) = f (xy). In particular, if we know f (p) for all primes p then we know f (x) for all x. Lemma 3. If p is prime, then f (p) is prime. Proof. Suppose that f (p) = qr for some prime p and some product qr with q, r ≥ 2. p = f −1 (qr) = f −1 (q)f −1 (r), so p is the product of two numbers greater than 1 (because f (1) = 1), a contradiction. We can describe all possible f as a set of ordered triples of primes (p, q, r), defining f (p) = q, f (q) = r and f (r) = p (and saying WLOG p < q, r) such that every prime appears in at most one triple and for all triples, p4 ≥ q 2 ≥ r. If a prime s appears in no triple, then f (s) = s. Lemma 4. All such sets of triples describe a valid f . Q Q Q Q Proof. Consider any xQ= pi where each pi is prime. f (x) = f Q ( pi ) = Q f (pi ) ≤ p2i = x2 , so f satisfies (1). Let y = qi where each qi is prime. f (x)f (y) = ( f (pi )) ( f (qi )) = f (xy) (because the pi and qi together are the prime factors of xy), so f satisfies (2). We can now consider f (30) = f (2)f (3)f (5). We know f (2) ∈ {2, 3}. If f (2) = 3, then f (3) ∈ {5, 7}. If f (3) = 5 then f (5) = 2 and f (30) = 30; if f (3) = 7 then f (5) ∈ {5, 11, 13, 17, 19, 23}, each of which gives a new value for f (30). That’s 7 values so far, all of them odd except for 30. If f (2) = 2, then f (3) ∈ {3, 5, 7}. Either way, f (5) ∈ {5, 7, 11, 13, 17, 19, 23}, except • f (5) 6= 5 if f (3) = 5. • f (5) 6= 7 if f (3) = 7. • If f (3) = 3 and f (5) = 5 then f (30) = 30, which we’ve already counted. • We count f (30) = 2 · 5 · 7 twice. That’s a total of 7 · 3 − 4 = 17 more values, all of them even and none of them 30. This makes 7 + 17 = 24 possible values. This problem was proposed by Alex Zhu. The solution was provided by ziv. √ 47. Let ABCD be an isosceles trapezoid with bases AB = 5 and CD = 7 and legs BC = AD = 2 10. A circle ω with center O passes through A, B, C, and D. Let M be the midpoint of segment CD, and ray AM meet ω again at E. Let N be the midpoint of BE and P be the intersection of BE with CD. Let Q be the intersection of ray ON with ray DC. There is a point R on the circumcircle of P N Q such that ∠P RC = 45◦ . The length of DR can be expressed in the form m n where m and n are relatively prime positive integers. What is m + n? Solution. The answer is 122 . Since 4BDC is oppositely oriented to 4ADC, we have that BE is a symmedian of 4BDC. Therefore, BDEC is a harmonic quadrilateral, and so the tangent at B and E to w, and ON meet at Q. This implies BE is the polar of Q with respect to w. Therefore, (DP CQ) is harmonic, and since CR is an angle bisector of ∠P RQ, we have ∠DRC = 90. This means that RP is an angle bisector of ∠DRC. 2

DP DB 2 We therefore have DR RC = P C = BC 2 (by Steiner’s Theorem). By Ptolemy’s, DB = (AB)(CD) + DR 15 2 2 2 (BC)(AD) = 75. Therefore, RC = 8 . Using this along with DR + RC = 21 (since ∠DRC = 90), we have DR = 105 17 , and the answer is 122.

January 2012

OMO Solutions 2012

Page 17

This problem was proposed by Ray Li. The solution was provided by Jinduckey. 48. Suppose that 982 X

7i

2

i=1

can be expressed in the form 983q + r, where q and r are integers and 0 ≤ r ≤ 492. Find r. Solution 1. The answer is 450 . We start off by brute forcing the facts that 7491 ≡ 1 (mod 983), 983 is prime, and 491 is prime. Now S=

982 X

2

7i = 2

i=1

491 X

2

7i = 2 1 + 2

i=1

245 X

! 7i

2

.

i=1

Consider the set S of all nonzero residues x such that there exists an integer a with x ≡ a2 (mod 491). We call S the set of quadratic residues. Let T =

245 X

2

7i =

i=1

X

7k .

k∈S

Now, a paper by Monico and Elia shows that any quadratic residue can be expressed as the sum of two other quadratic residues in exactly dp − 1 = 122 ways, and any nonzero x 6∈ S can be expressed as the sum of two other elements of S in exactly dp = 123 ways. (Try proving this yourself, without resorting to the paper: it’s not that difficult!) Since 491 ≡ 3 (mod 4), no two quadratic residues sum to zero. Therefore, when we square T , we get T2 =

X

7i+j = 122

i,j∈S

X

7k + 123

X

7k = 123

k6∈S

k∈S

490 X k=1

7k −

X

7k .

k∈S

Evaluating the geometric series on the right hand side, we get T 2 +T +123 ≡ 0 (mod 983). Multiplying √ by 4, we have 4T 2 + 4T + 492 ≡ (2T + 1)2 + 491 ≡ 0, so (2T + 1)2 ≡ 492 ≡ (S/2)2 . Then S ≡ 2. We find that S = 450 works (by raising 2 to the power of 246).   Solution 2. We have 983 = p = 2q + 1, where q = 491 ≡ 3 (mod 4) and p are prime; since p7 = 1, and p - 72 − 1 (yet p | 72q − 1), we have ordp (7) = q. Of course, it suffices to find f (7) (which is S/2 after some simple manipulation, where S is the desired sum), where f (x) =

q−1   X k k=1

q

xk .

Clearly f (1) = 0 (there are just as many quadratic residues as quadratic nonresidues) and f (7r ) =   r q q−1 ) (mod p), so q f (7) if q - r. Let g(x) = x − 1 ≡ (x − 1)(x − 7) · · · (x − 7 Y

(7k − 7j ) ≡ g 0 (7k ) = q7k(q−1) ≡ q7−k

(mod p).

j6=k

Then by Lagrange interpolation over the roots of g(x) (i.e. 70 , 71 , . . . , 7q−1 ), we have q−1 q−1   k Y x − 7j X Y x − 7j X k 7 f (7) Y k f (x) ≡p f (1) + f (7 ) ≡ (x − 7j ). p 1 − 7j 7k − 7j q q j6=0

k=1

j6=k

Comparing leading coefficients (i.e. [x490 ]), we find   q−1 f (7)2 −1 = ≡ q q

k=1

(mod p);

j6=k

January 2012

OMO Solutions 2012

Page 18

the rest is computation. Comment: This problem is simply a quadratic Gauss sum in disguise! This problem was proposed by Alex Zhu. The first solution was provided by ftong. The second solution was provided by math154. 49. Find the magnitude of the product of all complex numbers c such that the recurrence defined by x1 = 1, x2 = c2 − 4c + 7, and xn+1 = (c2 − 2c)2 xn xn−1 + 2xn − xn−1 also satisfies x1006 = 2011. Solution. The answer is 2010 . First we observe that for every n ≥ 1, there exists a monic polynomial Pn ∈ Z[x] such that xn = Pn (c) for all complex numbers c. By a simple induction, Pn (0) = 6n − 5 for n ≥ 1, so P1006 (0) = 6031. Similarly, we can show that (x − 2)2 | Pn (x) − 2n + 1 for n ≥ 1: just note that (x − 2)2 | Pn+1 (x) − 2Pn (x) + Pn−1 (x) by the recursion. Qm Write P1006 (x) − 2011 (which is monic with integer coefficients) in the form i=1 fi (x)ki for distinct nonconstant monic irreducible polynomials Q fi ∈ Z[x] and positive integers ki ; the desired product of m c such that P1006 (c) = 2011 is simply P = i=1 |fi (0)|, since no monic irreducible polynomial has a double root, and no two distinct monic irreducible polynomials with integer coefficients can share a root. (Prove this!) Note that for any i, fi (0)ki | P1006 (0) − 2011 = 4020 = 22 · 3 · 5 · 67. If ki > 1 for some i, then we must in fact have fi (0) | 2 (and if fi (0) = ±2, then we must also have ki = 2). Thus for every Q i, |fi (0)ki | = |fiQ (0)| unless fi (0) = ±2 and ki = 2 (in which case |fi (0)ki | = 2|fi (0)|), so m m 1 P = i=1 |fi (0)| = 2r i=1 |fi (x)ki | = 4020 2r , where r is the number of i such that fi (0) = ±2 and 2 2 ki = 2. Since (2 ) - 4020, we have r ≤ 1. But we know (x − 2)2 | P1006 (x) − 2011 from above, so r ≥ 1 =⇒ r = 1, and P = 2010. This problem was proposed by Alex Zhu. 50. In tetrahedron SABC, the circumcircles of faces SAB, SBC, and SCA each have radius 108. The inscribed sphere of SABC, centered at I, has radius 35. Additionally, SI = 125. Let R isp the largest possible value of the circumradius of face ABC. Give that R can be expressed in the form m n , where m and n are relatively prime positive integers, find m + n. Solution. The answer is 35928845209 . q The answer is 35925411600 3433609 . √ Let r = 35, s = 125, a = 108, v = s2 − r2 = 120, ω be the insphere of SABC, and u be the circumradius of SABC. Let O be the circumcenter of SABC, and let OA , OB , and OC be the circumcenters of faces SBC, SCA, and SAB, respectively. Since OOA is perpendicular to face SBC, 2 2 2 by the Pythagorean theorem OOA = u2 − a2 . Similarly, we must have OOB = OOC = u2 − a2 , so O is equidistant from the three faces of SABC. Thus, S, I, and O are collinear. If we let the tangency SI point of the insphere with SABC be IA , then 4SIA I ∼ 4SOA O, so us = SO = √u2r−a2 , whence u2 u2 −a2

=

s2 r2 .

Solving, we get u =

as v

=

225 2 .

Let h be the altitude from S to face ABC. We claim that the altitude of h is uniquely determined from the information given. To see this, we perform an inversion centered about S with radius 1. For any point or solid X in the original diagram, let X 0 denote its inverse under this inversion. Let Γ be the circumsphere of SA0 B 0 C 0 , and let K be its center and R0 be its circumradius. Γ is the image of plane ABC under the inversion. ω 0 is externally tangent to Γ at a point T , and tangent to faces SA0 B 0 ,SB 0 C 0 , and SC 0 B 0 . We first compute the radius of ω 0 and the distance SI 0 . Let line SI meet ω at A and B, with A closer to S than B. We have SA = s − r and SB = s + r. Thus, SA0 = 0

1 s−r 0

s from S to I is

and SB 0 = 1 1 s−r + s+r

2

=

1 s+r . s v2 .

Consequently, the radius r0 of ω 0 is

1 1 s−r − s+r

2

=

r v2 ,

and the distance

January 2012

OMO Solutions 2012

Page 19

Let F be the foot of the perpendicular from S to face A0 B 0 C 0 . F is the image of the antipode of S in 1 the circumsphere of SABC, so SF = 2u . Since S, O, and I are collinear, S, F , and I 0 are collinear. 0 0 0 0 Thus, SI is perpendicular to face A B C . Draw all the lines through S tangent to ω. Because SI 0 is perpendicular to plane A0 B 0 C 0 , the intersections of these lines with plane A0 B 0 C 0 will be a circle ω0 . Let any of these tangent lines meet ω 0 at P and A0 B 0 C 0 at Q. ω 0 is the incircle of 4A0 B 0 C 0 . Also, F Q is a radius (since F is the center of ω0 , I0P as S, F , and I 0 are collinear.) We have 4SQF ∼ 4SI 0 P , so FF Q S = SP . Thus, FQ = FS · √

r r0 1 r/v 2 = = ·p . 2u 2uv s02 − r02 (s2 − r2 )/v 4

Let O0 be the center of the circumcircle of A0 B 0 C 0 , and let x be its radius. By Euler’s distance formula r ). Now, consider the cross-section of Γ on the plane applied to A0 B 0 C 0 , we have that O0 F 2 = x(x − uv 0 0 0 through S and K perpendicular to plane A B C , which must thus pass through O0 , F , and I 0 . In this cross-section there is a circlep with radius R0 centered at K 0 . AB is a chord inside the circle, O0 is its r ), and S is a point on the circle on the same side of AB as K midpoint, AO0 = x, O0 F = x(x − uv 1 with distance 2u from AB. There is a circle centered at I 0 with radius r0 tangent to the circle, and SI 0 = s0 . Let J be the foot of the perpendicular from K to SJ. By the Pythagorean theorem, R02 = KS 2 = SJ 2 + KJ 2 = (SF − JF )2 + O0 F 2 = (

p r 1 − R02 − x2 )2 + x(x − ), 2u uv

and (R0 + r0 )2 = KI 02 = JI 02 + KJ 2 = (SI 0 − SJ)2 + x(x −

r ). uv

We leave the relatively straightforward but tedious computations to the interested reader. This problem was proposed by Alex Zhu.

The Online Math Open Fall Contest Official Solutions October 18 - 29, 2013

Acknowledgements Contest Directors • Evan Chen

Head Problem Writers • Evan Chen • Michael Kural • David Stoner

Problem Contributors, Proofreaders, and Test Solvers • Ray Li • Calvin Deng • Mitchell Lee • James Tao • Anderson Wang • Victor Wang • David Yang • Alex Zhu

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

OMO Fall 2013 Official Solutions 1. Determine the value of 142857 + 285714 + 428571 + 571428. Proposed by Ray Li. Answer. 1428570 . Solution. Let N = 142857. Because 142857 = N 285714 = 2N 428571 = 3N 571428 = 4N the answer is 10N = 1428570. Comment. For the curious: The cyclic shifting of the digits in the multiples of N is a consequence of the expansion 17 = 0.142857, and the fact that 10 is the primitive root modulo 7. See also USAMO 2013 #5, which is solved by basically the same idea. 2. The figure below consists of several unit squares, M of which are white and N of which are green. Compute 100M + N .

Proposed by Evan Chen. Answer. 1625 . Solution. It turns out that the white squares form a 4 × 4 grid, while the green squares form a 5 × 5 grid. (Rotate the grid!) So, the answer is 42 · 100 + 52 = 1625. 3. A palindromic table is a 3 × 3 array of letters such that the words in each row and column read the same forwards and backwards. An example of such a table is shown below. O N O

M M M

O N O

How many palindromic tables are there that use only the letters O and M ? (The table may contain only a single letter.) Proposed by Evan Chen. Answer. 16 .

1

OMO Fall 2013 Official Solutions Solution. It’s not hard to check the table must be of the form A C A

B X B

A C A

where A, B, C, X are letters, not necessarily distinct. This follows by looking at each pair of letters that must be the same for the table to be palindromic. Then, the answer is 24 = 16. 4. Suppose a1 , a2 , a3 , . . . is an increasing arithmetic progression of positive integers. Given that a3 = 13, compute the maximum possible value of aa1 + aa2 + aa3 + aa4 + aa5 . Proposed by Evan Chen. Answer. 365 . Solution. The sum in question is equal to 5aa3 = 5a13 . Now, because a1 ≥ 1, the common difference is at most 21 (13 − 1) = 6. Then, a13 ≤ 1 + 6 · 12 = 73, so 5a13 ≤ 365. Equality occurs when an = 6n − 5 for all n. 5. A wishing well is located at the point (11, 11) in the xy-plane. Rachelle randomly selects an integer y from the set {0, 1, . . . , 10}. Then she randomly selects, with replacement, two integers a, b from the set {1, 2, . . . , 10}. The probability the line through (0, y) and (a, b) passes through the well can be expressed as m n , where m and n are relatively prime positive integers. Compute m + n. Proposed by Evan Chen. Answer. 111 . Solution. Note that the number 11 is prime. The key observation is that if y 6= 0, then no lattice point on the line from (0, y) to (11, 11) can have an x-coordinate in {1, 2, . . . , 10}. Therefore, we must 1 have y = 0. This occurs with probability 11 . In that case, the probability that (a, b) lies on the line is just the probability that a = b, or So,

m n

=

1 11

·

1 10 ,

1 10 .

and the answer is 1 + 110 = 111.

6. Find the number of integers n with n ≥ 2 such that the remainder when 2013 is divided by n is equal to the remainder when n is divided by 3. Proposed by Michael Kural. Answer. 6 . Solution. Note that the remainder when dividing by 3 is either 0, 1, or 2. If both remainders are 0, then 3 | n and n | 2013 = 3 · 11 · 61, so 4 possibilities for n are 3, 3 · 11, 3 · 61, and 3 · 11 · 61. If both remainders are 1, then n | 2012 = 22 · 503, and n ≡ 1 (mod 3), so we can check to see that n = 22 and n = 2 · 503 are the only solutions in this case. If both remainders are 2, then n | 2011 and n ≡ 2 (mod 3). As 2011 is prime and n ≥ 2, the only possibility is n = 2011, but 2011 6≡ 2 (mod 3), so there are no solutions in this case. Thus the answer is 4 + 2 = 6. 7. Points M , N , P are selected on sides AB, AC, BC, respectively, of triangle ABC. Find the area of triangle M N P given that AM = M B = BP = 15 and AN = N C = CP = 25. Proposed by Evan Chen. Answer. 150 . 2

OMO Fall 2013 Official Solutions Solution. Remark that AB = 30, BC = 40 and CA = 50. Then, note that M and N are the midpoints of AC and BC. This causes the area of triangle M N P to be one quarter of the area of ABC; after all, one can “slide” P to the midpoint of AB without affecting the area! Hence the answer is 14 (600) = 150. 8. Suppose that x1 < x2 < · · · < xn is a sequence of positive integers such that xk divides xk+2 for each k = 1, 2, . . . , n − 2. Given that xn = 1000, what is the largest possible value of n? Proposed by Evan Chen. Answer. 13 . Solution. First, consider 1000 = 23 ·53 . Among the sequence of numbers xn , xn−2 , . . . we must reduce the number of prime factors by one. This process is forced to terminate in at most six steps, so we have n − 12 ≤ 1. Hence, n ≤ 13. Now we need to show n = 13 is actually achievable. Using the “chain” idea above, it is natural to write x13 = 1000 x11 = 200 x9 = 40 x7 = 20 x5 = 10 x3 = 5 x1 = 1 From here, we can weave in another chain by x12 = 240 x10 = 48 x8 = 24 x6 = 12 x4 = 6 x2 = 2 This shows that n = 13 is indeed achievable. 9. Let AXY ZB be a regular pentagon with area 5 inscribed in a circle with center O. Let Y 0 denote the reflection of Y over AB and suppose C is the center of a circle passing through A, Y 0 and B. Compute the area of triangle ABC. Proposed by Evan Chen. Answer. 1 . Solution. Instead of reflecting just the point Y , reflect the entire pentagon! Then we see that C is the center of pentagon AX 0 Y 0 Z 0 B – in other words, C is the reflection of O across AB. It then follows that the area of 4CAB is equal to the area of triangle OAB, which is one-fifth of the total area. Hence, 15 · 5 = 1. 10. In convex quadrilateral AEBC, ∠BEA = ∠CAE = 90◦ and AB = 15, BC = 14 and CA = 13. Let D be the foot of the altitude from C to AB. If ray CD meets AE at F , compute AE · AF . Proposed by David Stoner. 3

OMO Fall 2013 Official Solutions

X0

X A O

Y

C

Y0

B Z0

Z

Problem 9: The pentagon. Answer. 99 . Solution. We know CA ⊥ AE and AE ⊥ BE. Note that ∠ACF = ∠BAE = 90◦ − A, so 4CAF ∼ 4AEB, and AE · AF = CA · BE. Let the foot from B to AC be G, and note that BE = AG. But we can easily compute 99 132 + 152 − 142 = BE = 2 · 13 13 So AE · AF = BE · CA = 99. 11. Four orange lights are located at the points (2, 0), (4, 0), (6, 0) and (8, 0) in the xy-plane. Four yellow lights are located at the points (1, 0), (3, 0), (5, 0), (7, 0). Sparky chooses one or more of the lights to turn on. In how many ways can he do this such that the collection of illuminated lights is symmetric around some line parallel to the y-axis? Proposed by Evan Chen. Answer. 52 . Solution. Consider a line of symmetry. The alternating colors of the lights forces the line to pass through one of the lights. Let’s assume that the line of symmetry is x = k for some k. When k = 1, the only possibility is a single illuminated light (1, 0). When k = 2, we may choose whether (2, 0) is on, and whether the lights (1, 0) or (3, 0) are both on. However, we cannot have all lights off; in other words, we need to discard the empty set. Hence there are 22 − 1 = 3 possibilities. Continuing, we get 7, 15, 15, 7, 3, 1 possibilities for k = 3, 4, . . . , 8. Hence the answer is 1 + 3 + 7 + 15 + 15 + 7 + 3 + 1 = 52. 12. Let an denote the remainder when (n + 1)3 is divided by n3 ; in particular, a1 = 0. Compute the remainder when a1 + a2 + · · · + a2013 is divided by 1000. Proposed by Evan Chen. Answer. 693 . Solution. Remark that for any integer n with n ≥ 4, we have n3 ≤ (n + 1)3 ≤ 2n3 . Thus, we have an = (n + 1)3 − n3 for all integers n with n ≥ 4. In that case, we discover a “telescoping” sequence a4 + a5 + · · · + a2013 = 20143 − 43 ≡ 143 − 43 ≡ 680

(mod 1000).

Then, we just compute a1 = 0, a2 = 3, and a3 = 10. Hence, the answer is 680 + 0 + 3 + 10 = 693.

4

OMO Fall 2013 Official Solutions 13. In the rectangular table shown below, the number 1 is written in the upper-left hand corner, and every number is the sum of the any numbers directly to its left and above. The table extends infinitely downwards and to the right. 1 1 1 1 1 ··· 1 2 3 4 5 ··· 1 3 6 10 15 · · · 1 4 10 20 35 · · · 1 5 15 35 70 · · · .. .. .. .. .. . . . . . . . . Wanda the Worm, who is on a diet after a feast two years ago, wants to eat n numbers (not necessarily distinct in value) from the table such that the sum of the numbers is less than one million. However, she cannot eat two numbers in the same row or column (or both). What is the largest possible value of n? Proposed by Evan Chen. Answer. 20 . Solution. We claim optimal diet for any fixed n is to eat the n numbers from the (n − 1)th row of Pascal’s triangle. The main idea of the proof is as follows: suppose Wanda eats two numbers x and y where x is above and to the left of y. The associated rows/columns determine a rectangle with four vertices, two of which are x and y. Then, it’s not too hard to see that by replacing x, y with the numbers at the other two vertices, we get a smaller sum. (This follows a “smoothing”-type idea.) So, in an optimal situation, the numbers from a “diagonal” moving from bottom-left to upper-right.   n−1 The smallest possible sum of such a configuration is the numbers n−1 0 ,..., n , which occupies the n smallest rows and n smallest columns. The minimal sum is therefore 2n−1 . So we want 2n−1 < 106 or n ≤ 20. 14. In the universe of Pi Zone, points are labeled with 2 × 2 arrays of positive reals. One can teleport from point M to point M 0 if M can be obtained from  M 0 by multiplying either by some    a row or column   1 2 1 20 1 20 positive real. For example, one can teleport from to and then to . 3 4 3 40 6 80 A tourist attraction is a point where each of the entries of the associated array is either 1, 2, 4, 8 or 16. A company wishes to build a hotel on each of several points so that at least one hotel is accessible from every tourist attraction by teleporting, possibly multiple times. What is the minimum number of hotels necessary? Proposed by Michael Kural. Answer. 17 . 

 a b , define its height to be ad bc . It is not hard to see that one can only c d teleport between two points of the same height. One can also check that this is a complete invariant: that is, if two points have the same height, then it is possible to teleport from one to another. Solution. For an array

So, the answer is just the number of possible heights of tourist attractions. This can be any of the numbers 2−8 , 2−7 , . . . , 28 , of which there are 17. Comment. Trivia: the problem is really equivalent to finding the equivalence classes of a binary relation ∼ on the set of 2 × 2 matrices, where ∼ is the transitive closure of the teleportation operation.

5

OMO Fall 2013 Official Solutions 15. Find the positive integer n such that f (f (· · · f (n) · · · )) = 20142 + 1 | {z } 2013 f ’s

where f (n) denotes the nth positive integer which is not a perfect square. Proposed by David Stoner. Answer. 1015057 . Solution. We claim that f −1 (k 2 + 1) = k 2 − k + 1. Indeed, there are k positive squares at most k 2 + 1, so k 2 + 1 is the k 2 − k + 1th non-square. Now because (k − 1)2 < k 2 − k + 1 < k 2 for k > 1, we similarly obtain f −1 (k 2 − k + 1) = k 2 − k + 1 − (k − 1) = (k − 1)2 + 1 Repeatedly using these two formulas, it is now easy to obtain f −2013 (20142 + 1) = 10082 − 1008 + 1 = 1015057. 16. Al has the cards 1, 2, . . . , 10 in a row in increasing order. He first chooses the cards labeled 1, 2, and 3, and rearranges them among their positions in the row in one of six ways (he can leave the positions unchanged). He then chooses the cards labeled 2, 3, and 4, and rearranges them among their positions in the row in one of six ways. (For example, his first move could have made the sequence 3, 2, 1, 4, 5, . . . , and his second move could have rearranged that to 2, 4, 1, 3, 5, . . . .) He continues this process until he has rearranged the cards with labels 8, 9, 10. Determine the number of possible orderings of cards he can end up with. Proposed by Ray Li. Answer. 13122 . Solution. This is recursive. After the first move, which chooses one of three positions for card 1, it reduces to the same problem for 9 cards. Note that the ordering of cards 2 and 3 doesn’t matter because all possible second moves are independent of their order. For example, from 1, 2, 3, 4, . . . and 1, 3, 2, 4, . . . , we have the same set of possible resulting sequences. Thus, if an is the answer for n cards, we derive a recursion an = 3an−1 for every integer n with n ≥ 4. Because a3 = 6, we compute a10 = 37 · 6 = 13122. 17. Let ABXC be a parallelogram. Points K, P, Q lie on BC in this order such that BK = 13 KC and BP = P Q = QC = 13 BC. Rays XP and XQ meet AB and AC at D and E, respectively. Suppose that AK ⊥ BC, EK − DK = 9 and BC = 60. Find AB + AC. Proposed by Evan Chen. Answer. 100 . Solution. P and Q are the centroids of 4ABX and 4ACX, so it follows that D and E are the midpoints. Let M be the midpoint of BC. Then DKEM is an isosceles trapezoid, so 9 = EK − DK = DM − EM =

1 (AC − AB) =⇒ AC − AB = 18. 2

Now BK = 15, CK = 45, so AK 2 = AB 2 − 152 = AC 2 − 452 . In other words, AC 2 − AB 2 = 452 − 152 = 30 · 60 =⇒ AC + AB = 6

30 · 60 = 100. 18

OMO Fall 2013 Official Solutions 18. Given an n × n grid of dots, let f (n) be the largest number of segments between adjacent dots which can be drawn such that (i) at most one segment is drawn between each pair of dots, and (ii) each dot has 1 or 3 segments coming from it. (For example, f (4) = 16.) Compute f (2000). Proposed by David Stoner. Answer. 5999992 .

Problem 18: Complements in a square grid when n = 6. Solution. Consider the “complement” of such a drawing; i.e. the set of segments which is not chosen. Then we require that in the complement, • Each of the corner dots, which has two neighbors, has degree 2 − 1 = 1, • Each of the side dots, which has three neighbors, has degree 3 − 3 = 0 or 3 − 1 = 2, and • Each of the interior dots, which has four neighbors, has degree 4 − 3 = 1 or 4 − 1 = 3. We wish to minimize the number of edges in the complement. It is not hard to see the construction in the figure is now minimal. We just handle the corners first, and then connect the rest of the points in the interior to handle the condition the degree needs to be 2 −4 at least one. This will yield 2 · 4 + (n−2) segments (when n is even). This corresponds to 2 (n − 2)2 − 4 2n(n − 1) − 8 + 2 

 =

3 2 n −8 2

segments in the actual construction. When n = 2000, we obtain 5999992. 19. Let σ(n) be the number of positive divisors of n, and let rad n be the product of the distinct prime divisors of n. By convention, rad 1 = 1. Find the greatest integer not exceeding ∞ X σ(n)σ(n rad n) 100 n2 σ(rad n) n=1

! 13 .

Proposed by Michael Kural. Answer. 164 . Solution. Let f (n) =

σ(n)σ(n rad n) . Note that f (n) is multiplicative, so the desired sum is simply n2 σ(rad n) ∞ X

f (n) =

n=1

∞ Y X p prime k=0

7

f (pk )

OMO Fall 2013 Official Solutions Now for k ≥ 1, σ(pk ) = k + 1, and rad pk = p, so σ(pk rad pk ) = k + 2. σ(rad pk ) is simply 2, so   (k + 1)(k + 2) k+2 1 k f (p ) = = 2 2p2k p2k Note that f (1) = 1, so this formula holds for all k ≥ 0. Then  3 X 1 X X k + 2 1  = f (pk ) = 2 p2k p2k k≥0

Then ∞ Y X p prime k=0

k≥0

k≥0

3   3 X 1 Y X 1   =   p2k p2k 

Y

f (pk ) =

p prime

p prime

k≥0

k≥0

But again by multiplicativity  Y p prime

 X 1 X 1 π2  = = 2k 2 p n 6 n≥1

k≥0

Thus ∞ X σ(n)σ(n rad n) 100 n2 σ(rad n) n=1

! 31 =

100π 2 ≈ 164.5 6

So the answer is 164. 20. A positive integer n is called mythical if every divisor of n is two less than a prime. Find the unique mythical number with the largest number of divisors. Proposed by Evan Chen. Answer. 135 . Solution. Consider n mythical and observe that 2 - n. Now, remark that there cannot be two distinct primes p, q 6= 3 dividing n. Otherwise, p + 2, q + 2, and pq + 2 must both be prime. Then we must have p, q ≡ 2 (mod 3) but then pq + 2 ≡ 0 (mod 3), which is impossible. Similar work also allows us to prove that p2 - n for p 6= 3. Hence, we will write n = 3k p for some prime p. (The case n = 3k has five divisors at 81 and this is maximal here.) If p = 5, then it is easy to check that 33 · 5 = 135 is the best possible (since 34 · 5 + 2 = 11 · 37). Now, we will prove that if p > 5 then k < 3. Indeed, if k ≥ 3, then 30 p + 2 ≡ p + 2

(mod 5)

1

(mod 5)

2

(mod 5)

3

(mod 5)

3 p + 2 ≡ 3p + 2 3 p + 2 ≡ 4p + 2 3 p + 2 ≡ 2p + 2

must all be prime. But unless p ≡ 0 (mod 5), at least one of these must be 0 (mod 5), which is a contradiction. (This isn’t a miracle – it occurs because 3 is a primitive root modulo 5, so all nonzero residues appear as a coefficient.) So the optimal case is 4 · 2 = 8 factors, achieved at 33 · 5 = 135. 21. Let ABC be a triangle with AB = 5, AC = 8, and BC = 7. Let D be on side AC such that AD = 5 and CD = 3. Let I be the incenter of triangle ABC and E be the intersection of the perpendicular √ a b bisectors of ID and BC. Suppose DE = c where a and c are relatively prime positive integers, and b is a positive integer not divisible by the square of any prime. Find a + b + c. Proposed by Ray Li. 8

OMO Fall 2013 Official Solutions Answer. 13 . Solution. We claim that BIDC is a cyclic quadrilateral. First, note that as 72 = 82 + 52 − 2 · 5 · 8 ·

1 2

◦ it follows that cos ∠A = 12 and ∠A = 60◦ . Then ∠BIC = 90◦ + ∠A 2 = 120 . Also, since AB = AD ◦ ◦ and ∠BAD = 60 , triangle BAD is equilateral, so ∠BDC = 180 − ∠ADB = 120◦ . Thus BIDC is cyclic, and E is its circumcenter. Thus DE is the circumradius of triangle DBC, but this is easy to compute with the law of sines: √ 7 3 BC 7 1 = = DE = · 2 sin ∠BDC 2 sin 120◦ 3

So the answer is 7 + 3 + 3 = 13. 22. Find the sum of all integers m with 1 ≤ m ≤ 300 such that for any integer n with n ≥ 2, if 2013m divides nn − 1 then 2013m also divides n − 1. Proposed by Evan Chen. Answer. 4360 . Solution. Call an integer M stable if nn ≡ 1 (mod M ) implies n ≡ 1 (mod M ). We claim that M is stable if for every prime p | M , we have q | M for each prime factor q of p − 1. Suppose nn ≡ 1 (mod M ). It suffices to show that n ≡ 1 (mod pk ) for each pk | M , (where p is a prime). Let u | ϕ(pk ) be the order of n modulo pk . Because nn ≡ 1 (mod M ) =⇒ (n, M ) = 1, we find that (n, ϕ(pk )) = 1. But u | n as well. This forces u = 1, which is the desired. Let M = 2013m. First, we claim that M must be even. Otherwise, take n = M − 1. Then, we claim that 5 must divide M . Otherwise, take n ≡ 0 (mod 5), n ≡ 3 (mod 11), and n ≡ 1 modulo any other primes powers dividing M . Now for m = 10, 20, . . . , 300, it is easy to check by the condition that M is stable by our condition above – unless m = 290. It turns out that m = 290 is not stable; simply select n ≡ 0 (mod 7), n ≡ 24 (mod 29), and n ≡ 1 (mod 10 · 2013). It is not hard to check that nn − 1 ≡ 1 (mod 29 · 10 · 2013) and yet n 6≡ 1 (mod 29), as desired. So, the answer is 10 + 20 + 30 + · · · + 280 + 300 = 4360. In fact, the converse to the stability lemma is true as well. We can generate the necessary counterexamples using primitive roots. 23. Let ABCDE be a regular pentagon, and let F be a point on AB with ∠CDF = 55◦ . Suppose F C and BE meet at G, and select H on the extension of CE past E such that ∠DHE = ∠F DG. Find the measure of ∠GHD, in degrees. Proposed by David Stoner. Answer. 19 . Solution. Let J be the intersection of diagonals BD and CE, and note that ABEJ is a rhombus. First, we claim that JG k DF . Let CF and BD meet at T . Observe that ∠T CJ = ∠T F B,

∠BT G = ∠CT J

and ∠GBT = ∠F BG = ∠JCD = ∠JDC = 36◦ . 9

OMO Fall 2013 Official Solutions

H F

A

G

B

E

T

J C

D

Problem 23: A pentagon! Point F is not drawn to scale. Applying the law of sines now yields T G : GF = T J : JD readily, proving the claim. Then ∠JGD = ∠F DG = ∠EHD = ∠JHD so J, D, G, H are concyclic. Now we deduce ∠GHD = 180◦ − ∠GJD = ∠JDF = ∠CDF − 36◦ = 19◦ . √ 1 24. The real numbers a0 , a1 , . . . , a2013 and b0 , b1 , . . . , b2013 satisfy an = 63 2n + 2 + an−1 and bn = √ 1 2n + 2 − b for every integer n = 1, 2, . . . , 2013. If a = b and b = a2013 , compute n−1 0 2013 0 96 2013 X

(ak bk−1 − ak−1 bk ) .

k=1

Proposed by Evan Chen. Answer. 671 . Solution. Let n = 2013 for brevity. Then compute n X

(ak bk−1 − ak−1 bk ) =

k=1

=

n X k=1 n X

((ak − ak−1 ) (bk + bk−1 ) − (ak bk − ak−1 bk−1 )) (ak − ak−1 ) (bk + bk−1 ) +

k=1

n X

(ak bk − ak−1 bk−1 )

k=1 n

1 X (2k + 2) + (an bn − a0 b0 ) 63 · 96 k=1   1 4 + (2n + 2) = n· 63 · 96 2 2013 · 2016 = 63 · 96 = 671.

=

10

OMO Fall 2013 Official Solutions

A D

X

B

C

F

Y

E

Problem 25: It’s the burning tent problem! 25. Let ABCD be a quadrilateral with AD = 20 and BC = 13. The area of 4ABC is 338 and the area of 4DBC is 212. Compute the smallest possible perimeter of ABCD. Proposed by Evan Chen. Answer. 118 . Solution. Let X and Y be the feet of the altitudes from A and D to BC. Compute AX = 64 DY = 424 13 and finally XY = 13 .

676 13 ,

The intuition now is to let BC slide along line XY , reducing this to the river problem. Let E be the reflection of D over Y and F be the point such that BCEF is a parallelogram. Then it’s easy to compute  2  2 105 1100 2 AF 2 = (XY − BC) + (AX + DY )2 = + = 852 . 13 13 Then AB + CD = AB + BE ≤ AF = 85, and the answer is 85 + 20 + 13 = 118. 26. Let ABC be a triangle with AB = 13, AC = 25, and tan A = 34 . Denote the reflections of B, C across AC, AB by D, E, respectively, and let O be the circumcenter of triangle ABC. Let P be a point such d of the that 4DP O ∼ 4P EO, and let X and Y be the midpoints of the major and minor arcs BC circumcircle of triangle ABC. Find P X · P Y . Proposed by Michael Kural. Answer. 274 . Solution. Let the complex coordinates of A, B, C, D, E be a, b, c, d, e. Without loss of generality assume that O is at the origin. Note that 4BOC ∼ 4BAD, so d−a c−0 = a−b 0−b implying

c ac d = a + (b − a) = a + c − b b

11

OMO Fall 2013 Official Solutions and similarly, e = a + b − resason. Then

ab c .

Now note that p =



de, as

p d

=

e p.

√ Also, X, Y = ± bc for a similar

√ √ √ √ P X · P Y = de − bc de + bc    ac  ab = a+c− a+b− − bc b c 2 2 a c a b = − − + 2a2 b c 2 a (b − c)2 . = − bc 2 a Now as we assumed O, the circumcenter of ABC, was at the origin, we have |a| = |b| = |c|, so = 1. bc Thus 2 a P X · P Y = |(b − c)2 | = |b − c|2 = BC 2 bc But now it is easy to compute BC 2 = AB 2 + AC 2 − 2 · AB · AC cos A = 132 + 252 − 2 · 13 · 25 ·

4 = 274. 5

27. Ben has a big blackboard, initially empty, and Francisco has a fair coin. Francisco flips the coin 2013 times. On the nth flip (where n = 1, 2, . . . , 2013), Ben does the following if the coin flips heads: (i) If the blackboard is empty, Ben writes n on the blackboard. (ii) If the blackboard is not empty, let m denote the largest number on the blackboard. If m2 + 2n2 is divisible by 3, Ben erases m from the blackboard; otherwise, he writes the number n. No action is taken when the coin flips tails. If probability that the blackboard is empty after all 2013 , where u, v, and k are nonnegative integers, compute k. flips is 2k2u+1 (2v+1) Proposed by Evan Chen. Answer. 1336 . Solution. Consider non-commutative variables s, t which satisfy s2 = t2 = 1. Then the problem is 2013 1 equivalent to computing 22013 M , where M is the number of choices of i1 , i2 , . . . , i2013 ∈ {0, 1} which satisfy si1 si2 ti3 si4 tsi5 ti6 si7 . . . si2011 si2012 ti2013 = 1. Because sa sb has the same possible outcomes as si , we have M = 2671 N where N is the number of choices of j1 , j2 , . . . , j1342 which satisfy sj1 tj2 sj3 tj4 . . . sj1341 tj1342 = 1.  Applying Proposition 5.2 from this RSI 2013 paper directly gives N = 1341 671 . (A general closed form is given in the paper, and the proof is just a long induction.) A standard computation shows that 26 is the largest power of 2 which divides N . So, the answer is 2013 − 671 − 6 = 1336. Comment. This is essentially the two variable version of 2012-2013 Winter OMO Problem 50, but the connection is not immediately obvious. Refer to official solution 2 for more details. One may also consider the slightly easier variant of this problem with the second condition reversed: that is, Ben erases m precisely when m2 + 2n2 is not divisible by 3. 28. Let n denote the product of the first 2013 primes. Find the sum of all primes p with 20 ≤ p ≤ 150 such that 12

OMO Fall 2013 Official Solutions (i)

p+1 2

is even but is not a power of 2, and

(ii) there exist pairwise distinct positive integers a, b, c for which an (a − b)(a − c) + bn (b − c)(b − a) + cn (c − a)(c − b) is divisible by p but not p2 . Proposed by Evan Chen. Answer. 431 . Solution. First, observe that because of condition (i), we have that p(p − 1) | n for each suitable prime. This will allow us to apply Fermat’s Little Theorem later. Let N = an (a−b)(a−c)+bn (b−c)(b−a)+cn (c−a)(c−b). Suppose that we indeed have p1 k N , (where pk k n means pk | n but pk+1 - n). First, we claim that we cannot have a ≡ 0 (mod p). Otherwise, because n ≥ 2 this would imply an (a − b)(a − c) ≡ 0 (mod p2 ) and hence we obtain N ≡ bn (b − c)(b − a) + cn (c − a)(c − b)

(mod p2 )

= (b − c) [bn (b − a) − cn (c − a)] This is clearly fatal if c ≡ 0 (mod p) as well, so consider the case where b, c 6≡ 0 (mod p). Observe that bn (b − a) − cn (c − a) ≡ b − c (mod p). Hence, either both or neither of the terms above are divisible by p2 . So we need only consider the case where a, b, c 6≡ 0 (mod p). In that case, an ≡ bn ≡ cn ≡ 1 (mod p). Assume without loss of generality that b − c 6≡ 0 (mod p); otherwise a − b ≡ b − c ≡ c − a ≡ 0 (mod p) gives p2 | N . Now we compute 2N ≡ 2(a − b)(a − c) + 2(b − c)(b − a) + 2(c − a)(c − b) ≡ (a − b)2 + (b − c)2 + (c − a)2

(mod p2 )

(mod p2 ) 2

= (a − b)2 + (b − c)2 + [(a − b) + (b − c)]   = 2 (a − b)2 + (a − b)(b − c) + (b − c)2 =⇒ N ≡ (a − b)2 + (a − b)(b − c) + (b − c)2 Let x = a − b and y = b − c 6≡ 0

(mod p).

N ≡ x2 + xy + y 2

(mod p2 )

At this point we drop down to modulo p and find 0 ≡ x2 + xy + y 2 (mod p) 2  x (mod p) =⇒ −3 ≡ 2 + 1 y   Quadratic reciprocity now implies −3 = 1 =⇒ p ≡ 1 (mod 3). Hence, in the original criterion the p only possibilities are p ∈ {43, 67, 79, 103, 139}.  2 The sum of these is 431. To construct them, just pick y = 1 and 0 < x < p−1 such that 2 xy + 1 ≡ −3 (mod p) (again possible by quadratic reciprocity). Then x2 + xy + y 2 < (x + y)2 < p2 . So we simply reconstruct a suitable a, b, c from the x and y. 29. Kevin has 255 cookies, each labeled with a unique nonempty subset of {1, 2, 3, 4, 5, 6, 7, 8}. Each day, he chooses one cookie uniformly at random out of the cookies not yet eaten. Then, he eats that cookie, and all remaining cookies that are labeled with a subset of that cookie (for example, if he chooses the 13

OMO Fall 2013 Official Solutions cookie labeled with {1, 2}, he eats that cookie as well as the cookies with {1} and {2}). The expected value of the number of days that Kevin eats a cookie before all cookies are gone can be expressed in the form m n , where m and n are relatively prime positive integers. Find m + n. Proposed by Ray Li. Answer. 213 . Solution. The proof is by linearity of expectation. Let n = 8. 1 We claim the probability that a cookie with a subset S is ever chosen is 2n−|S| . Note that S is uneaten at a given time if and only if all of its supersets are also uneaten at that time. Because each of S and its supersets is equally likely to be eaten at any such point in time, the probability is just

1 1 = n−|S| 2#(supersets) 2 as claimed. But the number of days Kevin takes equals the number of cookies chosen, or the sum of the indicator function [cookie S chosen] over all nonempty subsets S. Therefore the expected number of days taken simply equals X S⊆{1,2,...,8}

1 2n−|S|

8 X #sets with size k = 2n−k k=1   n n

= =

n 20 n n



n−1 21

+ n

·2 +

n 0 2n



n 0 2n

+ ··· + −  n−1 2 + ··· +

n n−1



n 0





n 0



2n n

(2 + 1) − 1 2n 38 − 1 = 28 205 = 8 where we have subtracted off the last term since the empty set is not among the cookies. Hence, the answer is 205 + 8 = 213. =

30. Let P (t) = t3 + 27t2 + 199t + 432. Suppose a, b, c, and x are distinct positive reals such that P (−a) = P (−b) = P (−c) = 0, and r r r r a+b+c b+c+x c+a+x a+b+x = + + . x a b c If x =

m n

for relatively prime positive integers m and n, compute m + n.

Proposed by Evan Chen. Answer. 847 . Solution. First note that x is unique, because if we multiply both sides of the equation by x, we get a constant on the LHS and an increasing function f (x) on the RHS (such that f (0) = 0 and limx→∞ f (x) = ∞). (*) Construct three mutually tangent circles centered at A, B, C with radii a, b, c, respectively, and consider a fourth circle centered at X with radius y externally tangent to (A), (B), (C). By Descartes’s theorem on mutually tangent circles, r p 199 27 199 1 −1 −1 −1 −1 −1 −1 −1 −1 −1 −1 y =a +b +c +2 a b +b c +c a = +2 = + . 432 432 432 2 14

OMO Fall 2013 Official Solutions A

X

B

C

Problem 30: Actually a geometry problem. On the other hand, by Heron’s formula on the equation [ABC] = [AXB] + [BXC] + [CXA], we find p p p p abc(a + b + c) = ybc(b + c + y) + yca(c + a + y) + yab(a + b + y), whence f (y) = f (x) =⇒ y = x by (*). Finally, x =

1 199 1 432 + 2

=

432 415 ,

yielding an answer of 432 + 415 = 847.

Comment. This problem is more or less equivalent to 2011 ELMO Shortlist A5, which was inspired by a failed approach on 2003 IMO Shortlist G7.

15

The Online Math Open Winter Contest Official Solutions January 4, 2013–January 15, 2013

Acknowledgments Contest Directors Ray Li, James Tao, Victor Wang

Head Problem Writers Evan Chen, Ray Li, Victor Wang

Additional Problem Contributors James Tao, Anderson Wang, David Yang, Alex Zhu

Proofreaders and Test Solvers Evan Chen, Calvin Deng, Mitchell Lee, James Tao, Anderson Wang, David Yang, Alex Zhu

Website Manager Ray Li

LATEX/Document Manager Evan Chen

Contest Information Format The test will start Friday, January 4 and end Tuesday, January 15 (ignore the previous deadline of Monday, January 14). You will have until 7pm EST on January 15 to submit your answers; see here for submission procedures. The test consists of 50 short answer questions, each of which has a nonnegative integer answer no greater than 263 −2 = 9223372036854775806. The problem difficulties range from those of AMC problems to those of Olympiad problems. Problems are ordered in roughly increasing order of difficulty.

Team Guidelines Students may compete in teams of up to four people. Participating students must not have graduated from high school. International students may participate. No student can be a part of more than one team. The members of each team do not get individual accounts; they will all share the team account. Each team will submit its final answers through its team account. Though teams can save drafts for their answers, the current interface does not allow for much flexibility in communication between team members. We recommend using Google Docs and Spreadsheets to discuss problems and compare answers, especially if teammates cannot communicate in person. Teams may spend as much time as they like on the test before the deadline.

Aids Drawing aids such as graph paper, ruler, and compass are permitted. However, electronic drawing aids are not allowed. This is includes (but is not limited to) Geogebra and graphing calculators. Published print and electronic resources are not permitted. (This is a change from last year’s rules.) Four-function calculators are permitted on the Online Math Open. That is, calculators which perform only the four basic arithmetic operations (+-*/) may be used. Any other computational aids such as scientific and graphing calculators, computer programs and applications such as Mathematica, and online databases are prohibited. All problems on the Online Math Open are solvable without a calculator. Four-function calculators are permitted only to help participants reduce computation errors.

Clarifications Clarifications will be posted as they are answered. For the Winter 2012-2013 Contest, they will be posted here. If you have a question about a problem, please email [email protected] with “Clarification” in the subject. We have the right to deny clarification requests that we feel we cannot answer.

Scoring Each problem will be worth one point. Ties will be broken based on the “hardest” problem that a team answered correctly. Remaining ties will be broken by the second hardest problem solved, and so on. Problem X is defined to be “harder” than Problem Y if and only if (i) X was solved by less teams than Y , OR (ii) X and Y were solved by the same number of teams and X appeared later in the test than Y . Note: This is a change from prior tiebreaking systems. problems by approximate difficulty.

However, we will still order the

Results After the contest is over, we will release the answers to the problems within the next day. If you have a protest about an answer, you may send an email to [email protected] (Include “Protest” in the subject). Solutions and results will be released in the following weeks.

January 2013

Winter OMO 2012-2013

Page 1

1. Let x be the answer to this problem. For what real number a is the answer to this problem also a − x? Answer. 0 . Solution. a = x, so a − x = 0 must be the answer. This problem was proposed by Ray Li. 2. The number 123454321 is written on a blackboard. Evan walks by and erases some (but not all) of the digits, and notices that the resulting number (when spaces are removed) is divisible by 9. What is the fewest number of digits he could have erased? Answer. 2 . Solution. The sum of the digits needs to be divisible by 9, so we need to remove 7 at minimum. Since there is no 7, we can remove a 2 and a 5 or a 3 and a 4: 2 digits. This problem was proposed by Ray Li. This solution was given by ahaanomegas on AoPS. 3. Three lines m, n, and ` lie in a plane such that no two are parallel. Lines m and n meet at an acute angle of 14◦ , and lines m and ` meet at an acute angle of 20◦ . Find, in degrees, the sum of all possible acute angles formed by lines n and `. Answer. 40 . Solution. There are two possible angles: 20◦ − 16◦ and 20◦ + 16◦ (note that both are acute), so the sum is 2 · 20◦ = 40◦ . This problem was proposed by Ray Li. 4. For how many ordered pairs of positive integers (a, b) with a, b < 1000 is it true that a times b is equal to b2 divided by a? For example, 3 times 9 is equal to 92 divided by 3.

Figure 1: xkcd 759 Answer. 31 . Solution. ab = 1000, or 31.

b2 a

is equivalent to a2 = b, so we simply want the number of perfect squares less than

This problem was proposed by Ray Li. 5. At the Mountain School, Micchell is assigned a submissiveness rating of 3.0 or 4.0 for each class he takes. His college potential is then defined as the average of his submissiveness ratings over all classes taken. After taking 40 classes, Micchell has a college potential of 3.975. Unfortunately, he needs a college potential of at least 3.995 to get into the South Harmon Institute of Technology. Otherwise, he becomes a rock. Assuming he receives a submissiveness rating of 4.0 in every class he takes from now on, how many more classes does he need to take in order to get into the South Harmon Institute of Technology? Answer. 160 .

January 2013

Winter OMO 2012-2013

Page 2

Solution. If at any point Micchell has a and b ratings of 4.0 and 3.0, respectively, his college potential b is 4a+3b a+b = 4 − a+b . Thus after taking 40 classes, he has received exactly one submissiveness rating of 3.0. In order to get his college potential up to at least 3.995, he needs 4 − x1 ≥ 3.995, where x is the number of total classes taken (including the original 40); solving, we get x ≥ 200. Since x = 200 also suffices, Micchell needs to take at least 200 − 40 = 160 more classes. In other words, he should clearly just try to be a rock. This problem was proposed by Victor Wang. 6. Circle S1 has radius 5. Circle S2 has radius 7 and has its center lying on S1 . Circle S3 has an integer radius and has its center lying on S2 . If the center of S1 lies on S3 , how many possible values are there for the radius of S3 ? Answer. 11 . Solution. By the triangle inequality, the possible radii are those between 7 − 5 and 7 + 5, giving us 11 possible values. This problem was proposed by Ray Li. 7. Jacob’s analog clock has 12 equally spaced tick marks on the perimeter, but all the digits have been erased, so he doesn’t know which tick mark corresponds to which hour. Jacob takes an arbitrary tick mark and measures clockwise to the hour hand and minute hand. He measures that the minute hand is 300 degrees clockwise of the tick mark, and that the hour hand is 70 degrees clockwise of the same tick mark. If it is currently morning, how many minutes past midnight is it? Answer. 500 . Solution. The hour’s degree from the closest tick mark is 10 degrees clockwise, which means 20 minutes. This is 120 degrees clockwise from tick mark 12. So Jacob chooses tick mark 6, and the current time is 8:20, so 500 minutes. This problem was proposed by Ray Li. This solution was given by chaotic iak on AoPS. 8. How many ways are there to choose (not necessarily distinct) integers a, b, c from the set {1, 2, 3, 4} c such that a(b ) is divisible by 4? Answer. 28 . Solution. Basic casework. Note that, if a = 1 or a = 3, the power is going to be odd, so no change of 4-divisibility. The interesting part is a = 2 and a = 4. If a = 2, as long as bc ≥ 2, we’re good. If b = 1, bc = 1, so that fails. If b = 2, b = 3, or b = 4, we have 4 choices of c for each, making 12. If a = 4, all combinations of b and c work. There are 42 = 16 ways we can do this. Thus, the answer is 12 + 16 = 28. This problem was proposed by Ray Li. This solution was given by ahaanomegas on AoPS. 9. David has a collection of 40 rocks, 30 stones, 20 minerals and 10 gemstones. An operation consists of removing three objects, no two of the same type. What is the maximum number of operations he can possibly perform? Answer. 30 .

January 2013

Winter OMO 2012-2013

Page 3

Solution. Each move uses at least one mineral or gemstone, so we cannot do better than 30. (Alternatively, as mcdonalds106 7 notes on AoPS, we can note that each move uses at least two stones, minerals, or gemstones.) On the other hand, this is easily achieved by taking a rock and a stone (and then either a mineral or a gemstone) each time. This problem was proposed by Ray Li. 10. At certain store, a package of 3 apples and 12 oranges costs 5 dollars, and a package of 20 apples and 5 oranges costs 13 dollars. Given that apples and oranges can only be bought in these two packages, what is the minimum nonzero amount of dollars that must be spent to have an equal number of apples and oranges? Answer. 64 . Solution. The (signed) difference between apples and oranges (aka apples - oranges) must be 0. The first package gives a difference −9 while the second gives +15, so we need to have 5 of the first packages and 3 of the second packages for 64 dollars. (Just to check, there are 75 apples and 75 oranges now.) This problem was proposed by Ray Li. This solution was given by chaotic iak on AoPS. 11. Let A, B, and C be distinct points on a line with AB = AC = 1. Square ABDE and equilateral triangle ACF are drawn on the same side of line BC. What is the degree measure of the acute angle formed by lines EC and BF ? Answer. 75 . Solution. The desired angle is just ∠F BC + ∠ECB = that AB = AF .

180◦ −120◦ 2

+ 45◦ = 75◦ , where we use the fact

This problem was proposed by Ray Li. 12. There are 25 ants on a number line; five at each of the coordinates 1, 2, 3, 4, and 5. Each minute, one ant moves from its current position to a position one unit away. What is the minimum number of minutes that must pass before it is possible for no two ants to be on the same coordinate? Answer. 126 . Solution. Consider the sum of the (absolute) distances from the original centroid (3) of the ants to each of the ants. This quantity changes by at most 1 each time, so the answer is at least (0 + 1 + 1 + · · · + 12 + 12) − 5(0 + 1 + 1 + 2 + 2) = 126, which is clearly achievable (as long as we don’t go beyond 3 ± 12). This problem was proposed by Ray Li. 13. There are three flies of negligible size that start at the same position on a circular track with circumference 1000 meters. They fly clockwise at speeds of 2, 6, and k meters per second, respectively, where k is some positive integer with 7 ≤ k ≤ 2013. Suppose that at some point in time, all three flies meet at a location different from their starting point. How many possible values of k are there? Answer. 501 . Solution. Working modulo 1000 (allowing fractional parts, as we do mod 1) tells us that precisely k ≡ 2 (mod 4) work. This problem was proposed by Ray Li. 14. What is the smallest perfect square larger than 1 with a perfect square number of positive integer factors?

January 2013

Winter OMO 2012-2013

Page 4

Answer. 36 . Solution. Clearly our number will either be of the form p8 or p2 q 2 , so our answer is 62 = 36. (Anything with at least three distinct prime factors will be at least 302 .) This problem was proposed by Ray Li. 15. A permutation a1 , a2 , . . . , a13 of the numbers from 1 to 13 is given such that ai > 5 for i = 1, 2, 3, 4, 5. Determine the maximum possible value of aa1 + aa2 + aa3 + aa4 + aa5 . Answer. 45 . Solution. a1 through a5 take up 5 numbers greater than 5, so we can’t do better than 13 + 12 + 11 + 5 + 4 = 45. This is achieved whenever {a1 , . . . , a5 } = {6, 7, 8, 9, 10} and {a6 , a7 , a8 , a9 , a10 } = {4, 5, 11, 12, 13}. This problem was proposed by Evan Chen. 16. Let S1 and S2 be two circles intersecting at points A and B. Let C and D be points on S1 and S2 respectively such that line CD is tangent to both circles and A is closer to line CD than B. If ∠BCA = 52◦ and ∠BDA = 32◦ , determine the degree measure of ∠CBD. Answer. 48 . Solution. Note that ∠CBA = ∠DCA, ∠DBA = ∠CDA. Let ∠CBA = x, ∠DBA = y; then ∠CBD = x + y, ∠BCD = 52 + x, ∠CDB = 32 + y. Therefore, 2(x + y) + 52 + 32 = 180 yields ∠CBD = 180−52−32 = 48◦ . 2 This problem was proposed by Ray Li. This solution was given by thugzmath10 on AoPS. 17. Determine the number of ordered pairs of positive integers (x, y) with y < x ≤ 100 such that x2 − y 2 and x3 − y 3 are relatively prime. (Two numbers are relatively prime if they have no common factor other than 1.) Answer. 99 . Solution. Clearly we need x − y = 1. It’s easy to check that gcd(x + y, x2 + xy + y 2 ) = 1 for all such x, y, so the answer is 99. This problem was proposed by Ray Li. 18. Determine the absolute value of the sum b2013 sin 0◦ c + b2013 sin 1◦ c + · · · + b2013 sin 359◦ c, where bxc denotes the greatest integer less than or equal to x. (You may use the fact that sin n◦ is irrational for positive integers n not divisible by 30.) Answer. 178 . Solution. bxc + b−xc = −1 when x is not an integer, so from sin(x + π) = − sin(x) we get ans answer is −178 + b1c + b−1c = 0. This problem was proposed by Ray Li. 19. A, B, C are points in the plane such that ∠ABC = 90◦ . Circles with diameters BA and BC meet at D. If BA = 20 and BC = 21, then the length of segment BD can be expressed in the form m n where m and n are relatively prime positive integers. What is m + n?

January 2013

Winter OMO 2012-2013

Page 5

Answer. 449 . Solution. Let the circle with diameter BA intersect AC at E. Similarly, let the circle with diameter BC intersect AC at F . We easily find ∠BDA = 90 and ∠BF C = 90, so E and F are the same point, the intersection of AC and the altitude from B. The answer follows. This problem was proposed by Ray Li. This solution was given by BOGTRO on AoPS. n 20. Let a1 , a2 , . . . , a2013 be a permutation of the numbers from 1 to 2013. Let An = a1 +a2 +···+a for n n = 1, 2, . . . , 2013. If the smallest possible difference between the largest and smallest values of A1 , A2 , . . . , A2013 is m n , where m and n are relatively prime positive integers, find m + n.

Answer. 3 . Solution. Looking at |A1 − A2 | we see the answer is at least 1/2. Equality can be achieved by 1007, 1008, 1006, 1009, 1005, . . .. This problem was proposed by Ray Li. 21. Dirock has a very neat rectangular backyard that can be represented as a 32 × 32 grid of unit squares. The rows and columns are each numbered 1, 2, . . . , 32. Dirock is very fond of rocks, and places a rock in every grid square whose row and column number are both divisible by 3. Dirock would like to build a rectangular fence with vertices at the centers of grid squares and sides parallel to the sides of the yard such that a) The fence does not pass through any grid squares containing rocks; b) The interior of the fence contains exactly 5 rocks. In how many ways can this be done? Answer. 1920 . Solution. 5 rocks? In a rectangle? Oh no I guess the only way to do that is have 5 rocks in a row. What a rocky start to a rocky problem. Or maybe it’s not that unfortunate. For each row (with rocks), there are 10 rocks so there are 6 sequences of 5 consecutive rocks. There are 10 rows, and also we can have both vertical and horizontal groups of rocks, so we have the 6×10×2 = 120 groups of 5 abiotic likenesses of Geodudes (substitute Gravelers and Golems as necessary). Let’s construct a frame for each of our 5-rock gardens. There are 2 possible top boundaries, 2 possible lower boundaries, 2 possible left boundaries, and 2 possible right boundaries, so there are 24 = 16 different frames we can choose from. And what do you know, everything is conveniently symmetric: it’s the same for every group of rocks. WOW WHAT A COINCIDENCE I guess we must be lucky to get this problem huh So by the multiplication principle (which everyone knows but like no one actually knows by name), our answer is 120 × 16 = 1920 = year of ratification of 19th amendment so clearly the test writers wanted to make a point about women’s suffrage. This problem was proposed by Ray Li. This solution was given by Past on AoPS. 22. In triangle ABC, AB = 28, AC = 36, and BC = 32. Let D be the point on segment BC satisfying ∠BAD = ∠DAC, and let E be the unique point such that DE k AB and line AE is tangent to the circumcircle of ABC. Find the length of segment AE. Answer. 18 .

January 2013

Winter OMO 2012-2013

Page 6

28·32 Solution. We have BD = 28+36 = 14 and CD = 32−14 = 18. Since DE k AB, ∠CDE = ∠CBA and ∠BAD = ∠EDA. But ∠ABC = ∠CAE, so it follows that ∠CDE = ∠CBA (which implies AECD is cyclic), ∠CAD = ∠EDA and ∠CDA = ∠EAD. As AD is the common segment of triangles CAD and EDA, by ASA Congurence Postulate we have 4CAD ∼ = 4EDA. Therefore, AE = CD = 18.

This problem was proposed by Ray Li. This solution was given by thugzmath10 on AoPS. 23. A set of 10 distinct integers S is chosen. Let M be the number of nonempty subsets of S whose elements have an even sum. What is the minimum possible value of M ? Answer. 511 . Clarifications. • S is the “set of 10 distinct integers” from the first sentence. Solution. If all the elements are even we get 210 −1. If at least one is odd then we get at least 12 210 −1, which is achieved by all 1s, for instance. This problem was proposed by Ray Li. 24. For a permutation π of the integers from 1 to 10, define S(π) =

9 X

(π(i) − π(i + 1)) · (4 + π(i) + π(i + 1)),

i=1

where π(i) denotes the ith element of the permutation. Suppose that M is the maximum possible value of S(π) over all permutations π of the integers from 1 to 10. Determine the number of permutations π for which S(π) = M . Answer. 40320 . Solution. The sum telescopes, giving us an answer of 8! = 40320. This problem was proposed by Ray Li. 25. Positive integers x, y, z ≤ 100 satisfy 1099x + 901y + 1110z = 59800 109x + 991y + 101z = 44556 Compute 10000x + 100y + z. Answer. 34316 . Solution. Subtracting the first equation from 11 times the second, we obtain 100x + 10000y + z = 430316. Since x, y, z ≤ 100 this implies (x, y, z) = (3, 43, 16), so 10000x + 100y + z = 34316. Solution 2. Taking the equations modulo 100, we obtain −x + y + 10z ≡ 0 (mod 100) and 9x − 9y + z ≡ 56 (mod 100), whence 91z ≡ 56 (mod 100). But 9 · 11 = 99 ≡ −1 (mod 100) means z ≡ 11 · 91z ≡ 11 · 56 ≡ 16 (mod 100), so z = 16. On the other hand, subtracting the former from 10 times the latter gives −9x + 9009y − 100z = 385760, so 385760 + 1600 + 9 ≤ 9009y ≤ 385760 + 1600 + 900 =⇒ y = 43, since 1 ≤ x, y, z ≤ 100 are positive integers (observe that 9009 · 43 = 387387). Finally, x ≡ y + 10z ≡ 43 + 60 ≡ 3 (mod 100), so (x, y, z) = (3, 43, 16) and 10000x + 100y + z = 34316.

January 2013

Winter OMO 2012-2013

Page 7

This problem was proposed by Evan Chen. The second solution was given by Victor Wang. 26. In triangle ABC, F is on segment AB such that CF bisects ∠ACB. Points D and E are on line CF such that lines AD, BE are perpendicular to CF . M is the midpoint of AB. If M E = 13, AD = 15, and BE = 25, find AC + CB. Answer. 104 . Solution. Note that 4BEF is similar to 4ADF , with scale factor 5 to 3. If we let EF = 5a, then DF = 3a. Also note that 4ADC is similar to factor 5 to 3. Since DE = 8a, √ 4BEC, with scale √ 2 + 25 and BF = 5 a2 + 25. Also by Pythagorean a CD = 12a. By Pythagorean theorem, AF = 3 √ theorem, AE = 64a2 + 125. By Stewart’s theorem on triangle AEB using M E, AM , and BM as sides in the calculation, we have (letting AM = BM = x) 625x + (64a2 + 225)x = 2x · x · x + 2x · 169, √ √ so 850 + 64a2 √ = 2x2 + 338 and x = 4 2a2 + 16. So 2x = AB = 8 2a2 + 16 but this also equals AF + BF or 8 a2 + 25 so equating them we get a = 3 and AC = 39, BC = 65 so the answer is then 104. This problem was proposed by Ray Li. 27. Geodude wants to assign one of the integers 1, 2, 3, . . . , 11 to each lattice point (x, y, z) in a 3D Cartesian coordinate system. In how many ways can Geodude do this if for every lattice parallelogram ABCD, the positive difference between the sum of the numbers assigned to A and C and the sum of the numbers assigned to B and D must be a multiple of 11? (A lattice point is a point with all integer coordinates. A lattice parallelogram is a parallelogram with all four vertices lying on lattice points. Here, we say four not necessarily distinct points A, B, C, D form a parallelogram ABCD if and only if the midpoint of segment AC coincides with the midpoint of segment BD.) Answer. 14641 . Clarifications. • The “positive difference” between two real numbers x and y is the quantity |x − y|. Note that this may be zero. • The last sentence was added to remove confusion about “degenerate parallelograms.” Solution. Let f (x, y, z) be the number written at (x, y, z), and g(x, y, z) = f (x, y, z) − f (0, 0, 0). Then considering all parallelograms ABCD with A = (0, 0, 0), we get 11 | g(x1 + x2 , y1 + y2 , z1 + z2 ) − g(x1 , y1 , z1 ) − g(x2 , y2 , z2 ) for all integers x1 , y1 , . . . , z2 . But then it’s not hard to prove g(x, y, z) ≡ xg(1, 0, 0) + yg(0, 1, 0) + zg(0, 0, 1)

(mod 11)

for all integers x, y, z. (Try it!) On the other hand, any choice of f (0, 0, 0), g(1, 0, 0), g(0, 1, 0), and g(0, 0, 1) yields a distinct working assignment f (Why?), so the desired answer is 114 = 14641. This problem was proposed by Victor Wang.

January 2013

Winter OMO 2012-2013

Page 8

28. Let S be the set of all lattice points (x, y) in the plane satisfying |x| + |y| ≤ 10. Let P1 , P2 , . . . , P2013 be a sequence of 2013 (not necessarily distinct) points such that for every point Q in S, there exists at least one index i such that 1 ≤ i ≤ 2013 and Pi = Q. Suppose that √ the minimum possible value of |P1 P2 | + |P2 P3 | + · · · + |P2012 P2013 | can be expressed in the form a + b c, where a, b, c are positive integers and c is not divisible by the square of any prime. Find a + b + c. (A lattice point is a point with all integer coordinates.) Answer. 222 . Clarifications. • k = 2013, i.e. the problem should read, “. . . there exists at least one index i such that 1 ≤ i ≤ 2013 . . . ”. An earlier version of the test read 1 ≤ i ≤ k. Solution. More generally, let Sn be the set of all lattice points (x, y) such that |x| + |y| ≤ n. Color (x, y) black if x + y − n is even and white otherwise. Notice that there are (n + 1)2 black points and n2 white points, so there are at least 2n segments in this broken line that go from a black point to a √ black point, and the length of each such segment √ is at least 2. There are 2n2 + 2n total segments, so the length of the broken line is at least 2n2 + 2n 2. The construction is not hard to find (basically a spiral). This problem was proposed by Anderson Wang. 29. Let φ(n) denote the number of positive integers less than or equal to n that are relatively prime to n, and let d(n) denote the number of positive integer divisors of n. For example, φ(6) = 2 and d(6) = 4. Find the sum of all odd integers n ≤ 5000 such that n | φ(n)d(n). Answer. 2903 . Solution. Note 38 > 5000, so all primes dividing n are at most 8 and thus 3, 5, or 7. Doing casework on the set of primes (hardest part is 36 · 7 = 5103 > 5000) we get 1 + 32 + 35 + 54 + 34 · 52 . This problem was proposed by Alex Zhu. 30. Pairwise distinct points P1 , P2 , . . . , P16 lie on the perimeter of a square with side length 4 centered at O such that |Pi Pi+1 | = 1 for i = 1, 2, . . . , 16. (We take P17 to be the point P1 .) We construct points Q1 , Q2 , . . . , Q16 as follows: for each i, a fair coin is flipped. If it lands heads, we define Qi to be Pi ; otherwise, we define Qi to be the reflection of Pi over O. (So, it is possible for some of the Qi to −−→ −−→ −−−→ coincide.) Let D be the length of the vector OQ1 + OQ2 + · · · + OQ16 . Compute the expected value of D2 . Answer. 88 . Solution. What’s generalizes!

P (±a ± b ± c)2 over all 23 = 8 choices of signs depends only on a2 + b2 + c2 . This

This problem was proposed by Ray Li. 31. Beyond the Point of No Return is a large lake containing 2013 islands arranged at the vertices of a regular 2013-gon. Adjacent islands are joined with exactly two bridges. Christine starts on one of the islands with the intention of burning all the bridges. Each minute, if the island she is on has at least one bridge still joined to it, she randomly selects one such bridge, crosses it, and immediately burns it. Otherwise, she stops. If the probability Christine burns all the bridges before she stops can be written as prime positive integers m and n, find the remainder when m + n is divided by 1000. Answer. 113 .

m n

for relatively

January 2013

Winter OMO 2012-2013

Page 9

Solution. We either cycle through the whole 2013-gon first (after which Christine will automatically succeed) or “retrace” first right after passing through k ∈ [1, 2012] bridges. In the first case we have a probability of (4/4)(2/3)2012 (2/2)(1/1)2012 = (2/3)2012 ; in the second we have (4/4)(2/3)k−1 (1/3)(1/1)k−1 (2/2)(2/3)2012−k (1/1)2013−k = (1/3)(2/3)2011 . Summing up we get 1007(2/3)2012 so m = 1007 · 22012 and n = 32012 (since 3 - 1007). Our answer is thus 1007 · 22012 + 32012 ≡ 7 · 212 + 312 ≡ 113 (mod 1000). (To speed up calculations, we can work mod 8 and mod 125 first and then use CRT.) This problem was proposed by Evan Chen. 32. In 4ABC with incenter I, AB = 61, AC = 51, and BC = 71. The circumcircles of triangles AIB and AIC meet line BC at points D (D 6= B) and E (E 6= C), respectively. Determine the length of segment DE. Answer. 41 . Solution. Angle chasing gives 4IDC ∼ = 4IAC, so CA = CD and similarly, BA = BE. Thus DE = BE + CD − BC = AB + AC − BC = 41. Comment. I is the circumcenter of 4ADE, and D, E always lie on the same side of line AI as B, C, respectively. This gives us another way to define D, E. This problem was proposed by James Tao. 33. Let n be a positive integer. E. Chen and E. Chen play a game on the n2 points of an n × n lattice grid. They alternately mark points on the grid such that no player marks a point that is on or inside a non-degenerate triangle formed by three marked points. Each point can be marked only once. The game ends when no player can make a move, and the last player to make a move wins. Determine the number of values of n between 1 and 2013 (inclusive) for which the first player can guarantee a win, regardless of the moves that the second player makes. Answer. 1007 . Solution. If n is odd, the first player should take the center square. Then for the second player’s move, the first player should choose the reflection across the center square. It is clear that this will not be in the convex hull of the chosen points. So here the first player always wins. If n is even, then the second player should take the reflection across the center square. So the second player always win in this case. The answer is thus 1007. This problem was proposed by Ray Li. This solution was given by Yang Liu. 34. For positive integers n, let s(n) denote the sum of the squares of the positive integers less than or equal to n that are relatively prime to n. Find the greatest integer less than or equal to X s(n) , n2

n|2013

where the summation runs over all positive integers n dividing 2013.

January 2013

Winter OMO 2012-2013

Page 10

Answer. 671 . Solution. We have X s(n) n|N

n2

=

12 + 2 2 + · · · + N 2 (N + 1)(2N + 1) = . N2 6N

Pn/d Solution 2. For d | n, let f (n, d) equal k=1 (dk)2 = Then by PIE, we have X s(n) = (−1)ω(d) f (n, d)

n(n+d)(2n+d) 6d

if d is square-free and 0 otherwise.

d|n

   Y n Y 1  = (1 − p) + 3n(0) + 2n2 1− 6 p p|n

p|n

n2 nY (1 − p) + φ(n) = 6 3 p|n

for n > 1 (if n = 1 the 3n term doesn’t cancel out, so we instead have s(1) = 1), where ω(m) denotes the number of distinct prime factors of m. It follows that X s(d) d|n

d2

1 X 1 X 1Y φ(d) + (1 − p) 3 6 d 1
p|n

1 n+2 1 − + 3 6 6n 2n2 + 3n + 1 = 6n (n + 1)(2n + 1) = 6n n 1 1 = + + . 3 2 6n

=

Since 3 | 2013, the floor of this quantity is

2013 3

= 671.

This problem was proposed by Ray Li. The second solution was found by a rock. 35. The rows and columns of a 7 × 7 grid are each numbered 1, 2, . . . , 7. In how many ways can one choose 8 cells of this grid such that for every two chosen cells X and Y , either the positive difference of their row numbers is at least 3, or the positive difference of their column numbers is at least 3? Answer. 51 . Clarifications. • The “or” here is inclusive (as by convention, despite the “either”), i.e. X and Y are permitted if and only if they satisfy the row condition, the column condition, or both.

January 2013

Winter OMO 2012-2013

Page 11

Solution. This bijects to the number of ways of placing 8 nonintersecting 3 × 3 squares in a 9 × 9 grid. 3-color the columns A, B, C, A, . . .. Label the 9 × 9 grid with (i, j) (row i, column j). If we don’t have (i, j) ≡ (2, 2) (mod 3), we can get a lot of restrictions. Identify squares by centers. For stuff symmetric (under rotation or reflection) to (3, 3), (3, 4), (4, 3), (4, 4) we can’t have any squares (or else we kill at least 4 A’s; for the symmetric squares we just rotate/reflect the 3-coloring as needed). We now show that in every working configuration, at least two rows or two columns of {2, 5, 8}×{2, 5, 8} are filled out* (and these all trivially work, so it reduces to PIE). If all squares are (2, 2) (mod 3) this is obvious. Otherwise up to rotation/reflection at least one of (2, 3), (2, 4), (5, 3), (5, 4) is used. If we have (2, 3) or (2, 4) then we kill 3 A’s, which forces all other A’s to be used, so focusing on edges and corners progressively we get (5, 2) =⇒ (8, 2), (5, 5) =⇒ (8, 5) =⇒ (8, 8) =⇒ (5, 8) so {5, 8} × {2, 5, 8} are filled out, as desired. If we have (5, 3) or (5, 4) then it’s similar; we kill 3 A’s which forces (2, 2) =⇒ (2, 5) =⇒ (2, 8) and also (8, 2) =⇒ (8, 5) =⇒ (8, 8), so {2, 8} × {2, 5, 8} are  filled out. By PIE the answer is 2 · 3 (9−2)−2 = 60 minus the number of guys with all squares (2, 2) 2 (mod 3), so 60 − 9 = 51. *One may also draw a 3 × 3 subgrid and note that if a 3 × 3 square contains part of a boundary line in its interior, say in the ith row, then if i = 1 or i = 3, the ith row of the 3 × 3 subgrid intersects at most 1 other 3 × 3 square. On the other hand, if i = 2, we can show that the first or third column must have such a line instead. (Why?) This problem was proposed by Ray Li. 36. Let ABCD be a nondegenerate isosceles trapezoid with integer side lengths such that BC k AD and AB = BC = CD. Given that the distance between the incenters of triangles ABD and ACD is 8!, determine the number of possible lengths of segment AD. Answer. 337 . Solution. Darn apparently you can bash this, and you don’t need the observation that the incenters are on the diagonals, but i think the NT part is still nice, because the bound that AB · 3 > AD makes the counting work out perfectly. We get 8! = AD − AB+AD−BD − DC+DA−AC = BD − AB. Let x = AB = BC = CD and y = AD; 2 2 p 2 then BD = x + xy. The requirement 3x > y eventually reduces everything to x | 8!2 = 214 34 52 72 = 337. such that x > 8!, so the answer is 15·5·3·3−1 2 This problem was proposed by Ray Li. 37. Let M be a positive integer. At a party with 120 people, 30 wear red hats, 40 wear blue hats, and 50 wear green hats. Before the party begins, M pairs of people are friends. (Friendship is mutual.) Suppose also that no two friends wear the same colored hat to the party. During the party, X and Y can become friends if and only if the following two conditions hold: a) There exists a person Z such that X and Y are both friends with Z. (The friendship(s) between Z, X and Z, Y could have been formed during the party.) b) X and Y are not wearing the same colored hat. Suppose the party lasts long enough so that all possible friendships are formed. Let M1 be the largest value of M such that regardless of which M pairs of people are friends before the party, there will always be at least one pair of people X and Y with different colored hats who are not friends after the party. Let M2 be the smallest value of M such that regardless of which M pairs of people are friends before the party, every pair of people X and Y with different colored hats are friends after the party. Find M1 + M2 .

January 2013

Winter OMO 2012-2013

Page 12

Answer. 4749 . Clarifications. • The definition of M2 should read, “Let M2 be the smallest value of M such that. . . ”. An earlier version of the test read “largest value of M ”. Solution. View as a tripartite graph with components of size 30, 40, 50. The condition just means that connected components are preserved and become complete at the end (i.e. with all edges filled in). For M = 30 + 40 + 50 − 1 we would be able to find a spanning tree of the complete tripartite graph (where every two edges are connected/people are friends). Furthermore, any connected graph on 120 vertices has at least 119 edges (achieved by a tree), so M1 = 118. On the other hand, the largest connected component (in terms of edges) not containing all vertices has (50 − 1) · 40 + (50 − 1) · 30 + 40 · 30 = 4630 edges, whence M2 = 4631. Thus M1 + M2 = 4749. This problem was proposed by Victor Wang. 38. Triangle ABC has sides AB = 25, BC = 30, and CA = 20. Let P, Q be the points on segments AB, AC, respectively, such that AP = 5 and AQ = 4. Suppose lines BQ and CP intersect at R and the circumcircles of 4BP R and 4CQR intersect at a second point S 6= R. If the length of segment SA can be expressed in the form √mn for positive integers m, n, where n is not divisible by the square of any prime, find m + n. Answer. 166 . Solution. Let t = 51 . Invert about A with power R2 = tAB · AC = AQ · AB = AP · AC (i.e. radius R) and reflect about the angle bisector of ∠BAC to get C 0 = P , Q0 = B, B 0 = Q, P 0 = C. Since R2 R2 (ABSQ) and (ACSP ) are cyclic, S 0 = B 0 Q0 ∩ C 0 P 0 = QB ∩ P C = R. Thus AS = AS 0 = AR . By Ceva’s theorem, R ∈ AM where M is the midpoint of BC. Yet Menelaus yields RA M B CP AR PQ 2t = 1 =⇒ =2 = . M A CB RP AM P Q + BC t+1 But it’s well-known that 4AM 2 + a2 = 2(b2 + c2 ), so SA =

tbc 2t 1+t AM

= (1 + t)

bc 6 (5 · 5)(5 · 4) (5)(4) 120 = p = 6p =√ , 2 2 2 2AM 5 2(5 · 5)2 + 2(5 · 4)2 − (5 · 6)2 46 2(5) + 2(4) − 6

giving us an answer of 120 + 46 = 166. Comment. Inspired by 2009 Balkan Math Olympiad Problem 2. We can also use complex numbers (based on spiral similarity). This problem was proposed by Victor Wang. 39. Find the number of 8-digit base-6 positive integers (a1 a2 a3 a4 a5 a6 a7 a8 )6 (with leading zeros permitted) such that (a1 a2 . . . a8 )6 | (ai+1 ai+2 . . . ai+8 )6 for i = 1, 2, . . . , 7, where indices are taken modulo 8 (so a9 = a1 , a10 = a2 , and so on). Answer. 40 .

January 2013

Winter OMO 2012-2013

Page 13

Solution. Call such an integer good ; then n = (a1 a2 . . . a8 )6 is good if and only if n | gcd(a1 , a2 , . . . , a8 )(68 − 1). (Why?) Call a good number with gcd of digits equal to 1 primitive. Now note that 68 − 1 = (6 − 1)(6 + 1)(62 + 1)(64 + 1) and 6 − 1, 6 + 1, 62 + 1, 64 + 1 are all prime, so every positive divisor d of 68 − 1 has all ones and zeros if 6 − 1 = 5 - d and all five and zeros if 8 −1 6 − 1 = 5 | d. (Prove this—think binary!) But 66−1 has exactly 23 = 8 positive divisors, so there are exactly 8 primitive good numbers. Furthermore, these 8 numbers have digits all equal to 0 or 1, so we can establish a 1-to-5 correspondence between the set of primitive good numbers and the set of good numbers (each primitive one corresponds to its first 5 multiples). Hence there are exactly 8 · 5 = 40 good numbers. Comment. Inspired by http://en.wikipedia.org/wiki/Cyclic_number. This problem was proposed by Victor Wang. 40. Let ABC be a triangle with AB = 13, BC = 14, and AC = 15. Let M be the midpoint of BC and let Γ be the circle passing through A and tangent to line BC at M . Let Γ intersect lines AB and AC at points D and E, respectively, and let N be the midpoint of DE. Suppose line M N intersects lines AB and AC at points P and O, respectively. If the ratio M N : N O : OP can be written in the form a : b : c with a, b, c positive integers satisfying gcd(a, b, c) = 1, find a + b + c. Answer. 225 . N P OA ED P OA CB Solution. Menelaus on 4M OC and 4N OE give M OP CA M B = 1 and OP EA N D = 1, respectively; CA MP CA CA2 MO BA P dividing yields M N P = EA , whence power of a point gives M N = CE = CM 2 . Similarly, M N = BD = 2 BA 2 2 2 2 2 BM 2 . It’s now easy to compute M N : N O : OP = a : 4c − a : 4b − 4c = 49 : 120 : 56.

This problem was proposed by James Tao. 41. While there do not exist pairwise distinct real numbers a, b, c satisfying a2 + b2 + c2 = ab + bc + ca, there do exist complex numbers with that property. Let a, b, c √ be complex√numbers such that a2 + b2 + c2 = ab + bc + ca and |a + b + c| = 21. Given that |a − b| = 2 3, |a| = 3 3, compute |b|2 + |c|2 . Clarifications. • The problem should read |a + b + c| = 21. An earlier version of the test read |a + b + c| = 7; that value is incorrect. • |b|2 + |c|2 should be a positive integer, not a fraction; an earlier version of the test read “. . . for relatively prime positive integers m and n. Find m + n.” Answer. 132 . Solution. Equilateral triangle 4abc exists if and only if the center g = a+b+c exists. More precisely, 3 √ √ 2 3 the condition on (a, g) is that |a| = 3 3, |g| = 7, and |g − a| = 2 cos 30◦ = 2. By the triangle inequality, √ √ this can happen if and only if |3 3 − 7| ≤ 2 ≤ 3 3 + 7, which is indeed true. Now that we’ve proven existence, note that a, b, c form the vertices of an equilateral triangle, so |a − b| = |b − c| = |c − a|, whence √ 3(|a|2 + |b|2 + |c|2 ) = |a − b|2 + |b − c|2 + |c − a|2 + |a + b + c|2 = 3(2 3)2 + 212 = 477. √ 2 Thus |b|2 + |c|2 = 477 3 − (3 3) = 132. Comment. A straightforward way to prove that a, b, c form the vertices of an equilateral triangle in the complex plane is to use the quadratic formula. (Try it!) Otherwise, it’s rather difficult to discover the factorization (a + bω + cω 2 )(a + bω 2 + cω) of a2 + b2 + c2 − ab − bc − ca, where ω is a primitive third root of unity.

January 2013

Winter OMO 2012-2013

Page 14

This problem was proposed by Ray Li. 42. Find the remainder when

100 Y

(1 − i2 + i4 )

i=0

is divided by 101. Answer. 9 . Solution. Let ω = e2πi/12 and z = e2πi/100 ; the key idea is that the symmetric sums of (x − g)(x − g 2 ) · · · (x − g 100 ) and (x − z)(x − z 2 ) · · · (x − z 100 ) are congruent mod 101, so the product is congruent mod 101 to the result (an integer) of 100 Y

(z 4j − z 2j + 1) =

j=1

100 Y

(z j − ω)(z j − ω 5 )(z j − ω 7 )(z j − ω 11 ).

j=1

Using the factorization of x100 − 1, this boils down to (ω 100 − 1)(ω 500 − 1)(ω 700 − 1)(ω 1100 − 1) = (ω 4 − 1)2 (ω 8 − 1)2 = 32 , since ω 4 , ω 8 are the two primitive 3rd roots of unity. Solution 2. Primitive roots suffice. Let g be a primitive root modulo 101. Then, the product can be written in the form Y i6 + 1 1≤i≤100 i2 6≡−1 (mod 101)

i2 + 1

Now because g 100 = 1, we can show that the multisets {i6 | 1 ≤ i ≤ 100} and {i2 | 1 ≤ i ≤ 100} are equivalent modulo 101. If we delete the elements −1 (which each appear twice) from both, the sets are still the same; in particular, their products are the same. Finally, this product is not zero. So, in our original product, almost all of the numerator and denominator cancel out except for the zeros, which we handle manually: 106 + 1 906 + 1 · = (104 − 102 + 1)(904 − 902 + 1) ≡ 3 · 3 = 9 102 + 1 902 + 1

(mod 101).

This problem was proposed by Victor Wang. The second solution was given by Evan Chen. 43. In a tennis tournament, each competitor plays against every other competitor, and there are no draws. Call a group of four tennis players “ordered” if there is a clear winner and a clear loser (i.e., one person who beat the other three, and one person who lost to the other three.) Find the smallest integer n for which any tennis tournament with n people has a group of four tennis players that is ordered. Answer. 8 . Solution. First note that a group of four is “ordered” iff it’s transitive iff it’s acyclic (this follows more generally from the fact that if we contract all maximal directed cycles in a tournament, we get a transitive graph–Prove it!). The answer is 8. For n = 7, we can take the tournament described in the last paragraph here (which also happens to be a counterexample for k = 2 here—BTW, check out HroK’s blog if you have not seen it before)—vertices are residues mod 7, and x → {x + 1, x + 2, x + 4} give us the edges. For any vertex v, its out-neighbors v + 1, v + 2, v + 4 form a triangle, which means there’s no transitive set of four vertices. For n = 8 there exists a vertex with at least 8−1 = 3.5 2

January 2013

Winter OMO 2012-2013

Page 15

out-neighbors and thus some v has out-degree at least 4. But every 4-tournament has at least one transitive set of 3 vertices (else all 3-cycles), so we’re done. Comment. As Andre Arslan notes, the construction for n = 7 is unique up to isomorphism. You have to have two disjoint 3-cycles (take any 3-cycle out to leave four vertices, and there must be another 3-cycle among them). Because the sum of all out-degrees is 21 and nothing has out-degree 4, all outdegrees are 3. Now WLOG pick a vertex in a 3-cycle and two vertices in the other 3-cycle, so that the first of the three picked vertices beats the other two, but loses to the vertex in the other 3-cycle not picked. The edge relationships between the 3-cycles can now be completely determined (it’s pretty easy to do out, there isn’t really any casework) by looking at different groups of four in the group of six vertices alone. The directions of edges adjacent to the seventh vertex are then easily determined as well. This problem was proposed by Ray Li. 44. Suppose tetrahedron P ABC has volume 420 and satisfies AB √ = 13, BC = 14, and CA = 15. The minimum possible surface area of P ABC can be written as m+n k, where m, n, k are positive integers and k is not divisible by the square of any prime. Compute m + n + k. Answer. 346 . Solution. Heron’s formula implies [ABC] = ume condition gives

p

21(21 − 13)(21 − 14)(21 − 15) = 84, whence the vol-

h [ABC] = 28h =⇒ h = 15, 3 where h denotes the length of the P -altitude in tetrahedron P ABC. 420 = V (P ABC) =

Let Q be the projection of P onto plane ABC and let 4XY Z be the pedal triangle of Q with respect to 4ABC (so X is the foot from Q to BC, etc.). Now define x, y, z to be the directed lengths QX, QY, QZ, respectively, so that x > 0 when Q and A are on the same side of BC and x < 0 otherwise (likewise for y, z). Observe that the only constraint on x, y, z is ax + by + cz = 2[ABC] = 168, because if reals x, y, z satisfy ax + by + cz = 168, there exists a point Q in plane ABC with x = QX, y = QY , z = QZ. As T varies along line BC, P T is minimized at T = X (Why?), so P X √ √ ⊥ BC and similarly, P Y ⊥ CA and P Z ⊥ AB. If we define the convex function f (t) = t2 + h2 = t2 + 152 for real t, then P X = f (x), P Y = f (y), and P Z = f (z). Thus the surface area of tetrahedron P ABC is just [ABC] +

af (x) + bf (y) + cf (z) , 2

which by weighted Jensen is at least 1 [ABC] + (a + b + c)f 2 with equality at x = y = z =

168 a+b+c



ax + by + cz a+b+c



√ = 84 + 21f (4) = 84 + 21 241,

= 4.

This problem was proposed by Ray Li. 45. Let N denote the number of ordered 2011-tuples of positive integers (a1 , a2 , . . . , a2011 ) with 1 ≤ a1 , a2 , . . . , a2011 ≤ 20112 such that there exists a polynomial f of degree 4019 satisfying the following three properties: • f (n) is an integer for every integer n; • 20112 | f (i) − ai for i = 1, 2, . . . , 2011; • 20112 | f (n + 2011) − f (n) for every integer n.

January 2013

Winter OMO 2012-2013

Page 16

Find the remainder when N is divided by 1000. Answer. 211 . Solution. Throughout this proof, we will use finite differences and Newton interpolation. (See Lemma 1 in the first link for a complete proof.) Note that p = 2011 is prime. We will show more generally that when we replace 4019 by 2p − 3 and 20112 by p2 , there are p2p−1 such p-tuples.   2p−2 Lemma. If p is a prime, the congruence (−1)k p ≡ (−1)p−1 2p−2 (mod p2 ) holds for k = k+p − k 0, 1, . . . , p − 1. Proof. Expand. Corollary. The 2p − 2th finite differences of the p-periodic sequence b = (b0 , b1 , b2 , . . .) all vanish if and only if p | b1 + b2 + · · · + bp . Proof. By the lemma, ∆

2p−2

2p−2 X

  p−1 X 2p − 2 [b]j = (−1) bj+i ≡ −p bj+i i i=0 i=0 i

(mod p2 )

for fixed j ≥ 0. Extend the indices of the ai modulo p so that ai = ai (mod p) for all integers i. Since f (x) satisfies the three properties if and only if f (x) + p2 x2p−3 does, we just have to find the number of p-tuples interpolated by a polynomial of degree at most 2p − 3. By Newton interpolation, this is possible if and only if the 2p − 2th finite differences of the infinite (periodic) sequence a = (a0 , a1 , a2 , . . .) all vanish modulo p2 . By the Lemma, this occurs when and only when p | a1 + a2 + · · · + ap , so the answer is     1 2 p 21 21 (p ) = p2p−1 = 20114021 ≡ 1121 ≡ 1 + 10 + 102 ≡ 211 (mod 1000). p 1 2 Solution 2. A more conceptual solution can be found by relating (x−1)d+1 (a0 +a1 x+· · ·+ap−1 xp−1 ) modulo p2 , xp − 1 to the “interpolating polynomials” of the p-tuple (a1 , a2 , . . . , ap ). If (x − 1)2p−2 ≡ m(1 + x + · · · + xp−1 ) in this modulus, it’s not hard to prove vp (m) = 1. The idea is that 4020 is the smallest integer such that (x − 1)4020+1 vanishes mod 20112 , x2011 − 1, so you note that the interpolating polynomials of degree 4020 for (1, 0, . . . , 0), (0, 1, . . . , 0), etc., say G1 , G2 , . . . , Gp (2011 places for the 1, all  else 0) all have the same “Newton interpolation leading x coefficient” (i.e. the coefficient of 4020 , or the 4020th finite difference), with 2011-adic valuation exactly 1. Indeed, for (p, 0, . . . , 0), the least interpolating degree is lower than the maximum of 4020 (by induction, considering the mod p, xp − 1 problem instead of mod p2 , xp − 1), so this gives us vp = 1, and of course, the 4020th finite differences of Gi all have to be equal since 4021th vanish always. So we have degree 4020 exactly when 2011 - a1 + · · · + a2011 , so the answer is (1 − 1/p)(p2 )p . Comment. See this thread and its resolution on MathOverflow for the original context of this problem. i i Pj i )−1 ≡ (−p)j−1 (mod pj ), which for j = 2 is The author conjectures that k=0 (−1)kp p +(j−1)φ(p kpi stronger than the vp = 1 condition mentioned in the second solution (it gives the exact value mod p2 ). For higher j the reader can check this is stronger than the corresponding vp = j − 1. This problem was proposed by Victor Wang.

January 2013

Winter OMO 2012-2013

Page 17

46. Let ABC be a triangle with ∠B − ∠C = 30◦ . Let D be the point where the A-excircle touches line BC, O the circumcenter of triangle ABC, and X, Y the intersections of the altitude from A with the AO incircle with X in between A and Y . Suppose points A, O and D are collinear. If the ratio AX can be √ a+b c expressed in the form d for positive integers a, b, c, d with gcd(a, b, d) = 1 and c not divisible by the square of any prime, find a + b + c + d. Answer. 11 . Solution. The angle condition is equivalent to ∠ADB = 60◦ . Let H be the orthocenter, I the incenter, and E the tangency point of BC and the incircle (I); reflect E over E 0 to get I. By the well-known homothety about A taking (I) to the A-excircle, we see that A, E 0 , D are collinear. Thus AE 0 OD is the A-isogonal of AXHY , so AE 0 = AE. Since E 0 IE ⊥ BC ⊥ AXHY and ∠DAH = 30◦ , ∠AE 0 I = 150◦ and since IX = IE 0 , 4AXI ∼ = 4AE 0 I, whence ∠AXI = 150◦ and thus AXIE 0 is a rhombus. Now note that OE = OD, so O is the midpoint of E 0 D in right triangle 4E 0 ED. But I is the midpoint of E 0 E, so ∠OIE 0 = 90◦ and it follows that √ AO OE 0 1 3+2 3 AO = =1+ =1+ = . AX AE 0 IE 0 sin 60◦ 3 Solution 2. Let AD meet the incircle ω at X 0 , and recall that X 0 I is a diameter of ω. Let the inradius be r and the circumradius R. Note that since ∠BAY = ∠DAC = 90 − B, we can derive that ∠XAX 0 = 30◦ and AX = AX 0 . Then, note also that O is the midpoint of X 0 D. Using the angle information, we find that IO = √r3 . Observe OA = OB = R.   √ √ Assume WLOG that r = 3. Now, set I = (−1, 0), O = (0, 0), A = − R2 , 23R and B = √ √  √ − R2 − 3, − 3 . We need AB to be tangent to ω; that is, the distance from I to AB is r = 3. A few pages of calculation yield the quartic R4 − 11R2 −√12R + 4 = 0, which has a double root at −2 and gives (R + 2)2 (R2 − 4R + 1) = 0, which gives R = 3 + 2 as the only valid solution. Then,

AO AX 0

=

R R− √23 r

=

√ 2+ √ 3 3

=

√ 2 3+3 . 3

Solution 3. (Sketch) It’s possible to find a trigonometric solution with only the synthetic observation 0 s−a r AE = AE 0 . Indeed, we can use the homothety relation AE and the law of sines on AD = ra = s 4ADC to get everything in terms of trigonometric functions involving C. Using the sine and cosine addition and subtraction formulas a few times, we can get an equation in terms of cos 2x and cos x, where x = C + 15◦ = 90◦ − A2 . This problem was proposed by James Tao. The second solution was provided by Evan Chen. The third solution was provided by Victor Wang. 47. Let f (x, y) be a function from ordered pairs of positive integers to real numbers such that f (1, x) = f (x, 1) =

1 x

and f (x + 1, y + 1)f (x, y) − f (x, y + 1)f (x + 1, y) = 1

for all ordered pairs of positive integers (x, y). If f (100, 100) = integers m, n, compute m + n. Answer. 111088900001 .

m n

for two relatively prime positive

January 2013

Winter OMO 2012-2013

Page 18

Solution. We can easily prove by induction that f (x, y) =

1+4

x+1 3



y+1 3



xy

for all positive integers x, y. It quickly follows that f (100, 100) =

1+111100·999900 . 10000

Comment. Perhaps the most natural way to find the pattern is to find f for small fixed values of y (say 0 through 3). When searching for the pattern, it is helpful to substitute g(x, y) = xyf (x, y). This problem was proposed by David Yang. 48. ω is a complex number such that ω 2013 = 1 and ω m 6= 1 for m = 1, 2, . . . , 2012. Find the number of ordered pairs of integers (a, b) with 1 ≤ a, b ≤ 2013 such that (1 + ω + · · · + ω a )(1 + ω + · · · + ω b ) 3 is the root of some polynomial with integer coefficients and leading coefficient 1. (Such complex numbers are called algebraic integers.) Answer. 4029 . Solution. We will repeatedly use the fact that the set AI of algebraic integers is closed under addition and multiplication (in other words, AI is a ring). First, however, we show that (1 + ω + · · · + ω a )(1 + ω + · · · + ω b ) 3 must in fact be an algebraic integer for every primitive 2013th root (if it is for at least one)1 . Actually, we can prove a much more general statement. Lemma 1. Let z be an algebraic number with minimal polynomial f ∈ Q[x] of degree n ≥ 1 (so that f is monic). Suppose f has roots z1 = z, z2 , . . . , zn (these are the conjugates of z). If there exists a polynomial g ∈ Q[x] for which g(z) ∈ AI, then g(zi ) ∈ AI for i = 1, 2, . . . , n. Proof. Let h ∈ Q[x] be the minimal polynomial of g(z); then h (which is monic) has integer coefficients since g(z) ∈ AI. Since h(g(x)) has rational coefficients and h(g(z)) = 0, the minimal polynomial f (x) of z must divide h(g(x)). But then h(g(zi )) = 0 for all i (the zi are the roots of f by definition), so g(zi ) ∈ AI for all i (the roots of h(x) are all algebraic integers by definition). For a slightly different (but really equivalent) perspective, consider the map fi : Q(z) → Q(zi ) that fixes the rationals, is multiplicative and additive, and maps z to zi ; then fi is a ring isomorphism (because z and zi have the same minimal polynomial). In particular, since fi fixes the coefficients of g and h, we have 0 = fi (0) = fi (h(g(z))) = h(g(fi (z))) = h(g(zi )) = 0, whence zi is also a root of h(g(x)). See the second post here for a more “concrete” application of these ideas. Lemma 2. The nth cyclotomic polynomial Φn (x) evaluated at 1 gives 0 for n = 1, p for n = pk a prime power, and 1 otherwise. 1 For

contest purposes, this can actually just be deduced by meta-analysis of the problem statement.

January 2013

Winter OMO 2012-2013

Page 19

Q Q Proof. From d|n Φd (x) = xn − 1, we get 1 1, Φn (1) 6= 0 since 1 is not a primitive nth root of unity.) Corollary. If n has at least two distinct prime factors, 1 − ζ is an “invertible” algebraic integer for any primitive nth root of unity ζ. Proof. First suppose n has at least two distinct prime factors. Clearly 1 − ζ is an algebraic integer. On the other hand, Lemma 2 gives us Φn (x) = (x − 1)f (x) + 1 for some polynomial f ∈ Z[x], so plugging in x = ζ gives (1 − ζ)−1 = f (ζ), which is indeed an algebraic integer (as f has integer coefficients). The corollary tells us that for a fixed 2013th primitive root of unity ω, (1 + ω + · · · + ω a )(1 + ω + · · · + ω b ) ∈ AI 3 if and only if

(1−ω a+1 )(1−ω b+1 ) 3

∈ AI is too. From now on we work with this simpler form.

If 2013 | a + 1 or 2013 | b + 1, the expression vanishes and is trivially an algebraic integer, so now suppose 2013 - a + 1 and 2013 - b + 1. Multiplying the new expression over all 2013th primitive roots of unity shows that Y 3−φ(2013) (1 − e2πk(a+1)i/2013 )(1 − e2πk(b+1)i/2013 ) 0
must be both a rational number (Why?) and an algebraic integer, and thus a “rational” integer by the rational root theorem (*). On the other hand, Y (1 − e2πk(a+1)i/2013 ) = (Φc (1))φ(2013)/φ(c) , 0
where c = 2013/ gcd(2013, a + 1) > 1 by our assumption 2013 - a + 1 (similarly define d > 1 in terms of b). However, since 2013 is square-free, and φ(c), φ(d) ≥ 2 (since c, d > 1 and c, d | 2013), Lemma 2 forces c = d = 3, or else we contradict (*) (as we fail to cancel out the factors of 3 earlier). To prove that the expression is an algebraic integer whenever c = d = 3, we note the identities 2 (1−ζ)2 ) = −ζ and (1−ζ)(1−ζ = 1 (which are both algebraic integers) for primitive 3rd roots of unity 3 3 √ is an algebraic integer (in fact, an invertible ζ. More generally, this follows from the fact that 1−ζ 3 algebraic integer). Thus (a, b) works if and only if 2013 | a + 1, 2013 | b + 1, or (a + 1, b + 1) ∈ {2013/3, 2 · 2013/3}2 , so the desired total is (20132 − 20122 ) + 22 = 4029. Comment. The interested reader may want to further investigate the “Corollary” stated above for n = pk a prime power. For instance, (1 − ζ)−1 is not an algebraic integer, but p(1 − ζ)−1 is. (Why?) How about p−1 (1 − ζ)? (It may help to think about the p = 3 case introduced in this problem.) This problem was proposed by Victor Wang. √ 49. In 4ABC, CA = 1960 2, CB = 6720, and ∠C = 45◦ . Let K, L, M lie on BC, CA, and AB such that AK ⊥ BC, BL ⊥ CA, and AM = BM . Let N , O, P lie on KL, BA, and BL such that AN = KN , BO = CO, and A lies on line N P . If H is the orthocenter of 4M OP , compute HK 2 . Clarifications. • Without further qualification, “XY ” denotes line XY .

January 2013

Winter OMO 2012-2013

Page 20

Answer. 68737600 . √ Solution. Let a = BC, b = CA, c = AB, and compute c = 3640 2. Let M 0 be the midpoint of AC and let O0 be the circumcenter of 4ABC. It is well known that KM LM 0 is cyclic, as is AM O0 M 0 . Also, ∠BO0 A = 2∠C = 90◦ , so O0 lies on the circle with diameter AB. Then N is the radical center of these three circles; hence A, N, O0 are collinear. Now applying Brokard’s Theorem to the circle with diameter AB, we find that M is the orthocenter of the OP H 0 , where H 0 = LA ∩ BO0 . Hence H 0 is the orthocenter of 4M OP , whence H = H 0 = AC ∩ BO0 . Then, it is well known2 that c2 (a2 + b2 − c2 ) AH = 2 2 HC a (b + c2 − a2 ) where the lengths are directed. Cancelling a factor of 2802 we can compute: AH c2 (a2 + b2 − c2 ) = 2 2 HC a (b + c2 − a2 ) 338(576 + 98 − 338) = 576(98 + 338 − 576) 169 =− . 120 Therefore, AH AC =1+ HC HC 49 =− 120 √ 120 =⇒ |HC| = · 1960 2 49 √ = 4800 2. Now applying the Law of Cosines to 4KCH with ∠KCH = 135◦ yields HK 2 = KC 2 + CH 2 − 2KC · CH · cos 135◦     √ 2 √  1 = 19602 + 4800 2 − 2(1960) 4800 2 − √ 2  2 2 2 = 40 49 + 2 · 120 + 2 · 49 · 120 = 1600 · 42961 = 68737600 .

Solution 2. We use the following more general formulation: 2 One

can prove this just using the identity

BP PC

=

b sin ∠P AB c sin ∠CAP

and substituting the law of cosines in.

January 2013

Winter OMO 2012-2013

Page 21

Work in the projective plane for convenience and consider any triangle ABC. Let K, L be the feet of the altitudes from A, B respectively, and let T = AK ∩ BL be the orthocenter of 4ABC. Let P be the intersection of line BLT and the tangent AA to (AT B) (this line contains N in the original problem, so the definition of P is still the same regardless of angle C), and let O be the point on line AB satisfying LO ⊥ BC (the new definition of O is the key change). If M is the midpoint of AB, compute HK 2 . Let Q = LO ∩ BC be the foot from L to BC. We want to relate P to O, M somehow; define S to be the intersection of lines P A(N ) and LOQ. Since lines LOQS, T AK are parallel and P A is tangent to (AT B), ]LSA = ]T AP = ]T BA = ]LBA, so L, A, K, S, B all lie on the circle ω with diameter AB. By Brokard’s theorem, P = AS ∩ BL, O = AB ∩ LS, X = AL ∩ BS form a self-polar triangle, so M , the center of ω, is the orthocenter of 4XOP . But then X must be the orthocenter of 4M OP , so in fact X = H. Now proceed as above. For a directed-friendly finish, use the law of sines on 4HBC to get HB and HC in terms of BC and ∠BHC, and then use the directed version of Stewart’s theorem to get HK. This problem was proposed by Evan Chen. The second solution was provided by Victor Wang. 50. Let S denote the set of words W = w1 w2 . . . wn of any length n ≥ 0 (including the empty string λ), with each letter wi from the set {x, y, z}. Call two words U, V similar if we can insert a string s ∈ {xyz, yzx, zxy} of three consecutive letters somewhere in U (possibly at one of the ends) to obtain V or somewhere in V (again, possibly at one of the ends) to obtain U , and say a word W is trivial if for some nonnegative integer m, there exists a sequence W0 , W1 , . . . , Wm such that W0 = λ is the empty string, Wm = W , and Wi , Wi+1 are similar for i = 0, 1, . . . , m − 1. Given that for two relatively prime positive integers p, q we have  n p X 225 = f (n) , q 8192 n≥0

where f (n) denotes the number of trivial words in S of length 3n (in particular, f (0) = 1), find p + q. Answer. 61 . Solution. First we make some helpful definitions. For convenience, call xyz, yzx, zxy the three cyclic words. Let λ be the empty string. Say the word W is reduced unless and only unless at least one of the three cyclic words appears as a string of three consecutive letters in W . (In particular, λ is reduced.) Let S ∗ ⊆ S be the set of reduced words. Define ∼ so that U ∼ V if and only if U, V are similar. Call two words U, V equivalent if there exists a finite sequence of words W0 , W1 , . . . , Wm such that U = W0 , V = Wm , and Wi ∼ Wi+1 for i = 0, 1, . . . , m − 1. Define the binary relation ≡ so that U ≡ V if and only if U, V are equivalent. Then ≡ is clearly reflexive, symmetric, and transitive, and W is trivial if and only if W ≡ λ. Furthermore, if A ≡ C and B ≡ D, then AB ≡ CD. The distinction between = and ≡ will be important throughout the proof. We have U = V if and only if U, V are identical when parsed as sequences of letters, i.e. they’re composed of the same letters in the same order (and in particular, have the same length). Let T be the set of trivial words and T0 ⊆ T be the set of minimal trivial words, i.e. words W = w1 w2 . . . wn ∈ T such that w1 w2 . . . wi ∈ / T for i = 1, 2, . . . , n − 1 (we vacuously have λ ∈ T0 ). It’s easy to see that every trivial word W can be uniquely expressed in the form W1 W2 . . . Wm for some nonnegative integer m and nonempty W1 , W2 , . . . , Wm ∈ T0 . (*) Indeed, this follows from the simple fact that B ≡ λ if AB, A ∈ T .

January 2013

Winter OMO 2012-2013

Page 22

Lemma 1. No two distinct reduced words are equivalent. Proof. Define a “canonical” reduced form R(W ) for each word W ∈ S by always deleting the leftmost cyclic word in W until it’s no longer possible (so zxyxyzz becomes xyzz and then z). We will now show that R(A) = R(B) whenever A ∼ B. WLOG suppose that A = P Q and B = P xyzQ for two words P, Q (possibly empty). Since R(A) = R(R(P )Q) and R(B) = R(R(P )xyzQ), we can WLOG suppose that P ∈ S ∗ . If xyz is the leftmost cyclic word in B, then R(P xyzQ) = R(P Q). Otherwise, P ends in z. If P = P 0 yz for some P 0 ∈ S (since P ∈ S ∗ , P 0 doesn’t end in x), then yzx is the leftmost cyclic word in B and R(P xyzQ) = R(P 0 (yzx)yzQ) = R(P 0 yzQ) = R(P Q). Finally, if P = P 0 z for some P 0 ∈ S but P 0 doesn’t end in y, then zxy is the leftmost cyclic word in B and R(P xyzQ) = R(P 0 (zxy)zQ) = R(P 0 zQ) = R(P Q), completing the proof that R(A) = R(B). We can directly extend this to find that R(A) = R(B) whenever A ≡ B. But then R(A) 6= R(B) implies A 6≡ B for any two distinct reduced words A, B.

Comment. This is loosely modeled off of the proof in Lemma 1 here that the free group is nontrivial. Corollary. R(W ) is the unique reduced word W ∗ ∈ S ∗ equivalent to W . In particular, W is trivial if and only if R(W ) = λ (so 3 | |W | for all W ∈ T ). Proof. If not, then there are two distinct reduced words equivalent to W , contradicting the lemma. We are now prepared to prove the key lemma. Define the function t : {x, y, z} → {x, y, z} so that t(x) = y, t(y) = z, t(z) = x. Lemma 2. Let n be a positive integer. Then the word W = w1 w2 . . . wn lies in T0 if and only if there exists a sequence of nonempty words A1 , A2 , . . . , Am ∈ T0 (m ≥ 0) and index p ∈ {0, 1, . . . , m} such that W = w1 A1 A2 . . . Ap t(w1 )Ap+1 Ap+2 . . . Am t2 (w1 ), none of A1 , A2 , . . . , Ap end with w1 , and none of Ap+1 , Ap+2 , . . . , Am start with t2 (w1 ). Furthermore, this representation is unique for any fixed W ∈ T0 . Proof. Call the representation a standard presentation of W if it exists. We proceed by strong induction on n ≥ 1. For the base case, note that by the Corollary (to Lemma 1)3 , the only nonempty trivial words of length at most three are the three cyclic words, which are also minimal. This proves the claim for n ≤ 3. Now suppose n ≥ 4 and assume the inductive hypothesis for 1, 2, . . . , n − 1. We will first show that every minimal trivial word W has a standard presentation. Of course, the Corollary implies 3 | n. By the minimality of W and the Corollary (consider the possible sequences of reductions taking W to R(W ) = λ), there exists an index q ∈ {1, 2, . . . , n} such that w1 wq wn ≡ w2 w3 . . . wq−1 ≡ wq+1 wq+2 . . . wn−1 ≡ λ. (Why?) Then wq = t(w1 ), wn = t2 (w1 ), and by (*), there exists a (unique) sequence of nonempty words A1 , A2 , . . . , Am ∈ T0 (m ≥ 0) and index p ∈ [0, m] such that w2 . . . wq−1 = A1 . . . Ap and wq+1 . . . wn−1 = Ap+1 . . . Am . If for some i ∈ [p + 1, m], Ai ends with t2 (w1 ), then w1 A1 . . . Ap t(w1 )Ap+1 . . . Ai−1 t2 (w1 ) ≡ λ, 3 Lemma 1, while only explicitly used once, is the cornerstone of the base case, without which the induction would crumble. In particular, it shows that xzy, yxz, zyx ∈ / T.

January 2013

Winter OMO 2012-2013

Page 23

contradicting the minimality of W . Similarly, if Ai ends with w1 for some i ∈ [1, p], then w1 Ai+1 . . . Ap t(w1 )Ap+1 . . . Am t2 (w1 ) ≡ λ, once again contradicting the minimality of W (this time, however, we use the fact that W is minimal if and only if wi . . . wn 6≡ λ for i ∈ [1, n], which follows, for instance, from (*)). The previous paragraph establishes the existence of a standard presentation for W ∈ T0 . Now assume for contradiction that there exists another such representation w1 A01 A02 . . . A0p0 t(w1 )A0p0 +1 A0p0 +2 . . . A0m0 t2 (w1 ), with the t(w1 ) in the middle indexed at wq0 (the t2 (w1 ) at the end is, of course, wn ). By (*), q 0 cannot equal q, so WLOG q 0 > q. We must then have A0i = Ai for i = 1, 2, . . . , p, whence A0p+1 starts with t(w1 ) and by the inductive hypothesis, ends with t2 (t(w1 )) = w1 . Yet this contradicts the validity of A0p+1 , so the standard presentation of W must in fact be unique. Finally, we show that if W has a standard presentation, then it must lie in T0 . Since w1 t(w1 )t2 (w1 ) ≡ Ai ≡ λ for i = 1, 2, . . . , m, W is obviously trivial; it remains to show that W is minimal. Go by contradiction and suppose there exists n0 ∈ [1, n) such that W 0 = w1 w2 . . . wn0 ∈ T0 ; by the inductive hypothesis, W 0 has a (unique) standard presentation w1 A01 A02 . . . A0p0 t(w1 )A0p0 +1 A0p0 +2 . . . A0m0 t2 (w1 ). As in the previous paragraph, if q 0 denotes the index of t(w1 ) in W , then we must have q 0 = q (otherwise one of A01 , . . . , A0p0 , A1 , . . . , Ap starts with t(w1 ) and so ends with w1 ). Therefore m0 < m and A0i = Ai for i ∈ [p0 + 1 = p + 1, m0 ], whence t2 (w1 ) will appear at the start of Am0 +1 , contradiction. In view of Lemma 2, let g(n) be the number of minimal trivial words of length 3n (n > 0). Then g(1) = 3 and considering standard presentations, we get g(n) = 3 a

X

1 +···+am =n−1 m,a1 ,...,am ≥1

(m + 1)

m Y 2 i=1

3

g(ai )

for4 n ≥ 2 (in the notation of Lemma 2, there are m + 1 choices for p, and Ai , regardless of whether i ≤ p or i ≥ p + 1). Summing over n ≥ 2 yields  m X G(u) 2 g(1)u = +u (m + 1) G(u) 3 3 3 m≥1   m X 2 =u (m + 1) G(u) 3

2 3 g(|Ai |)

choices for each

m≥0

u , (1 − 2G(u)/3)2 P P where G(u) = n≥1 g(n)un . By (*), F (u) = n≥0 f (n)un = =

1 1−G(u) .

Before evaluating the generating functions F, G at u = 225/8192, observe that 0 ≤ g(n) ≤ f (n) ≤ 33n for every nonnegative integer n, so X  225 n 0 < G(225/8192) ≤ F (225/8192) ≤ 33 8192 n≥0

4 Actually,

the recurrence is true for n = 1 “by convention,” i.e. if we allow m = 0 and interpret empty products as 1. This simplifies the calculation of G(u) slightly.

January 2013

Winter OMO 2012-2013

Page 24

converges (as 33 ·225 = 6075 < 8192). Thus G(u), F (u) are positive reals satisfying G(u) = 1−F (u)−1 < 1. Finally, letting v = G(u)/3, we get 152 225 = = v(1 − 2v)2 =⇒ 152 = w(16 − w)2 , 13 2 8192 √ 3 where w = 25 v. Solving this cubic yields w ∈ {1, 21 (31 ± 61)}. But 32 w = G(u) < 1 =⇒ w < √ 3 1 1 1 11 < 2 (31 ± 61), forcing w = 1 =⇒ G(u) = 32 . Therefore F (u) = 1−G(u) = 1−3/32 = 32 29 .

32 3

<

Solution 2. Map every word by adding the position of the word to itself mod 3, so we can consider inserting/deleting xxx, yyy, or zzz instead. Now consider each word as a sequence of instructions acting on a stack, where x is an instruction that says “if the top two elements of the stack are both x, pop both of them; otherwise push x”. We claim the set of trivial words is the set of programs that, when run on an empty stack, result in another empty stack. The three sequences xxx, yyy, zzz are always no-ops (they just cycle the number of some element directly on top of the stack mod 3), so clearly inserting or deleting them will preserve the effects of a program. Furthermore, any effectless program can be obtained by insertions alone: just look at the 2 operations before and 1 after any moment when the stack has the most elements, and induct on length. Then we can note three important parts in each trivial nonempty program P : (I) after the first symbol, say w is pushed; (II) after the second copy of that symbol w is pushed; (III) after ww is popped. The part after (III) can be any other trivial program. The parts between (I) and (II), and between (II) and (III), must each be trivial programs where w is never pushed as the bottom of the stack. Let’s call these “w-bottomless” programs (all the good names have been taken :( ). w-bottomless programs can be divided into three parts in the same way. Then we discover the necessary parts in each part are also something-bottomless programs. That is, you can get an x-bottomless program, say, by picking which of y or z to push (WLOG y), which y-bottomless program to put in part (I), which y-bottomless program to put in part (II), and which x-bottomless program to put in part (III). So there’s a simple generating function equation: B(x) = 1 + 2xB(x)3 . You can actually count the number of w-bottomless programs directly. Factor out the power of 2 that results from each choice of symbol, so the difference sequence of the stack heights/sizes is a sequence of +1s and −2s that sum to 0 with no negative partial sums. Then insert a +1 at the start to convert the condition to “no nonnegative partial sums”, cyclically permute the steps, and observe that exactly one cyclic permutation of these steps has no nonnegative partial sums, so we get a total  3n+1 2n 3n 1 = where n is the number of −2s, or equivalently, 3n is the number of steps of 2n 3n+1 n n n−1 in the w-bottomless program. To recover the stack sequence/bottomless program from the sequence of +1s and −2s, consider the first −2, which must have two +1s before it, and remove these three numbers. These three correspond to a “pop”, and because they have zero sum, we can repeatedly take out +1, +1, −2 subsequences, each corresponding to a “layer” in the program. Order the layers as follow: the layer corresponding to the first +1 is the “first”; after that, the first +1 we encounter that is not in the first layer and its two partners belong to the “second layer”, and so on. For convenience, define a “phantom zeroth layer” www. Then when we evaluate the program (including pops, etc.), the first +1 of the ith layer, i > 0 will be directly “above” a +1 (either the first or second) of the jth layer for some 0 ≤ j < i, and thus must have a different symbol. (For j = 0, it just means we’ve reached the bottom again, so the ith layer can’t have symbol w by the w-bottomless restriction). In particular,

January 2013

Winter OMO 2012-2013

Page 25

the first layer cannot start with w.) Thus we have 2n ways to assign symbols to the sequence of +1s and −2s, one power of 2 for each layer. Then for the original sequence’s generating function, again: there are 3 ways to choose which symbol is first pushed, and you have to choose two something-bottomless programs for (I) and (II) and one trivial program for (III), so: F (x) = 1 + 3xB(x)2 F (x) Then just plug in x and solve the two equations for B(x) and F (x). (Presumably there are extraneous solutions, but I just assumed the one that looked nice was right. :P) Comment. The key here is to recognize that this is sort of similar to Catalan parentheses recurrence (with the notion of minimal words). In fact if we replace {xyz, yzx, zxy} with {xy}, then the problem is equivalent to Catalan. However, the primary motivation for this problem is the one posted here, with x + y + y −1 x−1 instead of x + y + x−1 + y −1 . Also, it is possible to get a nice closed form for g(n) using the Lagrange inversion theorem: we can get   3 · 2n−1 3n − 1 , g(n) = 3n − 1 n which checks out with the computations above using WolframAlpha. However, in order to generalize this to four or more letters in the natural way (so {xyzw, yzwx, . . .} for four letters), we need to slightly modify Lemma 2. The key ideas are the same, however, so we leave the rest to the interested reader. (It may be helpful to use the fact that if U V ≡ λ, then V U ≡ λ. Basic group theory, particularly the notion of inverses, may make this slightly easier to see.) This problem was proposed by Victor Wang. The second solution was given by Brian Chen, with a close variant posted by Team SA on AoPS.

The Online Math Open Spring Contest Official Solutions April 4 - 15, 2014

Contest Director • Evan Chen

Contributors and Readers • Ray Li • Robin Park

Problem Czars

• Victor Wang

• Evan Chen • Michael Kural • Sammy Luo

Website Manager • Douglas Chen

• Yang Liu

LATEX/Python Geek • Evan Chen

OMO Spring 2014 Official Solutions 1. In English class, you have discovered a mysterious phenomenon – if you spend n hours on an essay, your score on the essay will be 100 (1 − 4−n ) points if 2n is an integer, and 0 otherwise. For example, if you spend 30 minutes on an essay you will get a score of 50, but if you spend 35 minutes on the essay you somehow do not earn any points. It is 4AM, your English class starts at 8:05AM the same day, and you have four essays due at the start of class. If you can only work on one essay at a time, what is the maximum possible average of your essay scores? Proposed by Evan Chen. Answer. 75 . Solution. Note that the essay scores represent diminishing marginal returns – the number of additional points you gain with each additional half hour decreases. Therefore, your sum of scores is maximized if you distribute your time equally among all the essays. In the problem, there are eight half-hours to distribute among four essays, so one should spend an hour on each. This nets 75 points per essay and hence a final average of 75. 2. Consider two circles of radius one, and let O and O0 denote their centers. Point M is selected on either circle. If OO0 = 2014, what is the largest possible area of triangle OM O0 ? Proposed by Evan Chen. Answer. 1007 . Solution. Observe that the base OO0 is fixed at 2014, so we wish to maximize the height. Because M lies within one of either one of the centers, that means the height is at most 1 (and this is clearly achievable). So, the maximal area is 12 · 2014 = 1007. 3. Suppose that m and n are relatively prime positive integers with A = A=

m n,

where

2 + 4 + 6 + · · · + 2014 1 + 3 + 5 + · · · + 2013 − . 1 + 3 + 5 + · · · + 2013 2 + 4 + 6 + · · · + 2014

Find m. In other words, find the numerator of A when A is written as a fraction in simplest form. Proposed by Evan Chen. Answer. 2015 . Solution. Let N = 1007. Observe that 2 + 4 + 6 + · · · + 2N = 2 (1 + 2 + · · · + N ) = N (N + 1) while 1 + 3 + · · · + (2N − 1) = N 2 . Indeed, these can all be proven by simply using the standard formula for an arithmetic series. Hence, the fraction in question is simply N +1 N 2N + 1 2015 − = = . N N +1 N (N + 1) 1007 · 1008 Because gcd(2015, 1007) = gcd(2015, 1008) = 1, the answer is just 2015. 4. The integers 1, 2, . . . , n are written in order on a long slip of paper. The slip is then cut into five pieces, so that each piece consists of some (nonempty) consecutive set of integers. The averages of the numbers on the five slips are 1234, 345, 128, 19, and 9.5 in some order. Compute n. Proposed by Evan Chen. 1

OMO Spring 2014 Official Solutions Answer. 2014 . Solution. Note that the median is simply half the sum of the smallest and largest numbers on the piece. Furthermore, we can sort the piece in the order of the medians. This means the first piece (containing 1) has largest number 2 · 9.5 − 1 = 18; in other words, the first of the pieces contains 1, 2, . . . , 18. Then the next piece contains just the number 19. Similarly, the third piece contains the numbers 20 through 236 (as 21 (20 + 236) = 128); the fourth slip contains the numbers 237 through 453, and the last slip contains numbers 454 to 2014. Hence, n = 2014, the final answer. 5. Joe the teacher is bad at rounding. Because of this, he has come up with his own way to round grades, where a grade is a nonnegative decimal number with finitely many digits after the decimal point. Given a grade with digits a1 a2 . . . am .b1 b2 . . . bn , Joe first rounds the number to the nearest 10−n+1 th place. He then repeats the procedure on the new number, rounding to the nearest 10−n+2 th, then rounding the result to the nearest 10−n+3 th, and so on, until he obtains an integer. For example, he rounds the number 2014.456 via 2014.456 → 2014.46 → 2014.5 → 2015. There exists a rational number M such that a grade x gets rounded to at least 90 if and only if x ≥ M . If M = pq for relatively prime integers p and q, compute p + q. Proposed by Yang Liu. Answer. 814 . Solution. The main idea is that the smallest grades which round to a 90 are precisely those of the form 89. 4444 . . . 44} 5. | {z n digits

As n grows arbitrarily large, this limit approaches 89 + 49 = 805 9 . So the answer is 805 + 9 = 814. Note that M itself is not a grade (since grades have finitely many digits after the decimal point), so the distinction between x ≥ M and x > M is not relevant. 6. Let Ln be the least common multiple of the integers 1, 2, . . . , n. For example, L10 = 2,520 and L30 = 2,329,089,562,800. Find the remainder when L31 is divided by 100,000. Proposed by Evan Chen. Answer. 46800 . Solution. Because 31 is prime, we have L31 = 31L30 . Hence, it suffices to compute the remainder when 31 · 62800 is divided by 105 , which is 46800. 7. How many integers n with 10 ≤ n ≤ 500 have the property that the hundreds digit of 17n and 17n + 17 are different? Proposed by Evan Chen. Answer. 84 . Solution. Let An denote the value when the last two digits of 17n are deleted. Notice that An+1 − An is either 0 or 1 for every n. Hence, the problem is just asking for the number of n with 10 ≤ n ≤ 500 such that An+1 − An = 1. As n ranges from 10 to 500, the smallest number is 17·10 = 170 and the largest number is 17(500)+17 = 8517. In other words, A10 = 1 and A501 = 85. Hence for 10 ≤ n ≤ 500, the value of An is increased exactly 84 times. Hence, the answer is 84.

2

OMO Spring 2014 Official Solutions 8. Let a1 , a2 , a3 , a4 , a5 be real numbers satisfying 2a1 + a2 + a3 + a4 + a5 = 1 + 81 a4 2a2 + a3 + a4 + a5 = 2 + 41 a3 2a3 + a4 + a5 = 4 + 21 a2 2a4 + a5 = 6 + a1 Compute a1 + a2 + a3 + a4 + a5 . Proposed by Evan Chen. Answer. 2 . Solution. Add eight times the first equation, four times the second, and two times the third to the fourth. We obtain that 16a1 + 16a2 + 16a3 + 16a4 + 15a5 = 30 + a4 + a3 + a2 + a1 . Letting S be the desired sum, we readily derive 16S = 30 + S, so S = 2. 9. Eighteen students participate in a team selection test with three problems, each worth up to seven points. All scores are nonnegative integers. After the competition, the results are posted by Evan in a table with 3 columns: the student’s name, score, and rank (allowing ties), respectively. Here, a student’s rank is one greater than the number of students with strictly higher scores (for example, if seven students score 0, 0, 7, 8, 8, 14, 21 then their ranks would be 6, 6, 5, 3, 3, 2, 1 respectively). When Richard comes by to read the results, he accidentally reads the rank column as the score column and vice versa. Coincidentally, the results still made sense! If the scores of the students were x1 ≤ x2 ≤ · · · ≤ x18 , determine the number of possible values of the 18-tuple (x1 , x2 , . . . , x18 ). In other words, determine the number of possible multisets (sets with repetition) of scores. Proposed by Yang Liu. Answer. 131072 . Solution. Let n = 18 and suppose 1 = r1 ≤ r2 ≤ · · · ≤ rn is a set of ranks for the students. The main observation is that every such set of ranks gives rise to exactly one set of scores. Explicitly, we simply set the score of the nth student as 1, and then work backwards to construct the set of scores for the students. Because there are 21 ≥ n points available on the contest, this construction will always terminate successfully. Hence, the problem is equivalent to counting the number of tuples of ranks. Evidently r1 = 1. For each subsequent i, either ri+1 = ri , or ri+1 is ri plus the number of indices j with ri = rj . In other words, we either stay the same or increase. This means that we have 2 choices at each step, and the answer is 2n−1 = 217 = 131072. 10. Let A1 A2 . . . A4000 be a regular 4000-gon. Let X be the foot of the altitude from A1986 onto diagonal A1000 A3000 , and let Y be the foot of the altitude from A2014 onto A2000 A4000 . If XY = 1, what is the area of square A500 A1500 A2500 A3500 ? Proposed by Evan Chen. Answer. 2 . Solution. Let ω denote the circumcircle of the 4000-gon and let O denote its center. One can verify that OXA2014 Y is a rectangle, hence 1 = XY = OA2014 is a radius ω. Consequently, the side length √ √ 2 of the square is 2 and the area is 2 = 2.

3

OMO Spring 2014 Official Solutions 11. Let X be a point inside convex quadrilateral ABCD with ∠AXB + ∠CXD = 180◦ . If AX = 14, BX = 11, CX = 5, DX = 10, and AB = CD, find the sum of the areas of 4AXB and 4CXD. Proposed by Michael Kural. Answer. 90 . Solution. Because AB = CD, we can construct a point X 0 outside of ABCD such that 4AX 0 B ∼ = CXD. Additionally, ∠AXB + ∠AX 0 B = ∠AXB + ∠CXD = 180 so AX 0 BX is cyclic, and it’s sufficient to find the area of this quadrilateral. Let O be the center of its circumcircle. Note that we can rearrange the triangles OAX 0 , OX 0 B, OBX, OXA while keeping each of the points equidistant from O, (so they are still cyclic) and not changing the total area of AX 0 BX. The side lengths of AX 0 BX are 10, 5, 11, 14, so we rearrange the lengths to be in the order 14, 5, 11, 10. But 142 + 52 = 112 + 102 √= 221, so this new cyclic quadrilateral is composed of two right triangles with common hypotenuse 221. Thus its total area is 1 1 · 14 · 5 + · 11 · 10 = 90. 2 2 12. The points A, B, C, D, E lie on a line ` in this order. Suppose T is a point not on ` such that ∠BT C = ∠DT E, and AT is tangent to the circumcircle of triangle BT E. If AB = 2, BC = 36, and CD = 15, compute DE. Proposed by Yang Liu. Answer. 954 . Solution. By simple angle chasing, we find that ∠AT C = ∠AT B + ∠BT C = ∠T EB + ∠DT E = ∠T CB. Thus line AT is also a tangent to the circumcircle of triangle T EF . Hence 2AE = AB · AE = AT 2 = AC · AD = 38 · 53 = 2014. This implies AE = 1007, whence DE = 1007 − 53 = 954. 13. Suppose that g and h are polynomials of degree 10 with integer coefficients such that g(2) < h(2) and g(x)h(x) =

 10  X k + 11 k=0

k

x

20−k



    21 − k k−1 21 k−1 − x + x 11 11

holds for all nonzero real numbers x. Find g(2). Proposed by Yang Liu. Answer. 2047 . Solution. Let n = 10. By the Hockey Stick identity, one discovers the factorization !  n   X n + i n−i n n−1 n−2 p(x) = x + x +x + ... + x + 1 x . n i=0 The polynomial x10 + x9 + · · · + 1 happens to be irreducible (it is the 11th cyclotomic polynomial), and so this must be the unique factorization into two polynomials of degree n. Hence, the answer is just 1 + 2 + · · · + 210 = 2047. 4

OMO Spring 2014 Official Solutions 14. Let ABC be a triangle with incenter I and AB = 1400, AC = 1800, BC = 2014. The circle centered at I passing through A intersects line BC at two points X and Y . Compute the length XY . Proposed by Evan Chen. Answer. 1186 . Solution. Construct the points B 0 and C 0 on BC so that CA = CB 0 and BA = BC 0 . These are consequently the reflections of B and C across lines CI and BI, respectively. Thus AI = B 0 I = C 0 I, and hence B and C are precisely the points X and Y . Then, it is straightforward to compute XY = 1400 + 1800 − 2014 = 1186. 15. In Prime Land, there are seven major cities, labelled C0 , C1 , . . . , C6 . For convenience, we let Cn+7 = Cn for each n = 0, 1, . . . , 6; i.e. we take the indices modulo 7. Al initially starts at city C0 . Each minute for ten minutes, Al flips a fair coin. If the coin land heads, and he is at city Ck , he moves to city C2k ; otherwise he moves to city C2k+1 . If the probability that Al is back at city C0 after 10 m , find m. moves is 1024 Proposed by Ray Li. Answer. 1171 . Solution. Let is ignore for now the indices modulo 7. Then, the process described just selects an 10-digit binary number between 0 and 210 − 1 = 1023 inclusive. Furthermore, we end at C0 if and only 147 , giving if the number is divisible by 7. There are 147 such multiples of 7, so the probability is 1024 147 + 1024 = 1171. √ 16. Say a positive integer n is radioactive if one of its prime factors is strictly greater than n. For example, 2012 = 22 · 503, 2013 = 3 · 11 · 61 and 2014 = 2 · 19 · 53 are all radioactive, but 2015 = 5 · 13 · 31 is not. How many radioactive numbers have all prime factors less than 30? Proposed by Evan Chen. Answer. 119 . Solution. Notice that counting N is just equivalent to counting multisets of primes such that one prime exceeds the product of the others. Let p be the largest prime, and put N = px. Note that 1 ≤ x ≤ p − 1 and that any value of x is achievable in exactly one way (by unique prime factorization). Hence for a fixed value of p there are exactly p − 1 values of x possible, and hence p − 1 ways. The answer is thus X

p − 1 = 129 − 1 · 10 = 119.

p≤30 p prime

17. Let AXY BZ be a convex pentagon inscribed in a circle with diameter AB. The tangent to the circle at Y intersects lines BX and BZ at L and K, respectively. Suppose that AY bisects ∠LAZ and AY = Y Z. If the minimum possible value of AK + AX can be written as m + 10n + 100k.

m n

+





AL AB

2

k, where m, n and k are positive integers with gcd(m, n) = 1, compute

Proposed by Evan Chen. Answer. 343 .

5

OMO Spring 2014 Official Solutions Solution. Let O be the midpoint of AB, and let AB = 2r. The key observation which will let us set up the algebra is that 4LOY ∼ 4Y BK. First, because ∠Y ZA = ∠Y AZ = ∠LAZ, we find LA is a tangent to the semicircle. This follows because ∠AOL =

1 ∠AOY = ∠OBY =⇒ LO k Y B 2

and ∠AOY =

1 ∠AOZ = ∠OBZ =⇒ Y O k ZB. 2

So, we may set Y K = kh and KB = kr, where AL = LY = h. First, we claim have

AK AX

= 32 k + 1. By Ptolemy’s Theorem on ABKL,

BL · AK = AL · BK + AB · LK = 2(k + 1)rh + khr = (3k + 2)hr. But 12 [LAB] = BL · AX = AL · AB = h(2r) and the conclusion follows. 2

2 2 2 2 2 2 2 Next we claim k = r22r +h2 . This follows from LB = AL + AB = KL + KB , whence h + 4r = 2 2 2 2 2 2 2 2 (k + 1) h + k r . Then, k(k + 2)h = (4 − k )r . Cancelling a factor of 2 + k gives kh = (2 − k)r2 , 2 so k = r22r +h2 .

Thus, if we let x = hr , we get that AK + AX



AL AB

2 = = = ≥ =

 2 h 3 k+1+ 2 2r 3 x2 + 1 + 1 + x2 4 3 1 + x2 3 + + 4 1 + x2 4 r 3 3 +2 4 4 3 √ + 3 4

and the answer is 343. 18. Find the number of pairs (m, n) of integers with −2014 ≤ m, n ≤ 2014 such that x3 + y 3 = m + 3nxy has infinitely many integer solutions (x, y). Proposed by Victor Wang. Answer. 25 . Solution. This is equivalent to (x + y + n)(x2 + y 2 + n2 − xy − n(x + y)) = m + n3 , so infinitely many solutions exist if and only if m = −n3 . This permits −12 ≤ m ≤ 12, giving 25 solutions. 19. Find the sum of all positive integers n such that τ (n)2 = 2n, where τ (n) is the number of positive integers dividing n. Proposed by Michael Kural. Answer. 100 . Solution. Clearly, we may write n = 2u2 , where u is some positive integer. Now note that the function g(n) =

τ (n)2 n

is multiplicative. Observe that the exponent of 2 in n is odd, so we find that g(2) = g(8) = 2, but g(2j ) < 2for j ≥ 5. Moreover, the exponent of any prime p (other than 2) in n is even, and we can check g p2k ≤ 1 with equality precisely when p = 3 and k ∈ {0, 1}. So g(n) ≤ 2, for all n, with equality at n = 2, 8, 18, 72. Hence the answer is 2 + 8 + 18 + 72 = 100. 6

OMO Spring 2014 Official Solutions 20. Let ABC be an acute triangle with circumcenter O, and select E on AC and F on AB so that BE ⊥ AC, CF ⊥ AB. Suppose ∠EOF − ∠A = 90◦ and ∠AOB − ∠B = 30◦ . If the maximum possible ◦ measure of ∠C is m n · 180 for some positive integers m and n with m < n and gcd(m, n) = 1, compute m + n. Proposed by Evan Chen. Answer. 47 . Solution. The key is the following lemma: if O lies inside triangle AEF and ∠EOF − ∠A = 90◦ then ∠A = 45◦ . Indeed, the conditions imply that pentagon BEOF C is cyclic, so ∠BOC = 90◦ . Simple calculations give that ∠C = 70◦ − 13 ∠A. So we wish to minimize ∠A. Note that if ∠A ≤ 45◦ , then ∠BOC ≤ 90◦ which implies that O lies outside the circle with diameter BC while inside ABC, which causes the lemma to apply. In other words ∠A ≤ 45◦ =⇒ ∠A = 45◦ . So the minimum possible value of ∠C is 55◦ . This is achieved if (∠A, ∠B, ∠C) = (45◦ , 80◦ , 55◦ ). Converting to radians, 55◦ =

11 36 π

and 11 + 36 = 47.

√ 21. Let b = 12 (−1 + 3 5). Determine the number of rational numbers which can be written in the form a2014 b2014 + a2013 b2013 + · · · + a1 b + a0 where a0 , a1 , . . . , a2014 are nonnegative integers less than b. Proposed by Michael Kural and Evan Chen. Answer. 15 . Solution. Let cn =

1 √ 3 5



bn − b

n



, where b =

1 2

√  −1 − 3 5 .

It is easy to derive that c0 = 0, c1 = 1, and cn = −cn−1 + 11cn−2 for every positive integer n. The first few terms of the sequence are 0, 1, −1, 12, −23, 155, −408, 2113, . . . . Then, the problem is equivalent to selecting the integers ai so that a0 c0 + a1 cP 1 + · · · + an cn = 0. This P n is because if n an bn is rational, so is its conjugate, implying the difference an bn − an b is zero. It’s not hard to verify that |cn | > 2 |cn−1 + cn−3 + . . . | for each n ≥ 5. Hence we only need to consider the case where a5 = a6 = · · · = 0. This is simple casework (noting that 12 and −23 are overwhelmingly the largest terms), and the solutions are (a1 , a2 , a3 , a4 ) ∈ {(0, 0, 0, 0), (1, 1, 0, 0), (2, 2, 0, 0), (0, 1, 2, 1), (1, 2, 2, 1)} . where a0 can be arbitrary (as c0 = 0). Hence there are 15 such 5-tuples. 22. Let f (x) be a polynomial with integer coefficients such that f (15)f (21)f (35) − 10 is divisible by 105. Given f (−34) = 2014 and f (0) ≥ 0, find the smallest possible value of f (0). Proposed by Michael Kural and Evan Chen. Answer. 620 . Solution. Let p = 3, q = 5, and r = 7. Note that f (pq)f (qr)f (rp) = f (pq + qr + rp)f (0)2

(mod pqr).

This follows from the Chinese Remainder Theorem; we consider the equation modulo each of p, q, r. For this particular problem, we see 2014 ≡ f (−34) ≡ f (15 + 21 + 34) (mod 105) and f (15)f (21)f (31) ≡ 10 (mod 105). Now, let x = f (0). Accordingly we find x2 ≡ 10·2014−1 ≡ (−95)·19−1 ≡ −5 (mod 105). The solutions are x ≡ 10, 25, 80, 95 (mod 105) by the Chinese Remainder Theorem. 7

OMO Spring 2014 Official Solutions In addition, we require x ≡ f (−34) ≡ 2014 (mod 34); that is, we also need x ≡ 8 (mod 34). In short we must find the smallest solution for x ≡ 10, 25, 80, 95

(mod 105)

and

x≡8

(mod 34)

The x ≡ 8 (mod 34) becomes x ≡ 110 (mod 170) (since 5 | x). We then discover that x = 620 is the smallest working value (after trying 110, 280, 450). A working construction is f (x) = −41x + 620. Hence, the minimum possible value of f (0) is 620. 23. Let Γ1 and Γ2 be circles in the plane with centers O1 and O2 and radii 13 and 10, respectively. Assume O1 O2 = 2. Fix a circle Ω with radius 2, internally tangent to Γ1 at P and externally tangent to Γ2 at Q . Let ω be a second variable circle internally tangent to Γ1 at X and externally tangent to Γ2 at Y . Line P Q meets Γ2 again at R, line XY meets Γ2 again at Z, and lines P Z and XR meet at M . As ω varies, the locus of point M encloses a region of area positive integers. Compute p + q.

p q π,

where p and q are relatively prime

Proposed by Michael Kural. Answer. 16909 . Solution. Let O3 be the center of Ω. Note that then P, O3 , O1 are collinear and P, Q, O2 are collinear. But O3 P Q and O2 QF are isosceles triangles, so ∠O3 P F = ∠O3 P Q = ∠O3 QP = ∠O2 QF = ∠O2 F Q = ∠O2 F P Thus O2 F k O3 P . Let O1 O2 meet P F at S. Then since O1 P k O2 F , we see S is the center of negative homothety mapping Γ1 to Γ2 . So S lies on P Q, and similarly S also lies on XY . Now this negative homothety maps P to the intersection past S of P S with Γ2 and X to the intersection past S of XS with Γ2 . But these intersections are R and Z, respectively. So this homothety maps P X to RZ, and so P X k RZ. Because this maps P X on circle O1 to ZR on circle O2 , we obtain PX O1 P 13 = = . ZR O2 R 10 Note that if lines P R and XZ meet at S inside quadrilateral P XRZ, then lines P Z and RX meet at MZ 10 PM 13 M outside this quadrilateral. So M P = 13 , and P Z = 3 . Now P is fixed, but as ω varies, Z can take be all points on circle Γ2 . So the locus of M is circle Γ2 , dilated about P with scale factor 13 3 . Thus its area is  2   13 16900 π · 10 = π 3 9 and our answer is 16909. 24. Let P denote the set of planes in three-dimensional space with positive x, y, and z intercepts summing to one. A point (x, y, z) with min{x, y, z} > 0 lies on exactly one plane in P. What is the maximum −1 possible integer value of 41 x2 + 2y 2 + 16z 2 ? Proposed by Sammy Luo. Answer. 21 . Solution. The points on the planes in P are of the form (x, y, z) = (a1 e1 , a2 e2 , a3 e3 ), where the ai (axis intercepts) and ei (weights) both sum to 1. Hence, by Cauchy Schwarz we have √ √ √ 1 = (a1 + a2 + a3 )(e1 + e2 + e3 ) ≥ ( a1 e1 + a2 e2 + a3 e3 )2 . This implies that



x+

√ 8

y+



z ≤ 1.

OMO Spring 2014 Official Solutions Equality can √ be attained for any choice of x, y, z satisfying the equality by (and only by) setting a1 = e1 = x and so forth. √ √ √ Thus we find S is the set of points with x + y + z = 1. Then by H¨older (or weighted power mean), we have the inequality 

1 2 x + y 2 + 8z 2 8

 3 √ 4 √ 1 √ x + y + z = 1. 2+1+ ≥ 2

Therefore, 

1 2 x + 2y 2 + 16z 2 4

−1 ≤

1 2

 2+1+

1 2

3 =

343 7 = 21 + . 16 16

Since the values can be changed continuously, the largest possible integer value is 21. 25. If

∞ X

1 1

+

n=1

1 1 2 + ··· + n  n+100 100

p q

=

for relatively prime positive integers p, q, find p + q. Proposed by Michael Kural. Answer. 9901 . Solution. Let Hn =

1 1

+

1 2

+ · · · + n1 . Note that      n + 100 n + 100 n + 99 = 100 n 99

and



n + 100 n





n+1 100

=

  n + 100 99

so 1

 n+99 −

99 100  n+100 . 100

1

 n+100 =

99

99

So the sum is 

100 99

H1

100 99

−1

 −1 ! 101 − + H2 99



101 99

−1

!  −1 ! 102 − + ··· . 99

which equals  100/99 Note that n

99+n 100



= 100

99+n 100



1 99

100 99

−1

!  −1  −1 1 101 1 102 + + ··· . 2 99 3 99

, so this becomes 

100 100

−1



101 + 100

−1



102 + 100

!

−1 + ···

.

Now again using the first identity, this telescopes and becomes 100 992



99 99

−1



100 − 99

−1

!  −1  −1 100 101 100 + − ··· = 2 99 99 99

 −1 ! 99 100 . = 99 9801

yielding a final answer of 100 + 9801 = 9901. Replacing 100 with a general k, the answer is 9

k (k−1)2 .

OMO Spring 2014 Official Solutions 26. Qing initially writes the ordered pair (1, 0) on a blackboard. Each minute, if the pair (a, b) is on the board, she erases it and replaces it with one of the pairs (2a − b, a), (2a + b + 2, a) or (a + 2b + 2, b). Eventually, the board reads (2014, k) for some nonnegative integer k. How many possible values of k are there? Proposed by Evan Chen. Answer. 720 . Solution. Consider instead the pairs with both entries increased by one. Then the operation corresponds to starting with (2, 1) and repeatedly replacing (m, n) by one of (2m − n, m), (2m + n, m) and (m + 2n, n). We can make a few simple observations about the resulting pairs: • The first entry always exceeds the second entry. • There is always exactly one even entry. • The entries are always relatively prime to each other. The crucial claim is that in fact this is a complete characterization for all achievable pairs. The proof is a simple strong induction on m + n where (m, n) has the above properties. Indeed, one can actually show there is a unique construction of (m, n) from (2, 1) using the above operations. Hence, the answer is the number of even integers relatively prime to 2015. Letting ϕ denote Euler’s totient function, this is just 21 ϕ(2015) = 12 · 4 · 12 · 30 = 720. 27. A frog starts at 0 on a number line and plays a game. On each turn the frog chooses at random to jump 1 or 2 integers to the right or left. It stops moving if it lands on a nonpositive number or a number on which it has already landed. If the expected number of times it will jump is pq for relatively prime positive integers p and q, find p + q. Proposed by Michael Kural. Answer. 301 . Solution. Let g(n) be the number of ways for the frog to jump n times and land on a positive number that it has not landed on before. Let f (n, k) be the number of ways to do this such that its first k jumps are 2 to the right and its k + 1’th is not, for 0 ≤ k ≤ n. (We define f (n, n) = 1 for the one path that consists of n jumps 2 to the right.) Note that g(n) = f (n, 0) + f (n, 1) + · · · + f (n, n) for n ≥ 0. Note f (n, 0) = g(n − 1) for n ≥ 1, since the frogs first jump must be 1 to the right, and starting from 1 with 0 already landed on is equivalent to starting from 0 again with one less step taken. Additionally, f (n, n − 1) = 2 for n ≥ 2, since after moving n − 1 steps to the right, the frog can either move one to the left or one to the right. Let 1a≥b be defined as taking the value 1 if a ≥ b and 0 otherwise. Consider the value of f (j + k, k) for j ≥ 2, k ≥ 1. After landing on the numbers 2, 4, · · · 2k, the possible remaining numbers to land on are 1, 3, · · · 2k − 1, and 2k + 1, 2k + 2, 2k + 3, · · · . It is not hard to see that the frog can take 4 possible paths starting at 2k and not moving to 2k + 2 initially: • The frog can move to 2k + 1 and remain to the right of 2k for the next j − 1 steps. This is equivalent to starting at 0 and making j − 1 arbitrary legal steps, so the number of ways to do this is g(j − 1). • The frog can move to 2k − 1, and then continue to 2k − 3, 2k − 5, etc. until it stops at a positive odd integer. In order for this to be possible, we must have j ≤ k, so the number of ways to do this is 1j≥k . 10

OMO Spring 2014 Official Solutions • The frog can move to 2k − 1, then hop to the right again to 2k + 1, and remain to the right of 2k for the next j − 2 steps. This is possible given k ≥ 1, j ≥ 2, and similarly to the first case, the number of ways to do this is g(j − 2). • The frog can move to 2k + 1, then hop left to 2k − 1 and continue moving along the path 2k − 1, 2k − 3, · · · . The number of ways to do this is 1j≤k+1 . Thus if we substitute m = j + k, we obtain f (m, k) = g(m − k − 1) + g(m − k − 2) + 12k≥m + 12k+1≥m for m ≥ k + 2 and k ≥ 1. Substituting this into the definition of g(m) yields g(m) = g(m − 1) + (g(m − 2) + g(m − 3)) + · · · + (g(1) + g(0)) + 2 + 1 X X + 1+ 1 m/2≤k≤m−2

(m−1)/2≤k≤m−2

m m c+d e−2 2 2 = g(m − 1) + g(m − 2) + 2g(m − 3) + · · · + 2g(1) + g(0) + m + 1 = g(m − 1) + g(m − 2) + 2g(m − 3) + · · · + 2g(1) + g(0) + 3 + b

for all m ≥ 2. This implies g(m) = g(m − 1) + 2g(m − 3) + 1 for all m ≥ 3. Let h(n) be the probability that the frog makes n − 1 legal jumps and then must stop after its nth jump. The expected value of the amount of jumps the frog makes is X E= n · h(n). n≥0

But note that h(0) + h(1) + · · · + h(k) +

g(k) =1 4k

and 0 · h(0) + · · · + k · h(k) = (k)(h(0) + · · · h(k)) − (h(0)) − (h(0) + h(1)) − · · · − (h(0) + · · · + h(k − 1)) g(0) g(k − 1) g(k) = k(1 − k ) − (1 − 0 ) − · · · − (1 − 4 4 4k−1   X g(k)  − k · g(k) . = k 4 4k 0≤n
But the last term approaches 0 since g(k) ≤ 3k , so taking the limit to infinity yields E=

X g(k) . 4k

n≥0

Thus E−

2E E 1 1 1 − 3 = 0 + 2 + 3 + ··· 4 4 4 4 4

and

31E 4 1 13 208 = − = ⇒E= . 64 3 4 12 93 This gives the answer of 208 + 93 = 301.

11

OMO Spring 2014 Official Solutions 28. In the game of Nim, players are given several piles of stones. On each turn, a player picks a nonempty pile and removes any positive integer number of stones from that pile. The player who removes the last stone wins, while the first player who cannot move loses. Alice, Bob, and Chebyshev play a 3-player version of Nim where each player wants to win but avoids losing at all costs (there is always a player who neither wins nor loses). Initially, the piles have sizes 43, 99, x, y, where x and y are positive integers. Assuming that the first player loses when all players play optimally, compute the maximum possible value of xy. Proposed by Sammy Luo. Answer. 7800 . Solution. Call a game position an A-position if it results in a win for the next player, a C-position if it results in a loss, and a B-position otherwise. We use the following definitions to make thing simpler: For a nonnegative integer a = an an−1 · · · a1 a0 2 written in base 2, define the ternation of a, aT , to be an an−1 · · · a1 a0 3 , i.e. the number that results when the base 2 representation of a is interpreted as a base 3 integer. Define the trim-sum of two numbers a = an an−1 · · · a1 a0 3 and b = bn bn−1 · · · b1 b0 3 written in base 3 (possibly with leading zeroes), represented by a  b, such that a  b = cn cn−1 · · · c1 c0 3 where ci ≡ ai + bi (mod 3) is 0, 1 or 2. The key is the following proposition. A position P = (x1 , x2 , · · · , xn ) in 3-Nim is a C-position if and only if (x1 )T  (x2 )T  · · ·  (xn )T = 0. In this case, we want 1010113  11000113  xT  yT = 0, so we need xT  yT = 21020113 . Since the base 3 digits in xT and yT are all zero or one, we see that xT + yT = 21020113 , so to maximize their product, we make them as close as possible. This is done by assigning the first occurrence of a 1 in the sum’s base 3 representation to x and every other occurrence of a 1 to y, yielding x = 11010002 = 104, y = 10010112 = 75. These multiply to give 7800. The proof of the key result used can actually generalize to more than 3 players, but for simplicity we’ll just include the 3-player version. We use strong induction on s = x1 + x2 + · · · + xn . The theorem statement is trivial for s = 0 by the definition of a C-position. Assume for some k > 0 that the statement holds for all s < k. Consider a position P = (x1 , x2 , · · · , xn ) with s = k. Clearly any move will decrease s. Let s3 (P ) = (x1 )T  (x2 )T  · · ·  (xn )T . We will prove and use the following lemma. Lemma 1. Any position P with s3 (P ) 6= 0 can be moved to one with s3 (P ) = 0 in at most two moves, while a position P with s3 (P ) = 0 cannot be moved to another such position in at most two moves. Proof. For the first part of the lemma: Let s3 (P ) = cd−1 cd−2 · · · c1 c0 3 in base 3 with cd−1 nonzero. If we can show that the lemma is true when the sizes of all piles have ≤ d digits in base 2, then in any other case we can ignore all but the last d digits of each pile and perform the same operation on these digits to get the same result. Let the largest 3 piles in P have sizes a1 > a2 > a3 . We are assuming that a1 has at most d digits in base 2. Let cd−1 = j. We use strong induction on d to show that it is possible to perform the operation specified in the lemma with all of a1 , a2 , · · · , aj changed. For d = 0, this is trivial because all the nonempty piles are 1s, so we remove the c0 biggest piles and are done. Now assume it’s true for all d < d0 for some d0 > 0, and consider d = d0 . Let cd0−1 = j0 . Then replace a1 , a2 , · · · , aj0 with a∗ = 2d0 −1 − 1. This results in a position P 0 with d = d0 ≤ d0 − 1 (since cd0 −1 is now 0), so by induction the c0d0 −1 piles whose last d0 digits form the largest base 2 integers possible can be used to do the operation demanded by the lemma. Since all digits of a∗ in base 2 are 1, clearly a1 , a2 , · · · , aj , which have all been replaced by a∗ , can be used from now on for any number of digits d < d0 until more than j0 digits are needed for some future digit, in which case we continue using them along with as many of the next largest integers as necessary. So the statement holds for d = d0 as well, and by strong induction holds for all d. Now we prove the second part of the lemma. Assume 12

OMO Spring 2014 Official Solutions the opposite, so there are piles a, b in P such that there exist nonnegative integers a0 < a, b0 ≤ b with aT bT = s3 (P )a0T b0T = a0T b0T . Since the digits of aT , bT , a0T , b0T in base 3 are 0s and 1s, summing them pairwise cannot produce ”‘carry-overs”’, so aT  bT = aT + bT and a0T  b0T = a0T + b0T . But then we get aT + bT = a0T + b0T , which is impossible if a0 < a and b0 ≤ b (since it is simple to see, e.g. by expanding out the integers’ base representations into polynomials of the base, that a > a0 implies aT > a0T , etc.). This completes the proof of the lemma. Now we continue with the main proof. If s3 (P ) is nonzero, then there exist two piles a, b that can be altered (with b possibly not changed) to produce a position P 0 with s3 (P 0 ) = 0. Then the player (without loss of generality, player 1) who is faced with position P can alter a. If this leaves a position P 0 with s3 (P 0 ) = 0 already, then P 0 is a C position by the inductive hypothesis, and P is an A-position. Otherwise, player 2 can alter b to leave a position P 0 with s3 (P 0 ) = 0, which is a C-position for player 2, so player 1 would be in an A-position, implying P is a B-position. In either case, P is not a C position if s3 (P ) 6= 0. If instead s3 (P ) = 0, notice that altering any pile will result in a position P 0 with s3 (P 0 ) 6= 0 (by, e.g., the lemma). P 0 is then either an A-position or a B-position. However, by the lemma applied to P , P 0 cannot be moved to a position P 00 with s3 (P 00 ) = 0 in one move, and since by the inductive hypothesis such positions are the only C-positions, P 0 cannot be an A-position, so it must be a B-position, and P is a C-position as wanted. So the theorem holds for s = k as well, and therefore for all s. 29. Let ABCD be a tetrahedron whose six side lengths are all integers, and let N denote the sum of these side lengths. There exists a point P inside ABCD such that the feet from P onto the faces of the tetrahedron are the orthocenter of 4ABC, centroid of 4BCD, circumcenter of 4CDA, and orthocenter of 4DAB. If CD = 3 and N < 100,000, determine the maximum possible value of N . Proposed by Sammy Luo and Evan Chen. Answer. 15000 . Solution. Let H, G, O, H 0 denote the orthocenter of 4ABC, centroid of 4BCD, circumcenter of 4CDA, and orthocenter of 4DAB, respectively. The standard perpendicularity criterion applied to P H and BC and to P G and BC gives BH 2 − CH 2 = BP 2 − CP 2 = BG2 − CG2 (so BC ⊥ GH), and similarly for the other five pairs of sides between ABCD and GOH 0 H. We can cancel a whole bunch of terms in these expressions, using for example the identities 2 BH 2 = 4RABC − AC 2

and BG2 =

2 1 (BC 2 + CD2 + DB 2 ) − CD2 . 9 3

Due to the circumcenter we get GC 2 − GD2 = HA2 − HC 2 = H 0 D2 − H 0 A2 = 0. Hence we define s = BC = BD = BA. The remaining equations give CD2 − s2 = DA2 − s2 = AC 2 − s2 . 3 Letting DA = AC = a, we find 3a2 − 2s2 = 9. This is a Pell-type equation, and the only solutions small enough are (a, s) = (3, 3), (27, 33), (267, 327), (2643, 3237). So, using the largest one, the answer is 3 + 2 · 2643 + 3 · 3237 = 15000. 13

OMO Spring 2014 Official Solutions 30. For a positive integer n, an n-branch B is an ordered tuple (S1 , S2 , . . . , Sm ) of nonempty sets (where m is any positive integer) satisfying S1 ⊂ S2 ⊂ · · · ⊂ Sm ⊆ {1, 2, . . . , n}. An integer x is said to appear in B if it is an element of the last set Sm . Define an n-plant to be an (unordered) set of n-branches {B1 , B2 , . . . , Bk }, and call it perfect if each of 1, 2, . . . , n appears in exactly one of its branches. Let Tn be the number of distinct perfect n-plants (where T0 = 1), and suppose that for some positive real number x we have the convergence   n X (ln x) = 6 . ln  Tn · n! 29 n≥0

If x =

m n

for relatively prime positive integers m and n, compute m + n.

Proposed by Yang Liu. Answer. 76 . Solution. This is a fairly transparent use of generating functions. The main claim is that X  xn  ex − 1 = . ln Tn n! 2 − ex n≥0

a−1 2−a

From this the answer is evidently just the solution to we simply need to establish the above claim.

=

6 29 ,

or a =

41 35 ,

giving 41 + 35 = 76. Hence,

Let S(n, k) denote the Stirling numbers of the second kind. Lemma 1. We have X n≥0

X

n

x ·

a1 +2a2 +...nan

1 a !a ! . . . an ! =n 1 2

! x

= e 1−x .

where the ai in the second sum are nonnegative integers. Proof. Compute X

X

xn ·

a1 +2a2 +...nan

n≥0

1 a1 !a2 ! . . . an !

! =

Y i≥1

  X xij Y i x  = ex = e 1−x . j! j≥0

i≥1

For simplicity later, let X

Ak =

a1 +2a2 +...nan

1 . a1 !a2 ! . . . an !

Now, we directly count Tn . To do this, we do casework on how many vertices we have not including the root. Say we have k vertices, and say from under the root, we have i branches of length ai . Then clearly, a1 + 2a2 + . . . + kak = k. Clearly there are k!S(n, k) ways to assign the numbers 1 to n to k vertices such that each vertex has at least one number assigned to it. But this overcounts slightly: in fact, we need to divide by a1 !a2 ! . . . an ! in order to account for permutations of the branches of equal length. So X Tn = k!S(n, k)Ak k≥0

To finish, X XX X X X ex −1 xn xn xn = = k!Ak = Ak (ex − 1)k = e 2−ex , Tn · k!S(n, k)Ak · S(n, k) · n! n! n! n≥0

n≥0 k≥0

by Lemma 1. Here we used the fact that

k≥0

P

n≥0

n≥0

S(n, k) ·

14

xn n!

k≥0

=

(ex −1)k . k!

The Online Math Open Fall Contest Official Solutions October 17 - 28, 2014

Acknowledgements Head Problem Writers • Evan Chen

• Michael Kural • Sammy Luo • Yang Liu

• Robin Park

• Ryan Alweiss

Problem Contributors, Proofreaders, and Test Solvers • Ray Li

• Victor Wang • Jack Gurev

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

OMO Fall 2014 Official Solutions 1. Carl has a rectangle whose side lengths are positive integers. This rectangle has the property that when he increases the width by 1 unit and decreases the length by 1 unit, the area increases by x square units. What is the smallest possible positive value of x? Proposed by Ray Li. Answer. 1 . Solution. If the intial length and width are a and b, respectively, then x = (a − 1)(b + 1) − ab = ab − b + a − 1 − ab = −b + a − 1, so choosing b = 1, a = 3 yields x = 1, the minimum possible positive integer. 2. Suppose (an ), (bn ), (cn ) are arithmetic progressions. Given that a1 + b1 + c1 = 0 and a2 + b2 + c2 = 1, compute a2014 + b2014 + c2014 . Proposed by Evan Chen. Answer. 2013 . Solution. Let sn = an + bn + cn . We observe that sn is also an arithmetic progression. From s1 = 0 and s2 = 1, we get that sn = n − 1, so s2014 = 2013. 3. Let B = (20, 14) and C = (18, 0) be two points in the plane. For every line ` passing through B, we color red the foot of the perpendicular from C to `. The set of red points enclose a bounded region of area A. Find bAc (that is, find the greatest integer not exceeding A). Proposed by Yang Liu. Answer. 157 . Solution. For any possible red point F , ∠BF C = π2 , so F lies on the circle with diameter BC. Conversely, any point on this circle can be formed by√some projection onto a line through B, so the set of red points is simply this circle. It has diameter 22 + 142 , so its area is  1 2 2 + 142 π = 50π. 4 4. A crazy physicist has discovered a new particle called an emon. He starts with two emons in the plane, situated a distance 1 from each other. He also has a crazy machine which can take any two emons and create a third one in the plane such that the three emons lie at the vertices of an equilateral triangle. After he has five total emons, let P be the product of the 52 = 10 distances between the 10 pairs of emons. Find the greatest possible value of P 2 . Proposed by Yang Liu. Solution. When we have 3 emons, they form an equilateral triangle. Then we the physicist adds a fourth emon, they form a rhombus with angles 60◦ , 120◦ . For adding the fifth emon we have 2 cases: using the long diagonal of the rhombus, or using a side of the rhombus. E

C D

A B

1

OMO Fall 2014 Official Solutions √ √ √ In the first case (using the long diagonal), we get that the ten lengths are: 1, 1, 1, 1, 1, 1, 3, 3, 3, 2, so P 2 = 108. C

D

B

E

A

√ √ In the second case (using a side of the rhombus), we get that the lengths are 1, 1, 1, 1, 1, 1, 1, 3, 3, 2, so P 2 = 36. So our maximum value is 108. 5. A crazy physicist has discovered a new particle called an omon. He has a machine, which takes two omons of mass a and b and entangles them; this process destroys the omon with mass a, preserves the one with mass b, and creates a new omon whose mass is 12 (a + b). The physicist can then repeat the process with the two resulting omons, choosing which omon to destroy at every step. The physicist initially has two omons whose masses are distinct positive integers less than 1000. What is the maximum possible number of times he can use his machine without producing an omon whose mass is not an integer? Proposed by Michael Kural. Answer. 9 . Solution. Consider the difference in the mass between the two particles. At each step, it becomes cut in half, so in order for it to remain an integer at each step, we want the intial difference to be divisible by the greatest power of 2 possible. This greatest possible power of 2 dividing the difference is clearly 512 = 29 , so the maximal number of times he can use his machine is 9, which can be obtained if we start with omons of mass 1 and 513 and arbitrarily destroy an omon at each step. 6. For an olympiad geometry problem, Tina wants to draw an acute triangle whose angles each measure a multiple of 10◦ . She doesn’t want her triangle to have any special properties, so none of the angles can measure 30◦ or 60◦ , and the triangle should definitely not be isosceles. How many different triangles can Tina draw? (Similar triangles are considered the same.) Proposed by Evan Chen. Answer. 0 . Solution. Suppose the triangle has angles 10a < 10b < 10c < 90 in degrees. Then a < b < c < 9 and a + b + c = 18. We now consider several cases. • If c = 8, we have a + b = 10 and a < b ≤ 7. This gives (a, b) = (3, 7) and (a, b) = (4, 6), neither of which work. • If c = 7, we have a + b = 11 and a < b ≤ 6. The only possibility here is (a, b) = (5, 6), which also fails. • If c ≤ 6, then a, b < 6, so a + b + c < 18. Hence no solutions can occur with c ≤ 6. Hence, Tina unfortunately cannot draw any triangles and the answer is 0.

2

OMO Fall 2014 Official Solutions 7. Define the function f (x, y, z) by z

y

x

z

y

f (x, y, z) = xy − xz + y z − y x + z x . Evaluate f (1, 2, 3) + f (1, 3, 2) + f (2, 1, 3) + f (2, 3, 1) + f (3, 1, 2) + f (3, 2, 1). Proposed by Robin Park. Answer. 24 . x

Solution. Let g(x, y, z) = f (x, y, z) − z y . By symmetry, we have that g(1, 2, 3) + g(1, 3, 2) + g(2, 1, 3) + g(2, 3, 1) + g(3, 1, 2) + g(3, 2, 1) = 0, and so f (1, 2, 3) + f (1, 3, 2) + f (2, 1, 3) + f (2, 3, 1) + f (3, 1, 2) + f (3, 2, 1) = g(1, 2, 3) + g(1, 3, 2) + g(2, 1, 3) + g(2, 3, 1) + g(3, 1, 2) + g(3, 2, 1) 3

2

3

1

2

1

+ (12 + 13 + 21 + 23 + 31 + 32 ) = 24. 8. Let a and b be randomly selected three-digit integers and suppose a > b. We say that a is clearly bigger than b if each digit of a is larger than the corresponding digit of b. If the probability that a is clearly bigger than b is m n , where m and n are relatively prime integers, compute m + n. Proposed by Evan Chen. Answer. 1061 . Solution. Compute 9 2



 10 2 2  900 2 ·

=

162 36 · 452 = . 450 · 899 899

The numerator represents the number of ways to select a pair of hundreds digits, tens digits, and unit digits in a pair of clearly bigger numbers. The denominator represents the total number of pairs a > b of three-digit numbers. Hence the answer is 162 + 899 = 1061. 9. Let N = 2014!+2015!+2016!+· · ·+9999!. How many zeros are at the end of the decimal representation of N ? Proposed by Evan Chen. Answer. 501 . Solution. Let νp (n) denote the exponent of p in the prime factorization of n.We seek min (ν2 (N ), ν5 (N )). We can see that

N = 1 + 2015 + 2015 · 2016 + 2015 · 2016 · 2017. 2014!

N Hence we see that 2014! is an integer not divisible by 5. So ν5 (N ) = ν5 (2014!). By Legendre’s Formula1 , 2014−10 this is = 501 (observe that 2014 = 310245 ). And it is easy to check that ν2 (2014!) > 501, so 4 ν2 (N ) > 501 as well. Hence the answer is 501.

1 See

http://www.aops.com/Wiki/index.php/Legendre’s_Formula, for example.

3

OMO Fall 2014 Official Solutions 10. Find the sum of the decimal digits of   51525354555657 . . . 979899 . 50 Here bxc is the greatest integer not exceeding x.

Proposed by Evan Chen. Answer. 457 .

Solution. It’s not hard to check that the resulting quotient is N = 0103 . . . 97 (where we have adding a leading 0). If we consider N 0 which is N with 99 appended to the right, then we obtain a 100-digit number for which the average of the odd-indexed digits is 4.5 and the average of the even-indexed digits is 5. So, the sum of the digits of N 0 is 9.5 · 50 = 475.

0Hence the final answer is 475 − 18 = 457.

11. Given a triangle ABC, consider the semicircle with diameter EF on BC tangent to AB and AC. If BE = 1, EF = 24, and F C = 3, find the perimeter of 4ABC. Proposed by Ray Li. Answer. 84 . Solution. Let M be the midpoint of EF and let the semicircle be tangent to AB, AC at X, Y . A

Y X BE

M

F

C

It is easy to see that BM = 13, so BX = 5. Similarly, CM = 15, so CY = 9. Now let AX = AY = k. Thus AB = k + 5 and AC = k + 9, and then AM 2 = k 2 + 122 . Finally, BC = 28. Apply Stewart’s Theorem to obtain  k 2 + 122 + 13 · 15 · 28 = (k + 5)2 · 15 + (k + 9)2 · 13. Solving, we find that k = 21. So AB + AC + BC = 2k + 14 + 28 = 84. 12. Let a, b, c be positive real numbers for which 5 = b + c, a If a + b + c =

m n

10 = c + a, b

and

13 = a + b. c

for relatively prime positive integers m and n, compute m + n.

Proposed by Evan Chen. Answer. 55 .

4

OMO Fall 2014 Official Solutions Solution. We get ab + ac = 5, bc + ba = 10, ca + cb = 13, so ab + bc + ca = √ we have ab = 1, bc = 9, ca = 4. Thus abc = 1 · 4 · 9 = 6 and a+b+c=

5+10+13 2

= 14. Therefore,

6 6 6 49 + + = . 1 4 9 6

So the answer is 49 + 6 = 55. 13. Two ducks, Wat and Q, are taking a math test with 1022 other ducklings. The test has 30 questions, and the nth question is worth n points. The ducks work independently on the test. Wat gets the 1 nth problem correct with probability n12 while Q gets the nth problem correct with probability n+1 . Unfortunately, the remaining ducklings each answer all 30 questions incorrectly. Just before turning in their test, the ducks and ducklings decide to share answers! On any question which Wat and Q have the same answer, the ducklings change their answers to agree with them. After this process, what is the expected value of the sum of all 1024 scores? Proposed by Evan Chen. Answer. 1020 . Solution. By linearity of expectation, it suffices to sum the expected value of the scores for each question. We see that the sum is 30 X n=1

 n·

1 1022 1 + + n2 n + 1 n2 (n + 1)



30  X 1

  1 1 1 = +1− + 1022 − n n+1 n n+1 n=1  30  X 1 1 = 30 + 1023 − n n+1 n=1   1 1 = 30 + 1023 − 1 31 = 30 + 1023 − 33 = 1020.

14. What is the greatest common factor of 12345678987654321 and 12345654321? Proposed by Evan Chen. Answer. 12321 . Solution. Observe that the numbers in the problem are 1111111112 and 1111112 (with nine and six ones). So we seek gcd(111111111, 111111)2 . By the Euclidean Algorithm, this is gcd(111000000, 111111)2 = gcd(111, 111111)2 = 12321. √

15. Let φ = 1+2 5 . A base-φ number (an an−1 . . . a1 a0 )φ , where 0 ≤ an , an−1 , . . . , a0 ≤ 1 are integers, is defined by (an an−1 . . . a1 a0 )φ = an · φn + an−1 · φn−1 + . . . + a1 · φ1 + a0 . Compute the number of base-φ numbers (bj bj−1 . . . b1 b0 )φ which satisfy bj 6= 0 and (bj bj−1 . . . b1 b0 )φ = (100 . . . 100)φ . {z } | Twenty 1000 s

Proposed by Yang Liu. Answer. 1048576 . 5

OMO Fall 2014 Official Solutions Solution. Since φ2 = φ + 1, we can do the following transformation: 100φ → 011φ . I claim that in (100 . . . 100)φ , for each of the 20 1000 s, we can choose whether to change it to 011, so this gives at least | {z } Twenty 1000 s

220 equivalent numbers. I claim that these are the only ones. Consider the first 2 1000 s in the string of twenty. If we apply the transformation to the first 100, it becomes 011, but no matter what we do to the second one, neither 1 in the 011 will have 2 zeroes after it; therefore, we can’t apply the transformation anymore. So our final answer is just 220 = 1048576. 16. Let OABC be a tetrahedron such that ∠AOB = ∠BOC = ∠COA = 90◦ and its faces have integral surface areas. If [OAB] = 20 and [OBC] = 14, find the sum of all possible values of [OCA][ABC]. (Here [4] denotes the area of 4.) Proposed by Robin Park. Answer. 22200 . Solution. The 3D Pythagorean Theorem (also called De Gua’s Theorem) states that the sum of the squares of the areas of the faces of a right-angled tetrahedron adjacent to the right angle is equal to the square of the area of the face opposite to it; in other words, [OAB]2 + [OBC]2 + [OCA]2 = [ABC]2 . Let u = [OCA] and v = [ABC]. Then (v − u)(v + u) = v 2 − u2 = 596 = 4 · 149, and since the parities of v − u and v + u must be the same, v + u = 2 · 149 and v − u = 2. Thus the only integer solution (u, v) is (150, 148), and so our answer is 150 · 148 = 22200. 17. Let ABC be a triangle with area 5 and BC = 10. Let E and F be the midpoints of sides AC and AB respectively, and let BE and CF intersect at G. Suppose that quadrilateral AEGF can be inscribed in a circle. Determine the value of AB 2 + AC 2 . Proposed by Ray Li. Answer. 200 . Solution 1. Let M be the midpoint of side BC and let G0 be the reflection of G over A. By considering the homothety at A with ratio 2, we see that G0 lies on the circumcircle of ABC. A

E

F G B

C

M G0

A0

By Power of a Point, we have AM · M G0 = BM · M C = 52 = 25.

√ But M G0 = M G = 31 AM (since G is the centroid), so we derive that AM = 5 3. 6

OMO Fall 2014 Official Solutions Now let us reflect A over M to A0 , yielding parallelogram ABA0 C. It is a well known fact about parallelograms that we have BC 2 + AA02 = 2(AB 2 + AC 2 ). We know AA02 = 4 · AM 2 , so the answer to the question is 21 BC 2 + 2AM 2 = 50 + 150 = 200. Solution 2. As before we see that G0 lies on the circumcircle of ABC. The barycentric coordinates of G0 are thus G0 = (2 : 2 : −1). Letting a = BC, b = CA, c = AB and using the circumcircle formula, we detect −a2 (2)(2) − b2 (−1)(2) − c2 (2)(−1) = 0. Hence, b2 + c2 = 2a2 = 200.

Solution 3. The concyclicity of AEGF implies ∠AEG + ∠AF G = 180◦ so ∠AEB + ∠AF C = 180◦ implying that there is a point X on BC such that ∠AXC = ∠AF C and ∠AXB = ∠AEB. So AEXB, AF XC are concyclic, implying BC · BX = BF · BA =

1 BA2 2

BC · CX = CE · CA =

1 CA2 2

so upon adding these together, we recover BC 2 = BC(BX + CX) =

1 (AB 2 + AC 2 ) 2

Thus our answer is 2BC 2 = 200. Comment. The condition that the area of ABC is 5 is extraneous. 18. We select a real number α uniformly and at random from the interval (0, 500). Define S=

 1000 1000  1 X X m+α . α m=1 n=m n

Let p denote the probability that S ≥ 1200. Compute 1000p. Proposed by Evan Chen. Answer. 5 . Solution. Define c = bαc. Switch the order of summation: 1000 a  XX a=1 b=1

 b+c . a

One can check that in fact (say, using the Hermite identity) that we have  a  X b+c b=1

a

for every a. 7

=1+c

OMO Fall 2014 Official Solutions Hence

c+1 1− = 1000 + 1000 · , c+ c+

S = 1000 ·

where  = α − c. Hence S ≥ 1200 is just 5 − 5 ≥ c +  or  ≤ 5−c 6 . Over c = 0, 1, . . . , 4 the intervals 1 for which S ≥ 1200 sum to 52 . Hence 1000p = 1000 · 25 · 500 = 5. 19. In triangle ABC, AB = 3, AC = 5, and BC = 7. Let E be the reflection of A over BC, and let line BE meet the circumcircle of ABC again at D. Let I be the incenter of 4ABD. Given that cos2 ∠AEI = m n , where m and n are relatively prime positive integers, determine m + n. Proposed by Ray Li. Answer. 55 . Solution. By construction, C is the midpoint of arc AD not containing B. Hence, it follows that IC = IA = ID. Moreover it is easy to see that ∠IAE = ∠IEA. 3

2

One can use Stewart’s theorem to compute AI 2 = 5 ·3+2 7·5−2·5·7 = 25 7 . By Heron’s formula, the area √ √ 15 3, so the height from A to BC has length 3. Then of ABC is 15 4 14 2

cos ∠IAE =

15 14

√ 2 3 25 7

=

27 . 28

Thus the answer is 27 + 28 = 55. (0)

(0)

(0)

20. Let n = 2188 = 37 + 1 and let A0 , A1 , . . . , An−1 be the vertices of a regular n-gon (in that order) (i) with center O . For i = 1, 2, . . . , 7 and j = 0, 1, . . . , n − 1, let Aj denote the centroid of the triangle (i−1)

4Aj

(i−1)

(i−1)

Aj+37−i Aj+2·37−i .

Here the subscripts are taken modulo n. If (7)

|OA2014 |

(0) |OA2014 |

=

p q

for relatively prime positive integers p and q, find p + q. Proposed by Yang Liu. Answer. 2188 . (i)

Solution. We use vectors/complex numbers. Let aj centroid is just the average of the vertices, (i)

aj =

(i)

be the number at the point Aj . Since the

1 (i−1) (i−1) (i−1) (a + aj+37−i + aj+2·37−i ). 3 j

P3i −1 (0) (i) I claim now that aj = 31i k=0 aj+37−i ·k . This readily follows from induction and the above stateP3i −1 (0) (7) (0) 1 1 ment. So a2014 = 2187 k=0 aj+37−i ·k = − 2187 a2014 . (7)

Therefore,

|a2014 | (0)

|a2014 |

=

1 2187

=⇒ 1 + 2187 = 2188.

8

OMO Fall 2014 Official Solutions 21. Consider a sequence x1 , x2 , · · · x12 of real numbers such that x1 = 1 and for n = 1, 2, . . . , 10 let xn+2 =

(xn+1 + 1)(xn+1 − 1) . xn √

Suppose xn > 0 for n = 1, 2, . . . , 11 and x12 = 0. Then the value of x2 can be written as positive integers a, b, c with a > b and no square dividing a or b. Find 100a + 10b + c.

√ a+ b c

for

Proposed by Michael Kural. Answer. 622 . Solution 1. We can rearrange the given condition as xn xn+2 + 1 = x2n+1 . By Ptolemy’s theorem, this statement is equivalent to the existence of an isosceles trapezoid ABCD satisfying AB = CD = 1, AC = BD = xn+1 , BC = xn , and AD = xn+2 . So now consider the points A0 , A1 , · · · A12 on a circle with A0 A1 = A1 A2 = · · · A11 A12 = 1, A0 A2 = x2 . Then by Ptolemy’s theorem on each trapezoid A0 A1 An An+1 , it follows inductively that A0 An = xn for each 1 ≤ n ≤ 12. (Note in particular that the condition xn ≥ 0 for 1 ≤ n ≤ 12 implies by the form of Ptolemy that each trapezoid is in the ”correct” order: that is, there is no n with A0 between An and An+1 .) So x12 = 0 is equivalent to A12 = A0 , or A0 A1 · · · A11 being a regular 12-gon. Thus A0 A1 A2 is a 15◦ − 15◦ − 150◦ triangle, and it follows that √ √ 6+ 2 ◦ x2 = 2 cos 15 = 2 and the answer is 622. Solution 2. Suppose we had x2 > 2, so in particular x2 > x1 + 1. Note that if xn+1 > xn + 1, then xn+2 =

(xn+1 + 1)(xn+1 − 1) (xn+1 + 1)xn > = xn+1 + 1. xn xn

So inductively, xn+1 > xn + 1 for all positive integers n. But this is impossible if x12 = 0. Thus we must have had x2 ≤ 2.

So now let x2 = 2 cos α. In particular, x2 =

sin 2α sin α

xn =

and x1 =

sin α sin α .

We claim, by induction, that

sin nα sin α

We have the trigonometric identity 2



sin(x) sin(y) = sin

x+y 2



2

− sin



x−y 2



so in particular sin nα sin(n + 2)α = sin2 (n + 1)α − sin2 α     2 sin nα sin(n + 2)α sin(n + 1)α ⇒ = −1 sin α sin α sin α and the claim holds by induction. So now we have sin 12α = 0 and sin nα > 0 for 0 < n < 12. Thus 12α = 180◦ ⇒ α = 15◦ . Thus √ √ sin 30◦ 6+ 2 x2 = = sin 15◦ 2 and the answer is 622. 9

OMO Fall 2014 Official Solutions Comment. If x2 = x, xn = Un−1 kind.

x 2



, where Un (x) is the nth Chebyshev Polynomial of the second

22. Find the smallest positive integer c for which the following statement holds: Let k and n be positive integers. Suppose there exist pairwise distinct subsets S1 , S2 , . . . , S2k of {1, 2, . . . , n}, such that Si ∩ Sj 6= ∅ and Si ∩ Sj+k 6= ∅ for all 1 ≤ i, j ≤ k. Then 1000k ≤ c · 2n . Proposed by Yang Liu. Answer. 334 . Solution. Let S = {S1 , S2 , . . . , S2k }, and let X be the set of subsets of {1, 2, . . . , n} that are not any of S1 , S2 , . . . , S2k . For any 1 ≤ i ≤ k, Si does not intersect any of S1 , S2 , . . . , S2k , the complement of Si must lie in X. Therefore, |X| ≥ k. But 3k = |S| + |X| ≤ 2n , so a lower bound for c is d1000/3e = 334.  2n for Now we construct the bound. Firstly, note that there exists a constant C such that nk ≤ C · √ n every n, k (1). Now take an x such that           1 C C n n n 1 −√ +√ · 2n ≤ + + ··· + ≤ · 2n . 3 3 n n−1 n−x n n 1 As n approaches infinity, we can get arbitrarily constant  close  to our desired   of 3 , so I’ll njust  use the n n n n n symbol ≈ for the rest of the solution. Then 0 + 1 + · · · + x = n + n−1 + · · · + n−x ≈ 13 · 2n , so    n n n 1 n n−x−1 + n−x−2 + . . . + x+1 ≈ 3 · 2 , too. Therefore, just let S1 , S2 , . . . , Sk be the sets of size n, n − 1, . . . , n − x and Sk+1 , Sk+2 , . . . , S2k be the sets of size n − x − 1, n − x − 2, . . . , x + 1. Each of S1 , S2 , . . . , Sk are size at least n − x and each of the sets Sk+1 , Sk+2 , . . . , S2k are of size x + 1. Since x + 1 + n − x = n + 1 > n, each pair intersects. So k ≈ 31 · 2n , giving the construction.

23. For a prime q, let Φq (x) = xq−1 + xq−2 + · · · + x + 1. Find the sum of all primes p such that 3 ≤ p ≤ 100 and there exists an odd prime q and a positive integer N satisfying     N 2Φq (p) ≡ 6≡ 0 (mod p). Φq (p) N Proposed by Sammy Luo. Answer. 420 . Solution. Let N = aq−1 pq−1 + aq−2 pq−2 + · · · + a1 p + a0 be the base-p representation of N . By Lucas’ Theorem,           N aq−1 pq−1 + aq−2 pq−2 + · · · + a1 p + a0 aq−1 aq−2 a1 a0 ≡ ≡ · · · q−1 q−2 Φq (p) p +p + ··· + p + 1 1 1 1 1 and 

         2Φq (p) 2pq−1 + 2pq−2 · · · + 2p + 1 2 2 2 2 ≡ ≡ ··· . N aq−1 pq−1 + aq−2 pq−2 + · · · + a1 p + a0 aq−1 aq−2 a1 a0

Since we do not want either of these to be equivalent to 0 modulo p, each of ai must equal 1 or 2. Suppose that there are k 2’s in the ai . Then     N 2Φq (p) ≡ =⇒ 2k ≡ 2q−k (mod p). Φq (p) N Thus, ordp (2)|p − 2k. Since k ≤ q is arbitrary, a prime p works if and only if ordp (2) is odd. 10

OMO Fall 2014 Official Solutions We need p|2r − 1 for some odd r, so 2 must be a quadratic residue mod p. That is, p ≡ ±1 (mod 8). If p ≡ −1 (mod 8), setting r = p−1 2 works due to Fermat’s Little Theorem. Thus, the primes 7, 23, 31, 47, 71, and 79 work. The remaining candidates are primes that are 1 (mod 8), which are 17, 41, 73, 89, and 97. We may check these by seeing if the largest odd factor of p − 1 works for r. We have 29 − 1 = 7 · 73 and 211 − 1 = 23 · 89, so 73 and 89 both work, but none of the others do. Our answer is 7 + 23 + 31 + 47 + 71 + 73 + 79 + 89 = 420.

24. Let A = A0 A1 A2 A3 · · · A2013 A2014 be a regular 2014-simplex, meaning the 2015 vertices of A lie in 2014-dimensional Euclidean space and there exists a constant c > 0 such that Ai Aj = c for any 0 ≤ i < j ≤ 2014. Let O = (0, 0, 0, . . . , 0), A0 = (1, 0, 0, . . . , 0), and suppose Ai O has length 1 for i = 0, 1, . . . , 2014. Set P = (20, 14, 20, 14, . . . , 20, 14). Find the remainder when P A20 + P A21 + · · · + P A22014 is divided by 106 . Proposed by Robin Park. Answer. 348595 . − → −−→ → − −−→ Solution 1. Denote by Ak the vector OAk and by P the vector OP , where O is the origin. Note that P A20 + P A21 + · · · + P A22014 = =

2014 X k=0 2014 X k=0

=

2014 X k=0

− → → − − → → −  (Ak − P ) · (Ak − P ) − → − → − → → − → − → − Ak · Ak − 2Ak · P + P · P 2014

2014

k=0

k=0

X → − → − → − X− → |Ak |2 + | P |2 − 2 P · Ak

= 2015 + 2015(202 + 142 + 202 + 142 + · · · + 202 + 142 ) − 0 = 2015(1 + 1007(202 + 142 )) = 1209348595

because a regular simplex is symmetric. Hence our answer is 348595. Solution 2. Define f (P ) = (P, σ1 )−(P, σ2 ), where (P, σ) denotes the power of P with respect to 2013sphere σ. Let σ1 be the 2013-sphere centered at P with radius r and let σ2 be the unit 2013-sphere centered at the origin O. We use the following lemma: Lemma 1. The function f (P ) is linear. Proof. Let σ1 be centered at (a1 , a2 , . . . , a2014 ) with radius r1 , and let σ2 be centered at (b1 , b2 , . . . , b2014 ) with radius r2 . If P = (x1 , x2 , . . . , x2014 ), then f (P ) = (P, σ1 ) − (P, σ2 )

= (x1 − a1 )2 + · · · + (x2014 − a2014 )2 − (x1 − b1 )2 − · · · − (x2014 − b2014 )2 − r12 + r22 =

2014 X i=1

(−2ai xi + 2bi xi + a2i − b2i ) − r12 + r22 .

The quadratic terms cancel, and so we are left with the linear terms of xi , implying that f is linear.

11

OMO Fall 2014 Official Solutions Note that 2014 X

P A2i

=

i=0

2014 X

2

2

(f (Ai ) + r ) = 2014r + f

i=0

2014 X

! Ai

i=0

P2014

2

Ai 2015

!

i=0

= 2014r + 2015f = 2014r2 + 2015f (O)

= 2014r2 + 2015((1007(202 + 142 ) − r2 ) − (02 − 12 )) = 1209348595.

Hence the answer is 348595. 25. Kevin has a set S of 2014 points scattered on an infinitely large planar gameboard. Because he is bored, he asks Ashley to evaluate x = 4f4 + 6f6 + 8f8 + 10f10 + · · · while he evaluates y = 3f3 + 5f5 + 7f7 + 9f9 + · · · ,

where fk denotes the number of convex k-gons whose vertices lie in S but none of whose interior points lie in S. However, since Kevin wishes to one-up everything that Ashley does, he secretly positions the points so that y − x is as large as possible, but in order to avoid suspicion, he makes sure no three points lie on a single line. Find |y − x|. Proposed by Robin Park. Answer. 4054179 . Solution. Let A and B be arbitrary points in S. Define fk,AB as the number of empty convex k-gons C lying on the “right” of line AB, where AB is an edge of C. Then X 3f3 − 4f4 + 5f5 − 6f6 + · · · = (f3,AB − f4,AB + f5,AB − f6,AB + · · · ) A,B∈S

because any given convex k-gon will be counted k times, once for each one of its edges. B C

B



D

A

C

D

A

We claim that the value of f3,AB − f4,AB + f5,AB − · · · only depends on the number of points that lie to the right of AB. We prove this by moving a point C through AB and noticing that the desired value stays constant. Let D be a convex k-gon containing AB as an edge. When we move C through segment AB, the number of k-gons decreases by 1 (D itself), but the number of (k + 1)-gons also decreases by 1 (D adjoined to C); thus, f3,AB − f4,AB + f5,AB − · · · stays constant. In addition, if C moves around on the left without crossing AB, a similar argument shows that the value stays the same. Hence we may assume that A, B, and all p points lying to the right of line AB form a convex k-gon, implying that       p p p f3,AB − f4,AB + f5,AB − f6,AB + · · · = − + − ··· 1 2 3 12

OMO Fall 2014 Official Solutions which is 0 only when p = 0 and 1 when p > 0. Thus,   n 3f3 − 4f4 + 5f5 − 6f6 + · · · = 2 − CS , 2 where n is the number of points in S and CS is the number of points on the convex hull of S. In this problem, n = 2014 and min CS = 3, so our answer is 2 2014 − 3 = 4054179. 2 26. Let ABC be a triangle with AB = 26, AC = 28, BC = 30. Let X, Y , Z be the midpoints of arcs BC, CA, AB (not containing the opposite vertices) respectively on the circumcircle of ABC. Let P be the midpoint of arc BC containing point A. Suppose lines BP and XZ meet at M , while lines CP and XY meet at N . Find the square of the distance from X to M N . Proposed by Michael Kural. Answer. 325 . Solution. Let I be the incenter. By Pascal’s Theorem on hexagon P BY XZC, I lies on M N . P Y

A

N

Z I M B

C

X

Consider 4BIZ, which is isosceles. We have ∠M IB = ∠M BI = ∠P BY , and one can check this is equal to ∠ICB. Hence M I is tangent to the circumcircle of triangle BIC, as is N I. So M N is the tangent. Since X is the desired circumcenter, we have that I is the foot of the altitude from X to M N . Now we can compute IX = BX = BC · √3 , 13

sin 12 ∠A sin A

=

hence BX 2 = 325.

cos

15 . 1 2 ∠A

Standard computations give that cos 12 ∠A =

Comment. The use of Pascal is actually not necessary for the solution. Noting that M I, IN are both tangent to the circumcircle of BIC shows that M, I, N are collinear, and that M N is the tangent. 27. Let p = 216 + 1 be a prime, and let S be the set of positive integers not divisible by p. Let f : S → {0, 1, 2, . . . , p − 1} be a function satisfying f (x)f (y) ≡ f (xy) + f (xy p−2 )

(mod p)

and f (x + p) = f (x)

for all x, y ∈ S. Let N be the product of all possible nonzero values of f (81). Find the remainder when when N is divided by p. Proposed by Yang Liu and Ryan Alweiss. Answer. 16384 . 13

OMO Fall 2014 Official Solutions Solution. Let y −1 = 1/y denote the inverse of y (mod p). From now on, we’ll work in Z/pZ, or Fp . Then our functional equation is equivalent to f (x)f (y) = f (xy)+f (x/y), since y p−2 = y −1 by Fermat’s Little Theorem. Let P (x, y) be the assertion f (x)f (y) = f (xy) + f (x/y). I claim that all functions satisfying this equation are of the form f (x) = xs + x−s for integers s. Firstly, the assertion P (1, 1) gives that f (1)2 = 2f (1), so either f (1) = 0 or f (1) = 2. If f (1) = 0, then the assertion P (x, 1) gives 0 = 2f (x) =⇒ f (x) = 0 for all x. Since we only care about the product of the nonzero values, we can ignore this case. So f (1) = 2. Lemma: 3 is a primitive root (mod p). 15

It suffices to show that 32

≡ −1 (mod p). This follows from     15 p 3 = −1 = 32 ≡ p 3

, by the Quadratic Reciprocity Law. Now, let k be a positive integer, and look at the assertion P (3k , 3). This gives P (3k )P (3) = P (3k+1 ) + P (3k−1 ) (*), for any integer k ≥ 1. Let f (3) =√g, and find an ω such that f (3) = ω + ω −1 . We can

solve, using the quadratic formula that ω =

g+

g 2 −4 . 2

If g 2 − 4 is a perfect square (mod p), then ω is in Fp . We have another case, though, where g 2 − 4 is not√a perfect square (mod p). Let c = g 2 − 4. In this case, consider all numbers of the form a + b √c, where√0 ≤ a, b ≤ p − 1. Since√c is not a square, all these numbers are distinct. Also, (a + b c)(d + e c) = ad + bec + (ae + bd) c, so these numbers are closed under multiplication. Since they are obviously also closed under addition, these numbers form a field of order p2 , so we’ll just call this set of numbers Fp2 . We’ll work in this field from now on. Using f (1) = 2, f (3) = ω +ω −1 , we can use induction and (*) to show that f (3k ) = ω k +ω −k . Choosing k = p − 1, we get that 2 = f (1) = f (3p−1 ) = ω p−1 + ω −(p−1) . Solving gives that ω p−1 = 1, so ω satisfies the polynomial xp−1 − 1. Since the polynomial can have at most p − 1 roots in Fp2 , and the integers 1, 2, . . . , p − 1 are roots, ω must lie in Fp , contradicting our assumption that g 2 − 4 is not a perfect square. So f (3) = ω + ω −1 for some ω ∈ Fp . Since 3 is a primitive, root, we can find a k such that 3k = ω, so f (3) = 3k + 3−k for some k. Therefore, f (81) = 34k + 3−4k . These values are distinct for k = p−1 0, 1, . . . , p−1 8 , excluding the value 16 , so it suffices to compute Y p−1 0≤i≤ p−1 8 ,i6= 16

(34i + 3−4i ) = −2 ·

Y p−1 0≤i< p−1 8 ,i6= 16

(38i + 1) . 34i

To evaluate this sum, consider the polynomial Y p−1 0≤i< p−1 8 ,i6= 16

For 0 ≤ i < p−1 1−x 8

x+1

p−1 8 ,

(38i − x) . 34i

38i are roots of this polynomial except when 38i = −1, this numerator simplifies to

, since it satisfies the same properties, and has the same number of roots. The denominator

simplifies to 3

(p−1)(p−5) 8

≡ −1 (mod p). (Since 215 || (p−1)(p−5) ). 8

p−1

8 So to find our desired product, we must find the value of 1−x at x = −1. Applying L’Hopital’s x+1 rule, this easily evaluates to − p−1 . Therefore, our final product is 8

−2 ·

Y p−1 0≤i< p−1 8 ,i6= 16

(38i + 1) p−1 = −2 · · −1 = 16384. 34i 8 14

OMO Fall 2014 Official Solutions 28. Let S be the set of all pairs (a, b) of real numbers satisfying 1 + a + a2 + a3 = b2 (1 + 3a) and 1 + 2a + 3a2 = b2 − 5b . Find A + B + C, where A=

Y

a,

Y

B=

(a,b)∈S

b,

X

and C =

(a,b)∈S

ab.

(a,b)∈S

Proposed by Evan Chen. Answer. 2 . Solution. First remark that (a, b) = (1, −1) is a solution. Let z = a − bi. Adding the first equation to −bi times the second equation yields z 3 + z 2 + z = −1 + 5i. Factoring out z − (1 + i) since (1, −1) was a solution, we obtain z 2 + (2 + i)z + (2 + 3i) = 0. Use Vieta now; if the remaining solutions are (a1 , a2 ) and (b1 , b2 ) then we know that a1 + a2 = −2 b1 + b2 = 1

a1 a2 − b2 b1 = 2

a1 b2 + a2 b1 = −3

From here it is easy to derive a1 b1 +a2 b2 = (−2)(1)−(−3) = 1. Thus C = 1+1(−1) = 0. Furthermore, A + B = a1 a2 (1) + b1 b2 (−1) = 2. 29. Let ABC be a triangle with circumcenter O, incenter I, and circumcircle Γ. It is known that AB = 7, \ of Γ, and let D denote the intersection BC = 8, CA = 9. Let M denote the midpoint of major arc BAC of Γ with the circumcircle of 4IM O (other than M ). Let E denote the reflection of D over line IO. Find the integer closest to 1000 · BE CE . Proposed by Evan Chen. Answer. 467 . Solution. Let MA be the midpoint of minor arc BC. M

A D

O

I

M1

B

E

MA

K

C

F

Let a = BC, b = CA, c = AB and observe that 2a = b + c. By Ptolemy’s Theorem, we obtain BC · AMA = (AB + AC) · IMA 15

OMO Fall 2014 Official Solutions where we have used the fact that IMA = IB = IC. It follows that IMA = 12 AMA , so I is the midpoint of AMA . (This was also HMMT February Team Round 2013, Problem 6). Now let the tangents to the circumcircle of ABC at M meet line AI at X (not shown). Evidently X lies on the circumcircle of 4IM O, since ∠OM X = ∠OIX = 90◦ . So XD is also a tangent to the circumcircle of ABC. Next, notice that DE k AMA , as both lines are perpendicular to line OI. So it follows that by JMO 2011 Problem 5 that line EM bisects line AMA , meaning that E, I, M are collinear. That means E is the tangency point of the A-mixtilinear incircle with the circumcircle of ABC, by an Iran 2002 problem2 . Now let the A-excircle be tangent to BC at K. Then from EGMO 2013, Problem 5,3 we find that ∠CAK = ∠BAE. So if we extend ray AK to meet the circumcircle at F , we get that BE = CF , BF = CE. Let s = 21 (a + b + c). We have BK CK = CF 1000 · BF , so the requested ratio is.

s−c s−b ,

from which it follows that

CF BF

=

c(s−b) b(s−c) .

Hence 1000 BE CE =

7·3 2 c(s − b) = 1000 · = 466 + b(s − c) 9·5 3

1000 · and the answer is 467.

30. Let p = 216 + 1 be an odd prime. Define Hn = 1 + (p − 1)!

p−1 X n=1

1 2

+

Hn · 4n ·

1 3

+ . . . + n1 . Compute the remainder when



2p − 2n p−n



is divided by p. Proposed by Yang Liu. Answer. 32761 . Solution. For the whole solution, = means that the 2 quantities are equal, and ≡ means that I have used the (mod p) operation.   p+n p+n−1 The first step is to notice that 1 + pHn ≡ p+n (mod p2 ). This is true because p+n = n · n−1 · n n     p+1 p p p 2 . . . · 1 = 1 + n 1 + n−1 . . . 1 + 1 ≡ 1 + pHn (mod p ). Let S=

p−1 X n=1

Hn · 4n ·

  2p − 2n . p−n

Then pS =

p−1 X n=1

pHn · 4n · ≡

=

p  X n=0

2 See



2p − 2n p−n

 p−1  X p+n n=1

n

 =

p−1 X

(1 + pHn ) · 4n ·

n=1



 X   p−1 2p − 2n 2p − 2n − 4n · p−n p−n n=1

 X   p−1 2p − 2n 2p − 2n n ·4 · − 4 · p−n p−n n=1 n



(mod p2 )

  X         p p+n 2p − 2n 2p − 2n 2p 2p n n p 2p ·4 · − 4 · − −4 + + 4p n p−n p − n p p p n=0 

http://www.artofproblemsolving.com/Forum/viewtopic.php?f=47&t=5131. Girl’s Math Olympiad

3 European

16

(mod p2 )

OMO Fall 2014 Official Solutions

≡ 2p p

 p  X p+n n

n=0

 X   p 2p − 2n 2p − 2n n ·4 · − 4 · − 4p p−n p − n n=0 n



(mod p2 )



≡ 2 (mod p) by Wolstenholme’s Theorem.    Now note that p+n = (−1)n · −p−1 , and 4n 2p−2n = −4p · (−1)n · (−4)−(p−n) n n p−n  −1/2 p−n . Therefore, our above sum is equal to since

     p  p X X −p − 1 −1/2 −1/2 p n −4 · +4 (−1) · − 4p n p − n p − n n=0 n=0 p

≡ −4

p

 −2p−3  2

p

2p−2n p−n



= −4p · (−1)n ·

(mod p2 )

  −3/2 +4 − 4p p p

by Vandermonde’s Convolution Identity. −2p−3  Let’s first focus on −4p p2 . This quantity equals 4p + 1 −4 · · 2p + 1 p

 −2p−1  p

= 3 · 2p · ≡ 3 · 2p ·

4p + 1 · 2p + 1

Q

0≤i≤p−1,i6= p−1 2

4p + 1 · 2p + 1

4p + 1 ≡3·2 · · 2p + 1 X 0≤i≤p−1,i6= p−1 2

1 = 2i + 1

Q

0≤i≤p−1

Q

(p − 1)! (p − 1)!

(2i 0≤i≤p−1,i6= p−1 2 (p − 1)!

X 0≤i< p−1 2

2p + 2i + 1

0≤i≤p−1,i6= p−1 2

Q

2p + 2i + 1

p!

0≤i≤p−1,i6= p−1 2

(2i + 1) + 2p ·

p

since

4p + 1 =2 · · 2p + 1 Q p

2

+ 1)

 P (2i + 1) · 0≤i≤p−1,i6= p−1 2

1 2i+1



(mod p2 )

2p ≡0 (2i + 1)(2p − 2i − 1)

(mod p).

Continuing from where we left off above, Q (2i + 1) 4p + 1 0≤i≤p−1,i6= p−1 2 ≡3·2 · · 2p + 1 (p − 1)!   4p + 1 2p − 1 4p2 + 4p + 1 =6· · ≡6· ≡ 12p + 6 (mod p2 ). 2p + 1 p−1 2p + 1  Once again, 2p−1 p−1 ≡ 1 by Wolstenholme’s Theorem. p

The other quantity is much easier. Indeed,       −3/2 −1/2 2p 4p = (2p + 1) · 4p = −(2p + 1) ≡ −4p − 2 p p p

(mod p2 )

by Wolstenholme’s Theorem. p

So pS ≡ 12p + 6 − 4p − 2 − 4p = 8p + (4 − 4p ) (mod p2 ). Therefore, (p − 1)!S ≡ − 8p+(4−4 p p

p

)

=

213

4p −4 p

− 8.

We can compute 4 p−4 in the following way: let x = 216 ≡ −1 (mod p), so 4 p−4 = 4 · x x+1−1 ≡ −215 p (mod x + 1) by L’Hopital’s Rule. Therefore our final answer is 4 p−4 − 8 ≡ −215 − 8 ≡ 215 − 7 = 32761 (mod p).

17

The Online Math Open Spring Contest Official Solutions April 3 - 14, 2015

Acknowledgements Head Problem Writers • Yang Liu • Michael Kural • Robin Park • Evan Chen

Problem Contributors, Proofreaders, and Test Solvers • Sammy Luo • Ryan Alweiss • Ray Li • Victor Wang • Jack Gurev

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

OMO Spring 2015 Official Solutions 1. What is the largest positive integer which is equal to the sum of its digits? Proposed by Evan Chen. Answer. 9 . Solution. All one-digit integers work, but for any integer n with more digits, the sum of the digits of n is strictly less than the value of n itself. Thus the answer is the largest one-digit integer, which is 9. 2. A classroom has 30 students, each of whom is either male or female. For every student S, we define his or her ratio to be the number of students of the opposite gender as S divided by the number of students of the same gender as S (including S). Let Σ denote the sum of the ratios of all 30 students. Find the number of possible values of Σ. Proposed by Evan Chen. Answer. 2 . Solution. We consider two cases. If there are a 6= 0 males and b 6= 0 females, then Σ=

b a · a + · b = a + b = 30. a b

On the other hand, if all students are the same gender, then Σ = 0. Hence, there are two possible values of Σ. Remark. I apologize to all the teams who missed the edge case Σ = 0. I had noticed this when I wrote the problem, but did not think that it would actually cause any issues. Suffice to say in retrospect I would have explicitly mentioned it was possible that all students were the same gender. 3. On a large wooden block there are four twelve-hour analog clocks of varying accuracy. At 7PM on April 3, 2015, they all correctly displayed the time. The first clock is accurate, the second clock is two times as fast as the first clock, the third clock is three times as fast as the first clock, and the last clock doesn’t move at all. How many hours must elapse (from 7PM) before the times displayed on the clocks coincide again? (The clocks do not distinguish between AM and PM.)

10:22

1:44

5:06

7:00

11 12 1

11 12 1

11 12 1

11 12 1

10

2

9

3

8

4 7

6

I

5

10

2

9

3

8

4 7

6

5

10

2

9

3

8

4 7

II

6

5

III

10

2

9

3

8

4 7

6

5

IV

Omnes vulnerant, postuma necat Proposed by Evan Chen. Answer. 12 . Solution. It’s clear that at least 12 hours must pass, since clock I accurately reflects the time while clock IV stands still at 7PM. But at twelve hours, clocks II and III also display the correct time of 7PM. Therefore, the answer is 12.

1

OMO Spring 2015 Official Solutions 4. Find the sum of all distinct possible values of x2 − 4x + 100, where x is an integer between 1 and 100, inclusive. Proposed by Robin Park. Answer. 328053 . Solution. Let f (x) = x2 −4x+100. Note that f (1) = f (3) (because x2 −4x+100 = (x−1)(x−3)+97), so our answer is 100 X

(k 2 − 4k + 100) − f (1) =

k=1

100 · 101 100 · 101 · 201 −4· + 100 · 100 − 97 = 328053. 6 2

5. Let ABC be an isosceles triangle with ∠A = 90◦ . Points D and E are selected on sides AB and AC, √ and points X√and Y are the feet of the altitudes from D and E to side BC. Given that AD = 48 2 and AE = 52 2, compute XY . Proposed by Evan Chen. Answer. 100 . Solution. Let D0 and E 0 be situated on AC and AB so that lines DD0 , EE 0 , BC are parallel. A D E B

D0

0

E X

Y

C

From the diagram we see that XY is the average of DD0 and EE 0 (why?). So the answer is 1 1 (DD0 + EE 0 ) = (48 · 2 + 52 · 2) = 48 + 52 = 100. 2 2

6. We delete the four corners of a 8×8 chessboard. How many ways are there to place eight non-attacking rooks on the remaining squares? Proposed by Evan Chen. Answer. 21600 . Solution. There are 6 · 5 ways to select a rook for the pair of farthest edges, and 6 · 5 ways for the remaining columns. Now it’s straightforward to see that there are 4! ways to finish from here, since the central 6 × 6 square is essentially cut down to a 4 × 4 subsquares. Hence the answer is (6 · 5)2 · 4! = 21600. 7. A geometric progression of positive integers has n terms; the first term is 102015 and the last term is an odd positive integer. How many possible values of n are there? Proposed by Evan Chen. Answer. 8 .

2

OMO Spring 2015 Official Solutions Solution. The point is to count the powers of two. Let x1 = 102015 , . . . , xn = odd be the terms of the geometric progression. Call ak the exponent of2 in the prime factorization of xk . Then a1 = 2015, an = 0, and the ak form an arithmetic progression. If d is the common difference then we have (n − 1)d = 2015. So the number of possible n correspond to the factors of 2015, of which there are 8.0 8. Determine the number of sequences of positive integers 1 = x0 < x1 < · · · < x10 = 105 with the property that for each m = 0, . . . , 9 the number xxm+1 is a prime number. m Proposed by Evan Chen. Answer. 252 . Solution. Since 105 has exactly 10 prime factors, we find that xxm+1 ∈ {2, 5} for each m. We must m  pick each of the two primes exactly 5 times. there are 10 positions, so the answer is 10 5 = 252. Remark. This is equivalent to counting the number of lattice paths from (0, 0) to (5, 5). 9. Find the sum of the decimal digits of the number 5

99 X

k(k + 1)(k 2 + k + 1).

k=1

Proposed by Robin Park. Answer. 72 . Solution. We compute 5

99 X

(k 2 + k)(k 2 + k + 1) =

k=1

99 X

(5k 4 + 10k 3 + 10k 2 + 5k)

k=1

=

99 X

((k + 1)5 − k 5 ) −

k=1

99 X

1

k=1

= 1005 − 15 − 99 = 9999999900 Hence the answer is 9 · 8 = 72. 10. Nicky has a circle. To make his circle look more interesting, he draws a regular 15-gon, 21-gon, and 35-gon such that all vertices of all three polygons lie on the circle. Let n be the number of distinct vertices on the circle. Find the sum of the possible values of n. Proposed by Yang Liu. Answer. 326 . Solution. Note that if a regular m-gon and a regular n-gon intersect at least one point, then they intersect at exactly gcd(m, n) points. Now we claim that if two pairs of polygons intersect, then all three intersect at some unique point. Indeed, in this case we can split up the initial circle evenly into 105 points, for which every 3 points lie on the 35-gon, every 5 points lie on the 21-gon, and every 7 points lie on the 15-gon, with variable starting positions. So one of these 105 points is a common vertex of all three polygons if it is the solution x (mod 105) to some set of congruences x≡a

(mod 3)

x ≡ b (mod 5) x ≡ c (mod 7) 3

OMO Spring 2015 Official Solutions But by the Chinese Remainder Theorem, there is exactly one unique solution x to this set of congruences, so the claim is proven. Now we split the problem into several cases based on intersecting pairs. If no two polygons have a common vertex, there are 15 + 21 + 35 = 71 distinct vertices on the circle. If the 15-gon and 21-gon share 3 vertices but neither shares a vertex with the 35-gon, there are 68 distinct vertices. Similarly, in the cases for the other two pairs intersecting we get 71 − 5 = 66 and 71 − 7 = 64 vertices. If all three polygons intersect, by the Principle of Inclusion-Exclusion there are a total of 15 + 21 + 35 − 3 − 5 − 7 + 1 = 57 distinct vertices. Thus the final answer is 71 + 68 + 66 + 64 + 57 = 326. 11. Let S be a set. We say S is D∗ -finite if there exists a function f : S → S such that for every nonempty proper subset Y ( S, there exists a y ∈ Y such that f (y) ∈ / Y . The function f is called a witness of S. How many witnesses does {0, 1, · · · , 5} have? Proposed by Evan Chen. Answer. 120 . Solution. Clearly any witness f must in fact be surjective; otherwise we can take Y to be the range of f . Taking the cycle decomposition of f , we find that f must consist of only a single cycle, or else we could take Y to be any such cycle. However, we can also see that any such “single cycle” works. Then, by a standard argument, there are 5! = 120 such witnesses. Remark. D∗ -finiteness is equivalent to finiteness in the usual sense, and gives a characterization of “finite set” in ZFC. 12. At the Intergalactic Math Olympiad held in the year 9001, there are 6 problems, and on each problem you can earn an integer score from 0 to 7. The contestant’s score is the product of the scores on the 6 problems, and ties are broken by the sum of the 6 problems. If 2 contestants are still tied after this, their ranks are equal. In this olympiad, there are 86 = 262144 participants, and no two get the same score on every problem. Find the score of the participant whose rank was 76 = 117649. Proposed by Yang Liu. Answer. 1 . Solution. Since there exactly 76 ways to obtain a nonzero total score, we discover everyone underneath the 117649th rank scored a zero. Hence this contestant’s score must be 16 = 1, the lowest possible nonzero score. 13. Let ABC be a scalene triangle whose side lengths are positive integers. It is called stable if its three side lengths are multiples of 5, 80, and 112, respectively. What is the smallest possible side length that can appear in any stable triangle? Proposed by Evan Chen. Answer. 20 . Solution. Suppose that the three side lengths are 5a ,80b, 112c, where a, b, c are positive integers. By the triangle inequality, we must have 5a > |80b − 112c| = 16|5b − 7c| noting that the right hand side cannot be 0, as the triangle is scalene. So 5a ≥ 16, and thus 5a ≥ 20. Clearly 80b and 112c are at least 20, so the smallest side length is always at least 20. Conversely, we choose b, c such that |5b − 7c| = 1 holds (which is possible since 5, 7 are relatively prime): b = 3 and c = 2 suffice. Therefore the triangle with side lengths 20, 240, and 224, which is a triangle, gives 20 as the minimum possible side length. 4

OMO Spring 2015 Official Solutions 14. Let ABCD be a square with side length 2015. A disk with unit radius is packed neatly inside corner A (i.e. tangent to both AB and AD). Alice kicks the disk, which bounces off CD, BC, AB, DA, DC in that order, before landing neatly into corner B. What is the total distance the center of the disk travelled? Proposed by Evan Chen. Answer. 10065 . Solution. The main idea is to treat the disk as a single point, namely its center. If we consider an inner 2013 × 2013 square then we can treat the center of the ball as a particle being reflected by the fake “edges” of this inner square. See the diagram: A

B W

X

Z

Y

D

C

W0

X0

With the insight, upon drawing out the various bounces, we see that the ball travels the diagonal of a 3M × 4M rectangle, where M = 2013. This is 5M = 10065. 15. Let a, b, c, and d be positive real numbers such that a2 + b2 − c2 − d2 = 0

and a2 − b2 − c2 + d2 =

56 (bc + ad). 53

ab+cd Let M be the maximum possible value of bc+ad . If M can be expressed as relatively prime positive integers, find 100m + n.

m n,

where m and n are

Proposed by Robin Park. Answer. 4553 . Solution. Consider a quadrilateral ABCD with sidelengths AB = a, BC = b, CD = c, DA = d, and ∠B = ∠D = 90◦ (which is possible by the first equation). By the second equation and the Law of Cosines, we have that cos A = − cos C = 28 53 . Now we compute the area of ABCD in two ways by [ABCD] =

1 1 45 (ab + cd) = (bc + da) sin A = (bc + ad) 2 2 106 5

OMO Spring 2015 Official Solutions so

ab+cd bc+ad

=

45 53 .

16. Joe is given a permutation p = (a1 , a2 , a3 , a4 , a5 ) of (1, 2, 3, 4, 5). A swap is an ordered pair (i, j) with 1 ≤ i < j ≤ 5, and this allows Joe to swap the positions i and j in the permutation. For example, if Joe starts with the permutation (1, 2, 3, 4, 5), and uses the swaps (1, 2) and (1, 3), the permutation becomes (1, 2, 3, 4, 5) → (2, 1, 3, 4, 5) → (3, 1, 2, 4, 5).  5 Out of all 2 = 10 swaps, Joe chooses 4 of them to be in a set of swaps S. Joe notices that from p he could reach any permutation of (1, 2, 3, 4, 5) using only the swaps in S. How many different sets are possible? Proposed by Yang Liu. Answer. 125 . Solution. Consider the graph on 5 vertices with vertices numbered 1 to 5. For each swap (i, j) draw an edge between i and j. The key observation is that all other permutations are reachable from the starting one if and only if the graph is connected (why?). Since we chose exactly 4 edges, it is connected if and only if it is a tree. So the problem amounts to counting the number of spanning trees on K5 . A famous theorem of Cayley says that in general, the number of spanning trees of Kn is nn−2 = 53 = 125. (However, for the small value n = 5 one can also enumerate the trees by hand.) 17. Let A, B, M, C, D be distinct points on a line such that AB = BM = M C = CD = 6. Circles ω1 and ω2 with centers O1 and O2 and radius 4 and 9 are tangent to line AD at A and D respectively such that O1 , O2 lie on the same side of line AD. Let P be the point such that P B ⊥ O1 M and P C ⊥ O2 M. Determine the value of P O22 − P O12 . Proposed by Ray Li. Answer. 65 . Solution. The length of AB = BM = M C = CD is extraneous, and can be weakened to just AB = BM , M C = CD. The key observation is that P is the radical center of ω1 , ω2 and the circle of radius zero centered at M . Indeed P B is the radical axiom of ω1 and M , since it passes through the point B, and is perpendicular to the line O1 M through the centers. Similarly P C is a radical axis.

P O2 O1 A

B

M

C

D

Consequently, P O12 − 42 = P O22 − 92 , by the characterization of the power of a point through distances. Thus P O22 − P O12 = 92 − 42 = 65. Remark. In fact, the radical axis of ω1 and ω2 is exactly line P M .

6

OMO Spring 2015 Official Solutions 18. Alex starts with a rooted tree with one vertex (the root). For a vertex v, let the size of the subtree of v be S(v). Alex plays a game that lasts nine turns. At each turn, he randomly selects a vertex in the tree, and adds a child vertex to that vertex. After nine turns, he has ten total vertices. Alex selects one of these vertices at random (call the vertex v1 ). The expected value of S(v1 ) is of the form m n for relatively prime positive integers m, n. Find m + n. Note: In a rooted tree, the subtree of v consists of its indirect or direct descendants (including v itself). Proposed by Yang Liu. Answer. 9901 . Solution. The answer is H10 = there answer is Hn

1 1

+···+

1 10 .

We show that in general, for n vertices (rather than 10)

1 We show that given any tree on n nodes, the expected of S(v) increases by n+1 when we add a new node. For a node v, define d(v) be the number of nodes on the path from v to the root. By a simple double count, X X d(v) = S(v). v

v

Clearly, when we randomly add a new child, we expect to increase

P

v

d(v) by

1 n

·

P

v

d(v) + 1.

So our new average is X  1 X 1 X 1 1 · d(v) + · d(v) + 1 = · d(v) + . n+1 n n n+1 Therefore, our answer is Hn , as claimed. It is now direct to compute H10 =

7381 2520 ,

for an answer of 9901.

19. Let ABC be a triangle with AB = 80, BC = 100, AC = 60. Let D, E, F lie on BC, AC, AB such that CD = 10, AE = 45, BF = 60. Let P be a point in the plane of triangle ABC. minimum possible √ The √ √ value of AP + BP + CP + DP + EP + F P can be expressed in the form x + y + z for integers x, y, z. Find x + y + z. Proposed by Yang Liu. Answer. 15405 . Solution. The main observation is that AD, BE, and CF concur; since we have AP + P D ≤ AD with equality if P lies on AD, and similarly for the other cevians, we find that AP + BP + CP + DP + EP + F P ≤ AD + BE + CF and that equality occurs if P is the concurrency point. By the Pythagorean Theorem, we have BE 2 = 802 + 452

and CF 2 = 602 + 202 .

Moreover, by the Law of Cosines on 4ADC (or by Stewart’s Theorem or several other means), we find AD2 = 602 + 102 − 2 · 60 · 10 ·

60 = 602 + 102 − 720. 100

Hence the quantity requested in the problem is 102 + 202 + 452 + 2 · 602 + 802 − 720 = 15405.

7

OMO Spring 2015 Official Solutions 20. Consider polynomials P of degree 2015, all of whose coefficients are in the set {0, 1, . . . , 2010}. Call such a polynomial good if for every integer m, one of the numbers P (m) − 20, P (m) − 15, P (m) − 1234 is divisible by 2011, and there exist integers m20 , m15 , m1234 such that P (m20 ) − 20, P (m15 ) − 15, P (m1234 ) − 1234 are all multiples of 2011. Let N be the number of good polynomials. Find the remainder when N is divided by 1000. Proposed by Yang Liu. Answer. 460 . Solution. Note that 2011 is a prime. The following claim is the most important part of our solution: Lemma 20.1. Given the values P (0), P (1), . . . , P (2010), there exists a unique polynomial of degree at most 2010 and coefficients in the set {0, 1, . . . , 2010} such that P (x) ≡ x (mod 2011) for all x. Proof. Work in F2011 [x] throughout this proof. This is essentially polynomials with coefficients as integers (mod 2011). First I will prove uniqueness. If P (x), Q(x) are the same (mod 2011) for all x, then x2011 − x|P (x) − Q(x), contradicting the fact that max(deg P, deg Q) ≤ 2010. Now I show existence. By the Lagrange Interpolation formula, Q 2010 X 0≤j≤2010,j6=i (x − j) P (x) = P (i) Q . 0≤j≤2010,j6=i (i − j) i=0 Since every integer has a unique inverse (mod 2011) and no denominators are a multiple of 2011, existence is shown. Now we will count the number of ways to assign the values 20, 15, 1234 to P (0), P (1), . . . , P (2010) such that all 3 values are used at least once. This is essentially Stirling Numbers of the Second Kind and can be computed with Principle of Inclusion-Exclusion. The answer is 32011 − 3 · 22011 + 3 · 12011 . Finally, since P (x) is degree 2015, write P (x) = (x2011 − x) · Q(x) + R(x), where deg R(x) < 2011, deg Q(x) = 4. So given the values of P (0), P (1), . . . , P (2010), by the above claim, R(x) is determined uniquely. (2011|x2011 − x for all x) Q(x) can be chosen in 2010 · 20114 ways, just by choosing the coefficients independently. Therefore, our final answer is 2010 · 20114 · (32011 − 3 · 22011 + 3 · 12011 ) ≡ 460 (mod 2011). 21. Let A1 A2 A3 A4 A5 be a regular pentagon inscribed in a circle with area −−−−→ points Bi and Ci lie on ray Ai Ai+1 such that

where indices are taken modulo 5. The value of P) can be expressed as 100a + 10b + c.

For each i = 1, 2, . . . , 5,

and Ci Ai · Ci Ai+1 = Ci A2i+2

Bi Ai · Bi Ai+1 = Bi Ai+2 √ a+b 5 , c

√ 5+ 5 10 π.

[B1 B2 B3 B4 B5 ] [C1 C2 C3 C4 C5 ]

(where [P] denotes the area of polygon

where a, b, and c are integers, and c > 0 is as small as possible. Find

Proposed by Robin Park. Answer. 101 . Solution. First, note that the area condition implies that the side length of the pentagon is 1. (This can be shown using trigonometry or similar) Let the circumcircle of the pentagon be ω. Next I will show that Ci Ai+2 = 1. Because Ci A2i+2 = Ci Ai · Ci Ai+1 , Ci is the intersection of the tangent from Ai+2 to ω with Ai Ai+1 . Therefore, ∠Ci Ai+1 Ai+2 = 180◦ − ∠Ai Ai+1 Ai+2 = 72◦ . Also, ∠Ci Ai+2 Ai+1 = ∠Ai+2 Ai Ai+1 = 36◦ because of tangency. So ∠Ai+1 CAi+2 = 72◦ = ∠Ci Ai+1 Ai+2 =⇒ CAi+2 = Ai+1 Ai+2 = 1. This in fact means that Bi ≡ Ci because 12 = 1. Therefore the pentagons are equal, so the ratio is 1. Our final answer would be 8

√ 1+0 5 1

=⇒ 101.

OMO Spring 2015 Official Solutions 22. For a positive integer n let n# denote the product of all primes less than or equal to n (or 1 if there are no such primes), and let F (n) denote the largest integer k for which k# divides n. Find the remainder when F (1) + F (2) + F (3) + · · · + F (2015# − 1) + F (2015#) is divided by 3999991. Proposed by Evan Chen. Answer. 240430 . Solution. The key observation is that by double-counting, the sum is equal to X X N  1= k# 1≤k≤2016

k#|n

where N = 2015# = 2016# (note N < 2017#). The quantity in the floor is an integer, and in fact it’s the product of the primes up to 2011 which are strictly greater than k. Note that M = 3999991 = 20002 − 32 = 1997 · 2003, both of which are primes. So in this sum all terms k < 1997 vanish mod M . The primes greater than 1997 are 1999, 2003, 2011 and 2017. • For 1997 ≤ k ≤ 1998 we have 1999 · 2003 · 2011, which contributes 2(2 · 2003 · 14) ≡ 56 · 2003 (mod M ). • For 1999 ≤ k ≤ 2002 we have 2003 · 2011, which contributes 4(2003 · 14) ≡ 56 · 2003 (mod M ). • For 2003 ≤ k ≤ 2010 we have 2011 which contributes 8 · 2011. • For 2011 ≤ k ≤ 2016 we have 1 which contributes 6. Hence the answer is 112 · 2003 + 8 · 2011 + 6 = 224336 + 16088 + 6 = 240430. 23. Let N = 12! and denote by X the set of positive divisors of N other than 1. An pseudo-ultrafilter U is a nonempty subset of X such that for any a, b ∈ X: • If a divides b and a ∈ U then b ∈ U . • If a, b ∈ U then gcd(a, b) ∈ U . • If a, b ∈ / U then lcm(a, b) ∈ / U. How many such pseudo-ultrafilters are there? Proposed by Evan Chen. Answer. 19 . Solution. Suppose U is a pseudo-ultrafilter. Note that inductively, the greatest common divisor of any n elements of U must also be in U . Let g be the greatest common divisor of all elements of U ; then g ∈ U and g > 1. So all elements of U are multiples of g, and by the first condition, all multiples of g are elements of U . Thus we simply want to find all g ∈ X such that {h ∈ x|g | h} is a pseudo-ultrafilter. This clearly satisfies the first two conditions, so it suffices to find g satisfying the third condition. If there are some integers a, b > 1 with g = ab and gcd(a, b) = 1, then we have a contradiction, as lcm(a, b) = g. Therefore any valid g must satisfy g = pk for some prime p and k ≥ 1 (as g cannot be 1). Conversely, if g = pk , then pk - a and pk - b implies pk - lcm(a, b). So it suffices to count the number of prime powers which are factors of 12!, which is 10 + 5 + 2 + 1 + 1 = 19.

9

OMO Spring 2015 Official Solutions 24. Suppose we have 10 balls and 10 colors. For each ball, we (independently) color it one of the 10 colors, then group the balls together by color at the end. If S is the expected value of the square of the number of distinct colors used on the balls, find the sum of the digits of S written as a decimal. Proposed by Michael Kural. Answer. 55 . Solution. We solve the problem for the general case of n balls and n colors for n ≥ 2. Let C be the set of colors, so |C| = 10. Let B be the set of colors which are the color of some ball, so we want to find E[|B|2 ]. For a set T ⊆ C, let f (T ) be the probability that B = T , and let g(T ) be the probability that B ⊆ T . So then X E[|B|2 ] = f (T )|T |2 T ⊆C

and also

X

g(T ) =

f (R)

R⊆T

Clearly, g(T ) =

|T |n nn .

By Mobius Inversion,1 f (T ) =

X

(−1)|T |−|R| g(R)

R⊆T

Thus E[|B|]2 =

X X

(−1)|T |−|R| g(R)|T |2 =

T ⊆C R⊆T

X

X

(−1)|T |−|R| g(R)|T |2

R⊆C R⊆T ⊆C

=

 n   n X X n n−i i=0 j=i

n i

where we set i = |R|, j = |T |, since there are given j and R ⊆ T .



i

j−i

(−1)j−i

choices for R given fixed i and

in 2 j nn n−i j−i



choices for T

Lemma 24.1. If x is a real number and p, q are nonnegative integers with p > q, then p X

  p (−1) (x + k)q = 0 k k

k=0

Proof. This is simply saying that the pth finite difference of a qth degree polynomial is 0, which is true because each successive finite difference decreases the degree of the polynomial by 1. Then note that if n − i > 2,

 n  X n−i j=i

j−i

(−1)j−i j 2 = 0.

so our expression for E[|B|2 ] simply reduces to 2

E[|B| ] =

 n n   X X n n − si i=n−2 j=i

i

j−i

(−1)j−i

in 2 j . nn

Evaluating this sum yields E[|B|2 ] = 1 This

  n (n − 2)n 2 n − 2(n − 1)2 + (n − 2)2 n n−2 n



is also essentially Principle of Inclusion-Exclusion; there are a lot of ways to see that this identity holds.

10

OMO Spring 2015 Official Solutions    n   n (n − 1)n n n 2 2 (n − 2) − (n − 1) + n2 n n n−1 n n n

 + which simplifies to

 1 n(n − 1)(n − 2)n + n(1 − 2n)(n − 1)n + nn+2 n n

For n = 10, this is 43.414772797 yielding a final answer of 55. 25. Let V0 = ∅ be the empty set and recursively define Vn+1 to be the set of all 2|Vn | subsets of Vn for each n = 0, 1, . . . . For example V2 = {∅, {∅}}

and V3 = {∅, {∅} , {{∅}} , {∅, {∅}}} .

A set x ∈ V5 is called transitive if each element of x is a subset of x. How many such transitive sets are there? Proposed by Evan Chen. Answer. 4131 . Solution. For ease of notation, let 0 = ∅, 1 = {0}, 2 = {0, 1}, 3 = {0, 1, 2}. Then V3 = {0, 1, 2, {1}} . Let x ∈ V5 , i.e. x ⊆ V4 , be transitive. We now count the number of transitive sets in V4 by casework on y = x ∩ V3 . • If y = ∅, this means x = ∅, so one set here. • If y = {0}, this means x = 1, so one set here. • If y = {0, 1}, this means x = 2, so one set here. • If y = {0, 1, 2} = 3, then there are four more elements of V4 we can add to x (namely the 23 −4 = 4 subsets of 3 not already in V2 ), so 24 = 16 cases here. • If y = {0, 1, {1}}, we again get 24 = 16 cases. • If y = V3 , then we can add any of the 24 − 4 = 12 elements of V4 \ V3 we like, giving 212 = 4096 cases. Tallying the total gives 4096 + 32 + 3 = 4131. Remark. The sets Vi in the problem are the levels of the von Neumann universe. The phrase “transitive” reflects that ∈ is a transitive relation on the elements of x. 26. Consider a sequence T0 , T1 , . . . of polynomials defined recursively by T0 (x) = 2, T1 (x) = x, and Tn+2 (x) = xTn+1 (x)−Tn (x) for each nonnegative integer n. Let Ln be the sequence of Lucas Numbers, defined by L0 = 2, L1 = 1, and Ln+2 = Ln + Ln+1 for every nonnegative integer n. Find the remainder when T0 (L0 ) + T1 (L2 ) + T2 (L4 ) + · · · + T359 (L718 ) is divided by 359. Proposed by Yang Liu. Answer. 5 .

11

OMO Spring 2015 Official Solutions Solution. Let α =

√ 3+ 5 2 ,

so that L2n = αn + α−n . Note both 359 and 179 are prime. Now since   5 =1 359

(i.e. 5 is a quadratic residue modulo 359, as can be checked by, say, quadratic reciprocity), we have that α ∈ F359 . Finally, √ !2 1+ 5 α= , 2 so α179 = 1. 2

2

By properties of Chebyschev polynomials, Tn (L2n ) = αn + α−n . To finish, note that since 179 ≡ 3 (mod 4), −n2 is not a quadratic residue modulo 179. Therefore, 178 X

Tn (L2n ) =

n=0

178  X

2

αn + α−n

2



= 2(α0 + α1 + . . . + α178 ) = 0

n=0

since we run through each residue and non-residue precisely twice. So in our desired sum almost everything goes to 0, except the last two terms, which are easily computed to be 2 + 3 = 5. 27. Let ABCD be a quadrilateral satisfying ∠BCD = ∠CDA. Suppose rays AD and BC meet at E, and let Γ be the circumcircle of ABE. Let Γ1 be a circle tangent to ray CD past D at W , segment AD at X, and internally tangent to Γ. Similarly, let Γ2 be a circle tangent to ray DC past C at Y , segment BC at Z, and internally tangent to Γ. Let P be the intersection of W X and Y Z, and suppose P lies on Γ. If F is the E-excenter of triangle ABE, and AB = 544, AE = 2197, BE = 2299, then find m + n, where F P = m n with m, n relatively prime positive integers. Proposed by Michael Kural. Answer. 2440 . Solution. To deal with mixtillinear incircles, we utilize the following key lemma: Lemma 27.1. For a triangle ABC in general, suppose D lies on segment BC and a circle is tangent to segments AD, BC at X, Y and the circumcircle of ABC internally. Then the incenter I of ABC lies on line XY . Proof. Well known; see, for example, Lemma 6 at http://yufeizhao.com/olympiad/geolemmas. pdf. Now, let line CD intersect Γ at S, T , and let U, V be the incenters of triangles AST , BST , respectively. By Lemma 1, U lies on W X and V lies on Y Z. Let Q, R be the excenters of triangle EST across from T, S respectively. By an external analogue of Lemma 1, Q lies on W X as well, and R lies on Y Z. Thus P can be recharacterized as the intersection of QU and RV . Let K be the midpoint of arc ST on Γ containing E. Let ω be a circle centered at K passing through S and T . By a well known result, Q, U, V, R also lie on ω. Of course, we also have that Q, R lie on KE, the external bisector of ∠SET , and similarly U lies on KA, V lies on KB. Now note that ∠QRP = ∠KRV = 90◦ −

∠RKB ∠EAB = 90◦ − 2 2

and similarly ∠RQP = 90◦ − ∠EBA . Thus P RQ ∼ F GH, where F GH is the excentral triangle of 2 ABE (F, G, H are the excenters across E, A, B respectively). 12

OMO Spring 2015 Official Solutions In particular, let M be the midpoint of arc AB on Γ containing E. M is the second intersection of the nine point center of F GH with GH, so M is the midpoint of GH. K is the center of ω passing through Q, R, so K is the midpoint of RQ. Thus K, M are corresponding points on similar triangles F GH and P RQ. In particular, ∠F M E = ∠F M H = ∠P KQ = ∠P KE = ∠P M E so M, P, F are collinear. The rest of the problem is standard: we can easily compute GH = 4576, F H = 3146, and F G = 3718. Thus r GH 2 F G2 + F H 2 − = 2574 FM = 2 4 and F H · AB FB = = 374 GH so by Power of a Point 2431 F B · F G/2 = FP = FM 9 and the final answer is 2431 + 9 = 2440. 28. Find the number of ordered pairs (P (x), Q(x)) of polynomials with integer coefficients such that 2 P (x)2 + Q(x)2 = x4096 − 1 . Proposed by Michael Kural. Answer. 708588 . Solution. We claim that the answer for 2n is 4 · 3n−1 for n ≥ 1. Note that the statement is equivalent to n−2 Y k k (P (x) + iQ(x))(P (x) − iQ(x)) = (x − 1)2 (x + 1)2 (x2 + i)2 (x2 − i)2 k=0

thus we are decomposing the right-hand side into the product of a polynomial and its conjugate. k

Lemma 28.1. The polynomial x2 −i is irreducible in Z[i], i.e. it is indecomposable over the Gaussian integers. Proof 1. Suppose k

x2 − i = A(x)B(x) for some A, B ∈ Z[i] of positive degree. Then k ¯ B(x) ¯ x2 + i = A(x)

so

k+1

x2

¯ ¯ + 1 = (A(x)A(x))(B(x) B(x))

¯ and B(x)B(x) ¯ are integer polynomials with positive degree. However, x2k+1 + 1 is but A(x)A(x) irreducible, as it is a cyclotomic polynomial. Its irreducibility can also be shown by noting k+1

(x + 1)2

k+1

+ 1 ≡ x2

+2

where each coefficient is taken (mod 2). So by Eisenstein’s Criterion the shifted polynomial is irreduble, and so the original is irredubile, giving a contradiction. 13

OMO Spring 2015 Official Solutions k

Proof 2. We now apply the same Eisenstein strategy to x2 − i itself. Shift the polynomial by 1 to yield k (x + 1)2 − i k

Similarly to before, each coefficient in this polynomial is divisible by 2 except for x2 and the constant term, 1 − i. Now note that 1 − i is irreducible in Z[i] and 1 − i | 2, so by Eisenstein on 1 − i, this polynomial is irreducible. k

Proof 3. By Gauss’ Lemma it suffices to prove irreducibility in Q[i]. If z is a root of x2 − i, then k+1 Q[z][i] = Q[z] since i is a power of z. Also, z is a root of x2 + 1, which is irreducible in Q[x], as shown before. 2[Q[z][i] : Q[i]] = [Q[z][i] : Q[i]][Q[i] : Q] = [Q[z][i] : Q] = Q[z][i] = 2k+1 k

implying [Q[z][i] : Q[i]] = 2k , so x2 − i must be the minimal polynomial of z. Now for each pair of conjugate polynomials in the RHS, one must become a factor of P + Qi and one k k must become a factor of P − Qi. For each (x2 + i)2 (x2 − i)2 , there are three choices to do this: let k k k k (x2 + i)2 divide P + Qi and (x2 − i)2 divide P − Qi, the reverse, or let (x2 + i)(x2 − i) divide both. We necessarily must have (x − 1)(x + 1) dividing both, so up to units there are 3n−1 choices for P + Qi. Including the units 1, −1, i, −i to multiply by, there are a total of 4 · 3n−1 choices. 29. Let ABC be an acute scalene triangle with incenter I, and let M be the circumcenter of triangle BIC. Points D, B 0 , and C 0 lie on side BC so that ∠BIB 0 = ∠CIC 0 = ∠IDB = ∠IDC = 90◦ . Define P = AB ∩ M C 0 , Q = AC ∩ M B 0 , S = M D ∩ P Q, and K = SI ∩ DF , where segment EF is a diameter of the incircle selected so that S lies in the interior of segment AE. It is known that KI = 15x, √ SI = 20x + 15, BC = 20x5/2 , and DI = 20x3/2 , where x = ab (n + p) for some positive integers a, b, n, p, with p prime and gcd(a, b) = 1. Compute a + b + n + p. Proposed by Evan Chen. Answer. 99 . Solution. The length of BC = 20x5/2 is extraneous and not used below.

14

OMO Spring 2015 Official Solutions X

TB

MB

A

D0 F Q

MC

TC I

L

S

K

A2

O

P A1

E B

C0

B0

D

C

TA

M

Define the A-mixtilinear incircle ωA to be the circle internally tangent to the circumcircle of ABC at a point TA while simultaneously tangent to AB and AC. Define ωB , ωC , TB and TC simultaneously. Finally let ω and Ω denote the incircle and circumcircle of 4ABC. d and AB d of Ω which do not contain the opposite Let MB and MC be the midpoints of the arcs AC vertices, and let the A-mixtilinear incircle be tangent to sides AB and AC at points A1 and A2 . Also, d of Ω not containing A, a well-known fact which can be observe that M is the midpoint of the arc BC established by angle chasing. First, we claim that points ∠AIA1 = ∠AIA2 = 90◦ . Indeed, note that the homothety taking ωA to Ω sends A1 to MC and A2 to MB . Therefore, applying Pascal’s Theorem on hexagon ABTB M TC C (on Ω) implies that A1 , A2 , I are collinear. The conclusion is immediate.2 By applying similar logic we discover that B 0 and C 0 are the contact points of ωB and ωC on side BC. Consequently, we discover that point M is the intersection of lines TC C 0 and TB B 0 . Next, let X56 denote the center of the positive homothety taking the incircle to Ω.3 We claim that A, 2 The

special case of this with AB = AC appeared on IMO 1978. is the actual name of this point – it is the 56th triangle center in Kimberling’s Encyclopedia. Moreover, it is the isogonal conjugate of the Nagel point, as we will soon see. 3 That

15

OMO Spring 2015 Official Solutions X56 , and TA are collinear.4 Indeed, consider the composition of homotheties T

A

A Ω. ω −→ ωA −→

By definition, it has center X56 . But the line ATA is fixed by it, proving the claim. Also, note that D and M are images under the composed homothety. Hence, lines ATA , BTB , CTC , DM and IO concur at X56 . Next, by Pascal’s Theorem on hexagon (on Ω)

ABTB M TC C we find that P , X56 , Q are collinear. It follows that X56 = S.

Now, let D0 be the point diametrically opposite D on ω and X the point diametrically opposite M on Ω. Of course, points S, D0 , X are collinear as the homothety maps X to D0 . We claim now that TA , I, X are collinear5 . Indeed, note that rays T A and T I are the symmedian and median of 4TA A1 A2 , respectively; the result now follows since lines AX and MB MC are parallel. Denote by L the intersection of lines D0 E and SI. From the collinearity above, we find that under the homothety from ω to Ω at S maps the point L to I. Moreover, we find that D0 EDF is a rectangle inscribed in ω by construction; thus LI = IK. In summary, there is a homothety centered at S which sends • ω to Ω, • I to O, • and L to I. Let h be the homothety of this ratio. First, we have h=

SO IO SI = = SL SI LI

but also IO2 = R(R − 2r) = h(h − 2)r2 . In this way we obtain that IO2 = LI 2 · h2 = h(h − 2)r2 so LI 2 =

 1−

2 h



· r2 .

Substituting the known values LI = KI = 15x and SI = 20x + 15, and r2 = DI 2 = 400x3 , we get   5x + 15 (15x)2 = 1 − 2 · · 202 · x3 . 20x + 15 Simplifying, we get

9 x+3 2x − 3 =1−2· = 16x 4x + 3 4x + 3

id est, 32x2 − 84x − 27 = 0. Applying the quadratic formula gives and taking the positive root gives that √  √  1  3  x= 84 + 12 73 = 7 + 73 64 16 and the answer is 3 + 16 + 7 + 73 = 99. 4 This 5 This

is a particular instance of a theorem called Monge’s Theorem. The proof is basically the same as the one we gave here. appeared on an Iran 2002 olympiad.

16

OMO Spring 2015 Official Solutions Remark. In light of x ≈ 2.91, we can compute the inradius and circumcircle are approximately 99.5 and 246.6. Moreover, BC ≈ 290.0, though as stated before the side length of BC is irrelevant to the problem. 30. Let S be the value of

∞ X d(n) +

Pν2 (n) m=1

n=1

(m − 3)d n

n 2m

 ,

where d(n) is the number of divisors of n and ν2 (n) is the exponent of 2 in the prime factorization of n. If S can be expressed as (ln m)n for positive integers m and n, find 1000n + m. Proposed by Robin Park. Answer. 2004 . P∞ Solution. Note that the series is conditionally convergent ( n=1 d(n) diverges), so we introduce a n regulator s in our sum:  Pν2 (n) ∞ X d(n) + m=1 (m − 3)d 2nm f (s) = . ns n=1 P∞ We now use the Riemann zeta function ζ(s) = n=1 n1s . Then ∞ ∞ Pν2 (n) X (m − 3)d d(n) X m=1 f (s) = + s n ns n=1 n=1  2 1 1 1 2 = ζ(s) + s + s + ··· 2s 4 8  2 1 2 = ζ(s) 1 − −1 + 2s  2 −2 + 2s = ζ(s)2 . −1 + 2s

n 2m



Now we take the limit of f (s) as s → 1. The denominator −1 + 2s vanishes, so we have to find lims→1 ζ(s)2 (−2 + 2s )2 . It’s pretty difficult to use l’Hopital’s rule on the zeta function itself, so we use the Laurent expansion of ζ(s). It is well-known that the zeta function has a simple pole at s = 1, and by checking the coefficient we know that ζ(s) =

1 + c0 + c1 (s − 1) + c2 (s − 1)2 + · · · . s−1

So 2 1 + c0 + c1 (s − 1) + c2 (s − 1)2 + · · · (−2 + 2s )2 s→1 s − 1  2  2 (−2 + 2s )2 −2 + 2s 2s ln 2 = lim = lim = lim = (ln 4)2 . s→1 (s − 1)2 s→1 s − 1 s→1 1

lim ζ(s)2 (−2 + 2s )2 = lim

s→1



17

The Online Math Open Fall Contest Official Solutions November 6 – 17, 2015

Acknowledgements Head Problem Authors • Yang Liu (Chief of Problems) • Ashwin Sah • Yannick Yao

Problem Contributors • Evan Chen • Michael Kural • James Lin • Michael Ma

Website Manager • Douglas Chen

LATEX/Python Geek • Evan Chen

OMO Fall 2015 Official Solutions 1. Evalute

s        8 9 15 16 + + + . 2 2 2 2

Proposed by Evan Chen. Answer. 17 . Solution. The main observation is that         8 9 15 16 2 + =8 + = 152 2 2 2 2 √ so that the desired sum is 82 + 152 = 17, a well-known Pythagorean triple. 2. At a national math contest, students are being housed in single rooms and double rooms; it is known that 75% of the students are housed in double rooms. What percentage of the rooms occupied are double rooms? Proposed by Evan Chen. Answer. 60 . Solution. Assume there are k students in single rooms and 3k students in double rooms. The number 3 2k of single rooms is k, and the number of double rooms is 32 k. So the answer is 3 k+k = 53 , which is 2 60%. 3. How many integers between 123 and 321 inclusive have exactly two digits that are 2? Proposed by Yannick Yao. Answer. 18 . Solution. These integers must take on the form 22n or 2n2, where n 6= 2. Since there are 9 choices for n in each case, the answer is 2 · 9 = 18. 4. Let ω be a circle with diameter AB and center O. We draw a circle ωA through O and A, and another circle ωB through O and B; the circles ωA and ωB intersect at a point C distinct from O. Assume √ that all three circles ω, ωA , ωB are congruent. If CO = 3, what is the perimeter of 4ABC? Proposed by Evan Chen. Answer. 6 . Solution. Let OA be the center of ωA and OB the center of ωB . Notice that OA and OB must lie on the same sides of line AB, since the assumptions of the problem implicitly tell us the circles are not tangent at O.

O

A

OA

B

OB

C

1

OMO Fall 2015 Official Solutions Moreover, by symmetry we have that OC ⊥ AB; so OA and OB are the midpoints of AC and BC. In particular, AOOA and BOOB are equilateral; finally we deduce ABC is equilateral too. √ Since OC = 3, we find AB = BC = CA = 2, so the perimeter is 6. 5. Merlin wants to buy a magical box, which happens to be an n-dimensional hypercube with side length 1 cm. The box needs to be large enough to fit his wand, which is 25.6 cm long. What is the minimal possible value of n? Proposed by Evan Chen. Answer. 656 . Solution. By the Pythagorean Theorem in n-dimensional space, the maximal length is given by the diagonal s √ (1 − 0)2 + (1 − 0)2 + · · · + (1 − 0)2 = n. | {z } n times

This is the distance from (0, . . . , 0) to (1, . . . , 1) as points in Rn . So we require 655.36; the smallest integer n is n = 656.



n ≥ 25.6 ⇐⇒ n ≥

6. Farmer John has a (flexible) fence of length L and two straight walls that intersect at a corner perpendicular to each other. He knows that if he doesn’t use any walls, he can enclose a maximum possible area of A0 , and when he uses one of the walls or both walls, he gets a maximum area of A1 and A2 A2 1 respectively. If n = A A0 + A1 , find b1000nc. Proposed by Yannick Yao. Answer. 4000 . Solution. Since a circle is the shape that maximizes area given a fixed perimeter, with no walls the best area Farmer John can achieve is with a circle. With one wall, he makes a semicircle. This can be seen to be optimal by reflecting the region over the wall and considering their union. This must be a circle by above, so a semicircle is optimal. In the case with 2 walls, the region should be a quarter 2 L2 L2 circle. Now it is easy to compute that A0 = L 4π , A1 = 2π , A2 = π . So

A2 A1

+

A1 A0

= 4, giving an answer of 4000.

7. Define sequence {an } as following: a0 = 0, a1 = 1, and ai = 2ai−1 − ai−2 + 2 for all i ≥ 2. Determine the value of a1000 . Proposed by Yannick Yao. Answer. 1000000 . Solution. We claim that in fact an = n2 for every integer n. The proof is by induction on n with the base cases n = 0 and n = 1 given; for the inductive step, we observe that 2(i − 1)2 − (i − 2)2 + 2 = i2 as desired. Therefore a1000 = 10002 = 1000000. 8. The two numbers 0 and 1 are initially written in a row on a chalkboard. Every minute thereafter, Denys writes the number a + b between all pairs of consecutive numbers a, b on the board. How many odd numbers will be on the board after 10 such operations? Proposed by Michael Kural. Answer. 683 . 2

OMO Fall 2015 Official Solutions Solution. All numbers are integers at all points, so we will tacitly take modulo 2 everywhere. We claim that after k operations, the numbers on the board are 011011011 {z . . . 011} 01 | 2k −1 3

blocks

when k is even and 011011011 | {z . . . 011} 2k +1 3

blocks

when k is odd. (Note that in total, there are 2k + 1 numbers written.) The proof of this observation is a direct induction on k ≥ 0. Applying this to k = 10, we see the 10 number of odd numbers is 2 3−1 · 2 + 1 = 683. 9. Let s1 , s2 , . . . be an arithmetic progression of positive integers. Suppose that ss1 = x + 2,

ss2 = x2 + 18,

and ss3 = 2x2 + 18.

Determine the value of x. Proposed by Evan Chen. Answer. 16 . Solution. The main observation is that ss1 , ss2 , ss3 must be in arithmetic progression since s1 , s2 , and s3 are. From this, we have that x + 2, x2 + 18 and 2x2 + 18 are in arithmetic progression, hence 2(x2 + 18) = (2x2 + 18) + (x + 2) which gives x = 16 immediately. In fact, the sequence in question is sn = 16n − 14. 10. For any positive integer n, define a function f by f (n) = 2n + 1 − 2blog2 nc+1 . Let f m denote the function f applied m times.. Determine the number of integers n between 1 and 65535 inclusive such that f n (n) = f 2015 (2015). Proposed by Yannick Yao. Answer. 8008 . Solution. By observing the base-2 expansion of the integer, we see that the function is equivalent to removing the frontmost nonzero digit (which is 1) and adding a 1 at the end. Thus f n (n) = 2s(n) − 1, where s(n) is the sum of binary digits of n. Since 2015 = 111110111112 has s(2015) = 10, Therefore it suffices to find  the number of positive integers with at most 16 binary digits exactly 10 of which are 1. This is 16 10 = 8008. 11. A trapezoid ABCD lies on the xy-plane. The slopes of lines BC and AD are both 13 , and the slope of line AB is − 23 . Given that AB = CD and BC < AD, the absolute value of the slope of line CD can be expressed as m n , where m, n are two relatively prime positive integers. Find 100m + n. Proposed by Yannick Yao. Answer. 1706 .

3

OMO Fall 2015 Official Solutions ~ = h−3, 2i, DC ~ = hp, qi. Notice that AB ~ + DC ~ is a vector that is perpendicSolution. WLOG set AB ular to BC or AD, which means that it has slope −3. Combined with the condition that AB = CD, we can set up a system of equation to solve for p, q: q+2 = −3 p−3 p2 + q 2 = (−3)2 + 22 = 13 This system can be reduced to the quadratic equation 5p2 − 21p + 18 = 0, which gives p = 3 or p = 56 . q m 17 Since p − 3 6= 0, we have hp, qi = h 65 , 17 5 i. Thus n = p = 6 and our answer is 1706.

12. Let a, b, c be the distinct roots of the polynomial P (x) = x3 − 10x2 + x − 2015. The cubic polynomial Q(x) is monic and has distinct roots bc − a2 , ca − b2 , ab − c2 . What is the sum of the coefficients of Q? Proposed by Evan Chen. Answer. 2015000 . Solution. Considering the factorization of Q, we seek to compute (1 − bc + a2 )(1 − ca + b2 )(1 − ab + c2 ). Since 1 = ab + bc + ca by Vieta’s Formulas, this rewrites as (a(a + b + c))(b(a + b + c))(c(a + b + c)) = abc(a + b + c)3 = 2015000. 13. You live in an economy where all coins are of value 1/k for some positive integer k (i.e. 1, 1/2, 1/3, . . . ). You just recently bought a coin exchanging machine, called the Cape Town Machine. For any integer n > 1, this machine can take in n of your coins of the same value, and return a coin of value equal to the sum of values of those coins (provided the coin returned is part of the economy). Given that the product of coins values that you have is 2015−1000 , what is the maximum number of times you can use the machine over all possible starting sets of coins? Proposed by Yang Liu. Answer. 308 . Solution. Note that inserting a composite number ab of coins into the machine is always nonoptimal. Indeed, you can use the machine more by splitting the coins into b groups of size a, inserting each of these groups separately, and then inserting all the new coins that you get. Let S denote the product of the denominators of the coins values. Note that when you insert n coins 1 into the machine to return a k1 , S divides by k n−1 nn . At any stage of the process, the S on value kn is always a positive integer. Therefore, to optimally use the machine, we should set k = 1 at all times, and n as primes that divide 2015. Therefore, we care about how many times we can divide 20151000 by 55 , 1313 , 3131 . Summing over these, 2015 2015 we get b 2015 5 c + b 13 c + b 31 c = 308. This can be achieved by making all the coins have value either 1/5, 1/13, or 1/31. 14. Let a1 , a2 , . . . , a2015 be a sequence of positive integers in [1, 100]. Call a nonempty contiguous subsequence of this sequence good if the product of the integers in it leaves a remainder of 1 when divided by 101. In other words, it is a pair of integers (x, y) such that 1 ≤ x ≤ y ≤ 2015 and ax ax+1 . . . ay−1 ay ≡ 1

(mod 101).

Find the minimum possible number of good subsequences across all possible (ai ). Proposed by Yang Liu. Answer. 19320 . 4

OMO Fall 2015 Official Solutions Solution. Consider the prefix products, i.e. pi = a1 a2 . . . ai . Define p0 = 1. Note that (x, y) is good iff px−1 ≡ py (mod 101). Noe define si to be the nubmer of prefix products that evaluate to i (mod p) for 0 ≤ i ≤ 100. Since all elements of the sequence are in the region [1, 100], s0 = 0. Therefore, P100 i=1 si = 2016. Given the definition of si , the number of good subsequences can be expressed as P100 si i=1 2 .  is convex, the above function is minimized when the si are all “as close Since the function x2 = x(x−1) 2 together as possible”. This can be rigorized by Karamata’s Inequality. Given all this, the answer is 100   X si i=1

2

≥ 84

    20 21 + 16 = 19320. 2 2

15. A regular 2015-simplex P has 2016 vertices in 2015-dimensional space such that the distances between every pair of vertices are equal. Let S be the set of points contained inside P that are closer to its center than any of its vertices. The ratio of the volume of S to the volume of P is m n , where m and n are relatively prime positive integers. Find the remainder when m + n is divided by 1000. Proposed by James Lin. Answer. 321 . 2015 Solution. I’ll show that a specific vertex has a 2015 chance of being closer to a particular vertex 4032 than the center. It is easier to consider the 2016-simplex in 2016 space, as the vertices are then just A1 =  1 1 1 , 2016 , · · · , 2016 . (1, 0, · · · , 0), A2 = (0, 1, 0, · · · , 0), · · · , A2016 (0, · · · , 0, 1). The center O is then 2016 Consider the vertex A1 of the simplex. Let M be the midpoint of OA1 , and let N be point where the line OA1 hits the opposite face formed be the center of those  by the points A2 , A3 , · · · , A2016 . N Awould 1 1 1 2015 faces, so N = 0, 2015 , 2015 , · · · , 2015 . A direct computation shows that A11M = N 4032 . Consider where the perpendicular bisector of A1 O cuts the simplex. This creates a simplex similar to 2015  1M , as the simplex is 2015 dimensional. This shows that the the larger one, with volume ratio A A1 N probability of being closer to A1 than to O is just as we claimed. No point can be closer to two vertices than the center. This can be seen with the argument of taking 2015 the perpendicular bisector of A1 O. No two of these created simplices will intersect because 2 · 4032 < 1.  2015 2015 Therefore, our desired probability is then 1 − 2016 4032 . When taking (mod 1000), you should not forget to divide out the 2016. 16. Given a (nondegenerate) triangle ABC with positive integer angles (in degrees), construct squares BCD1 D2 , ACE1 E2 outside the triangle. Given that D1 , D2 , E1 , E2 all lie on a circle, how many ordered triples (∠A, ∠B, ∠C) are possible? Proposed by Yang Liu. Answer. 223 . Solution. I claim that the four points will be concyclic if and only if ∠A = ∠B, or C = 45◦ . Assuming that D2 D1 E1 E2 is cyclic, the perpendiculars bisectors of D1 D2 and E1 E2 meet at the circumcenter of D2 D1 E1 E2 . But the perpendicular bisectors of D1 D2 and E1 E2 are just the perpendicular bisectors of BC, AC, so they meet at O, the circumcenter of ABC. In other words, the circumcenters of D2 D1 E1 E2 and ABC coincide. From here, one can use trigonometry and angles to compute OD1 , OE1 and set them equal, solving for the angles. This simplifies nicely and finishes the problem. A synthetic approach follows though. Because AC = CE1 , BC = CD1 , ∠ACD1 = ∠BCE1 , 4ACD1 ∼ = 4E1 CB. This implies that AD1 = E1 B. Along with the fact that OB = OC, OD1 = OE1 , we get that 4BOE1 ∼ = 4COD1 . At this point, 5

OMO Fall 2015 Official Solutions we get two cases. Either BOE1 , COD1 are similarly, or oppositely oriented. If they are oppositely oriented, then ∠AOE1 = ∠AOD1 − ∠D1 OE1 = ∠BOE1 − ∠D1 OE1 = ∠BOD1 . Now because OB = OC, OD1 = OE1 , 4BOD1 ∼ = 4AOE1 =⇒ AE1 = BD1 =⇒ CA = CB, which is the isosceles case. Now assume that the triangles are similarly oriented. Now a spiral similarity centered at O sends BE1 to AD1 . Therefore, ∠D1 OE1 = ∠BOA = 2∠C. Note that a spiral similarity centered at C sends BD1 to E1 A. By the spiral similarity lemma, if we set X = BE1 ∩ AD1 , ∠BXD1 = ∠BCD1 = 90◦ =⇒ 90◦ = ∠D1 XE1 = ∠D1 OE1 = 2∠C =⇒ ∠C = 45◦ . This finishes the proof. Given the lemma, extracting the desired answer is easy. The second paragraph can just be seen with solely angle chasing and similar triangles; I just wanted to present a more conceptual approach. 17. Let x1 . . . , x42 be real numbers such that 5xi+1 − xi − 3xi xi+1 = 1 for each 1 ≤ i ≤ 42, with x1 = x43 . Find the product of all possible values for x1 + x2 + · · · + x42 . Proposed by Michael Ma. Answer. 588 . xn +1 . So Solution. First we notice that we can rearrange the terms of the condition into xn+1 = −3x n +5 x+1 (42) we let f (x) = −3x+5 . Now f (xn ) = xn+1 . So we can see that f (xm ) = xm , for every m.

If we set

 A=

1 −3

 1 5

n 42 then the coefficients of f (n) (x) are the entries  of A  . Now tocalculate  A we need to diagonalize A. 1 1 2 0 So diagonalizing A as P BP −1 we get P = and B = . Thus 1 3 0 4

A42 =



3 × 299 − 2199 3 × 299 − 3 × 2199

 2199 − 299 . 3 × 2199 − 299

Now substituting back into f (42) (xm ) = xm we get that 3x2n − 4xn + 1 = 0. So now we conclude that xm = 1 or xm = 31 for every m. Also notice that f (1) = 1 and f ( 13 ) = 13 . So finishing we see that the two possibilities are 42 and 14. Multiplying we get 42 × 14 = 588. 18. Given an integer n, an integer 1 ≤ a ≤ n is called n-well if   n = a. bn/ac Let f (n) be the number of n-well numbers, for each integer n ≥ 1. Compute f (1)+f (2)+. . .+f (9999). Proposed by Ashwin Sah. Answer. 1318350 . Solution. Let n = ba + r, where 0 ≤ r < a. Then a is n-well if   jrk ba + r a= =a+ b b or equivalently, if r < b. Thus it suffices to compute the number of triples (a, b, r) of positive integers such that ab + r < 10000 and r < min(a, b). First, fix a and consider the number of triples with a < b. In this case, we obtain all numbers ab + r with r < a < b. But every positive integer that is at least a(a + 1) can be written uniquely in this form by the division algorithm, so for each a we get 10000 − a(a + 1) solutions. 6

OMO Fall 2015 Official Solutions The case a > b is symmetric, so we now consider the case a = b. In this case, any number in the form a2 + r satisfies a2 + r < a2 + a < (a + 1)2 , so the integers between 1 and 9999 which can be written in the form a2 + r can only be done so in one way. Thus the number of valid triples (a, a, r) is simply the number of pairs (a, r) with 1 ≤ a ≤ 99 and 0 ≤ r < a, which is 1 + 2 + · · · + 99. So the final answer is 99 X

2(10000 − a2 − a) + a = 1980000 −

k=1

99 · 100 · 199 99 · 100 −2· = 1318350 2 6

19. For any set S, let P (S) be its power set, the set of all of its subsets. Over all sets A of 2015 arbitrary finite sets, let N be the maximum possible number of ordered pairs (S, T ) such that S ∈ P (A), T ∈ P (P (A)), S ∈ T , and S ⊆ T . (Note that by convention, a set may never contain itself.) Find the remainder when N is divided by 1000. Proposed by Ashwin Sah. Answer. 872 . Solution. Let k = 2015. We might as well add in extra elements to make |A| = k, since this can only increase the amount of ordered pairs in question. Now, T ∈ P (P (A)) means that S ⊆ T ⊆ P (A) and S ∈ P (A) means that S ⊆ A. Combining gives S ⊆ P (A) ∩ A. Let |P (A) ∩ A| = x.  Then there are xi possibilities for S where |S| = i. Then T must contain S, a1 , a2 , . . . , ai , where a1 , . . . , ai are the distinct elements of S, which must be distinct from S itself (since they are elements of A and thus are finitely defined, and since they are also elements of S). Then T has 2k − i − 1 other  k elements that it can include or not, for a total of xi 22 −i−1 possibilities when |S| = i. Vary i to get   Px k x x 2k −i−1 = 22 −1 23 . Now this is maximized when x is, and x ≤ k is clear. Furthermore, i=0 i 2 we can attain x = k at A = {{}, {{}}, {{{}}}, . . .}, where there are k nested curly braces in the last k element, since each element of A is in this case also a subset of A. Then Nk = 22 −k−1 3k . We can then find this (mod 1000) fairly easily. An easier to understand version of the optimal A is A = {∅, {∅}, {{∅}}, . . .}, up to k terms, where ∅ = {} is the empty set. 20. Amandine and Brennon play a turn-based game, with Amadine starting. On their turn, a player must select a positive integer which cannot be represented as a sum of nonnegative multiples of any of the previously selected numbers. For example, if 3, 5 have been selected so far, only 1, 2, 4, 7 are available to be picked; if only 3 has been selected so far, all numbers not divisible by three are eligible. A player loses immediately if they select the integer 1. Call a number n feminist if gcd(n, 6) = 1 and if Amandine wins if she starts with n. Compute the sum of the feminist numbers less than 40. Proposed by Ashwin Sah. Answer. 192 . Solution. We claim that the feminist numbers are just the prime numbers greater than three. If we can show that each of those primes p ≥ 5 is a winning position, then we are done - a feminist number n satisfies gcd(n, 6) = 1 and obviously n > 1, so n has a prime divisor q ≥ 5; if n 6= q then after Amandine selects n then Brennon can select q, and it is as if Brennon started with the move q and thus he will win, and it is not a feminist number. Suppose Amandine starts with p ≥ 5, a prime. Then say Brennon does a. Clearly gcd(a, p) = 1, so now there are only finitely many guys that are left to be chosen, and by Chicken McNugget the biggest of these is ap − a − p > 1 since p ≥ 5. We will do a Chomp-like nonconstructive proof. 7

OMO Fall 2015 Official Solutions Suppose that now Brennon will now win, regardless of what Amandine does. If Amandine does ap − a − p, then Brennon can do a winning move b. It is easy to see that ap − a − p is actually a nonnegative combination of a, b, p; then Amandine should have done move b to begin with, and thus win! So actually Amandine wins with some number, we just don’t know which. Thus the answer is 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31 + 37 = 192. 21. Toner Drum and Celery Hilton are both running for president. A total of 2015 people cast their vote, giving 60% to Toner Drum. Let N be the number of “representative” sets of the 2015 voters that could have been polled to correctly predict the winner of the election (i.e. more people in the set voted for Drum than Hilton). Compute the remainder when N is divided by 2017. Proposed by Ashwin Sah. Answer. 605 . Solution. Suppose m = 25 · 2015 people voted for Celery and n = 35 · 2015 for Toner, where m < n. Then the amount that could  nofvoters  nbe chosen with d > 0 more people voting for Toner than Pm of sets Pm m for Celery is i=0 mi d+i = i=0 m−i at the end might be zero d+i , where some of the terms  if m + d > n. By Vandermonde Convolution, this sum is just m+n . Now sum over the possible m+d Pi=m+n m+n differences, which are d = 1, 2, . . . , n. We get i=m+1 . i     m+n 2015 i+1 i+1 2016 Now m + n = 2015, so ≡ i ≡ 2016 i+1 ≡ 2016 (−1)i+1 ≡ (i + 1)(−1)i (mod 2017), using i Wilson’s Theorem. So since m = 52 (2015) = 806, the sum is −808+809−810+. . .−2016 ≡ −808+604(−1) ≡ −1412 ≡ 605 (mod 2017). 22. Let W = . . . x−1 x0 x1 x2 . . . be an infinite periodic word consisting of only the letters a and b. The minimal period of W is 22016 . Say that a word U appears in W if there are indices k ≤ ` such that U = xk xk+1 . . . x` . A word U is called special if U a, U b, aU, bU all appear in W . (The empty word is considered special) You are given that there are no special words of length greater than 2015. Let N be the minimum possible number of special words. Find the remainder when N is divided by 1000. Proposed by Yang Liu. Answer. 535 . Solution. We will prove that you can show that if a word U appears twice in a period of W , then it is part of a special word. To prove this, take a sequence that appears twice in a period of W . Call the occurrences S1 , S2 . Define an extension of a sequence S in W to mean adding the letter immediately following S in W to S. Now, extend S1 , S2 to the right by one letter at a time until they become different. This must happen at some point by the definition of minimal period. Similarly, extend S1 , S2 to the left in a similar way until the letter before them is no longer the same. After doing both these, we have constructed a special word which contains S1 . Therefore, by Pigeonhole, all words of length 2016 appear exactly once in a period of W , or else some word appears twice, and this extends to a special word of length greater than 2015. So for all words U of length at most 2015, aU, bU, U a, U b have length at most 2016, so they are the prefix of some word of length 2016, implying that they all appear in W . So all words of length at most 2015 are special! So our answer is 20 + 21 + 22 + . . . + 22015 = 22016 − 1. A construction of this bound and a sequence which satisfies the condition can be given by the deBrujin sequences. You can find them easily on Wikipedia. 23. Let p = 2017, a prime number. Let N be the number of ordered triples (a, b, c) of integers such that 1 ≤ a, b ≤ p(p − 1) and ab − ba = p · c. Find the remainder when N is divided by 1000000. Proposed by Evan Chen and Ashwin Sah. 8

OMO Fall 2015 Official Solutions Answer. 512256 . Solution. Let p = 2017. If p|a or vice versa then p|a, b, and all of these work. This adds (p − 1)2 possibilities. Now all numbers n from 1 to p(p−1) not divisible by p can be uniquely determined by 0 ≤ f (n), g(n) ≤ p − 2, where n ≡ g f (n) (mod p), where g is a fixed primitive root, and where n ≡ g(n) (mod p − 1). So now say a ≡ g w (mod p), b ≡ x (mod p − 1), a ≡ y (mod p − 1), b ≡ g z (mod p), where 0 ≤ w, x, y, z ≤ p − 2. Fixing these will uniquely determine a and b between 1 and p(p − 1). If p|ab − ba , the reduces to p|g wx − g yz ⇔ p − 1|wx − yz, where 0 ≤ w, x, y, z ≤ p − 2. We’ll find the number of four-tuples satisfying this in general. (As in, four tuples (w, x, y, z) such that wx ≡ yz (mod n), for 0 ≤ w, x, y, z ≤ n − 1.) First use the Chinese Remainder Theorem to reduce it to wx ≡ yz (mod q k ) for primes q. Call the resulting answer in this case f (q k ). Then let g(i) for 0 ≤ i ≤ k be the amount of solutions to wx ≡ q i (mod q k ). We can then easily see Pk that the desired sum is i=0 g(i)2 φ(q k−i ). This comes from the fact that there are φ(q k−i ) numbers m from 1 to q k such that υq (m) = i. Squaring g(i) comes from the number of ways for wx ≡ q i (mod q k ) times the number of ways for yz ≡ q i (mod q k ), which are both g(i). Now we’ll turn to computing g(i). If 0 ≤ i ≤ k − 1, there are i + 1 ways to fix υq (w) and υq (x). Afterwards, there are exactly φ(q k ) = q k−1 (q − 1) to multiply w, x by integers relatively prime to q k to ensure that wx ≡ q i (mod q k ). Therefore, g(i) = (i + 1) · φ(q k ). Our total contribution in this case is k−1 X

(i + 1)2 φ(q k )2 · φ(q k−i )

i=0

For i = k, if υp (w) = j ≤ k, then we can choose w in φ(q k−j ) ways, and then x such that q k−j |x, in q j ways. Therefore, k X g(k) = φ(q k−j )q j . i=0

The total contribution in this case is therefore 2  k X g(k)2 φ(1) = g(k)2 =  φ(q k−j )q j  . j=0

Given these above formulas, we can now compute the answer for p−1 = 2016 = 25 ·32 ·7. Straightforward computations give that f (25 ) = 48640, f (32 ) = 945, f (71 ) = 385. Therefore, our final answer is (adding back (p − 1)2 from the top) f (25 )f (32 )f (71 ) + 20162 ≡ 512256 (mod 106 ). 24. Let ABC be an acute triangle with incenter I; ray AI meets the circumcircle Ω of ABC at M 6= A. Suppose T lies on line BC such that ∠M IT = 90◦ . Let K be the foot of the altitude from I to T M . 77 BK m Given that sin B = 55 73 and sin C = 85 , and CK = n in lowest terms, compute m + n. Proposed by Evan Chen. Answer. 5702 . Solution. Let X be the major arc midpoint. Let ray XI meet the circumcircle of BIC (centered at M ) again at J. Then BICJ is harmonic, K is the midpoint of IJ and in particular lies on Ω. Moreover, ray KX is the angle bisector of ∠BKC, so if we let L be the intersection of IK with BC we deduce  2 BK BT sin2 C/2 BI = = = . KC TC IC sin2 B/2 9

OMO Fall 2015 Official Solutions From the givens, we have cos B =

48 73 ,

cos C =

1 2 (1 1 2 (1

− −

36 85 ) 48 73 )

36 85 ,

and hence the requested ratio is

=

49 · 73 3577 = . 85 · 25 2125

Hence an answer of 3577 + 2125 = 5702. 25. Define kA − Bk = (xA − xB )2 + (yA − yB )2 for every two points A = (xA , yA ) and B = (xB , yB ) in the plane. Let S be the set of points (x, y) in the plane for which x, y ∈ {0, 1, . . . , 100}. Find the number of functions f : S → S such that kA − Bk ≡ kf (A) − f (B)k (mod 101) for any A, B ∈ S. Proposed by Victor Wang. Answer. 2040200 . Solution. We solve this problem with 101 replaced by an arbitrary prime p ≡ 1 (mod 4). Let P (A, B) denote the proposition that kA − Bk ≡ kf (A) − f (B)k (mod 101) for points in the plane A, B. Let 0 denote the point (0, 0). Most of the dots below denote dot product. First translate so that f (0) = 0 (we multiply the count by p2 at the end). Then considering P (x, 0), P (y, 0), and P (x, y), and noting p is odd yields f (x) · f (y) ≡ x · y (mod p) for all points x, y. Now fix x, y. Then f (x + y) · f (t) ≡ x · t + y · t ≡ f (x) · f (t) + f (y) · f (t) (mod p); therefore, [f (x + y) − f (x) − f (y)] · f (t) ≡ 0 (mod p) for all points t. Assume for the sake of contradiction that f (x + y) − f (x) − f (y) = (a, b) with at least one of a, b nonzero. Then for all points t, we have (a, b) · f (t) ≡ 0 (mod p), or equivalently, for all t, there exists an integer g(t) such that f (t) = (−g(t)b, g(t)a) (mod p). In particular, we have u2 + v 2 ≡ kf (u, v)k2 ≡ g(u, v)2 (b2 + a2 ) (mod p) for all residues u, v. On the other hand, by Pigeonhole or direct calculations, we know that u2 + v 2 can hit any residue (mod p), 2 2 2 2 because there are p+1 2 values that are achievable by u . Yet g(u, v) (b +a ) is a square times a constant p+1 2 2 (b + a ), which covers at most 2 < p values, contradiction. Thus f (x + y) ≡ f (x) + f (y) for all x, y. Let f (1, 0) = (A, B) and f (0, 1) = (C, D). Since kf (x)k2 = kxk2 , we need A2 + B 2 ≡ C 2 + D2 ≡ 1. Therefore, f (u, v) ≡ (Au + Cv, Bu + Dv). By linearity, we just need to check u2 + v 2 ≡ (Au + Cv)2 + (Bu + Dv)2 , which boils down to 0 ≡ 2(AC + BD)uv for all u, v. Therefore our desired answer is simply p2 times the number of solutions to the system A2 + B 2 ≡ C 2 +D2 ≡ 1, AC +BD ≡ 0. We will use i to denote an integer such that i2 ≡ −1 (mod p). This integer exists as p ≡ 1 (mod 4). We can parameterize A+iB ≡ α, A−iB ≡ α−1 , C +iD ≡ β, C −iD ≡ β −1 for nonzero residues α, β. Now AC +BD ≡ 0 is equivalent to (α+α−1 )(β +β −1 )−(α−α−1 )(β −β −1 ) ≡ 0, or α2 + β 2 ≡ 0. For each (nonzero) α, there are exactly 2 choices for β (as once again, −1 is a square (mod p)), so our final answer is p2 [2(p − 1)] = 2p2 (p − 1). Remark : Counting the number of solutions to A2 + B 2 ≡ C 2 + D2 ≡ 1, AC + BD ≡ 0 is essentially counting orthogonal 2 × 2 matrices over the finite field Fp . A more natural way to word the problem statement is that you are being asked to compute the number of isometries of the plane in F2p . 26. Let ABC be a triangle with AB = 72, AC = 98, BC = 110, and circumcircle Γ, and let M be the midpoint of arc BC not containing A on Γ. Let A0 be the reflection of A over BC, and suppose M B meets AC at D, while M C meets AB at E. If M A0 meets DE at F , find the distance from F to the center of Γ. Proposed by Michael Kural. Answer. 231 . 10

OMO Fall 2015 Official Solutions Solution 1. Let G be the intersection of BC and AM , O be the center of Γ, and F 0 the Miquel point of complete quadrilateral ABCDEM . Also, let ω be the circle centered at M passing through B and C. We claim that F 0 is the inverse of G with respect to Γ, and furthermore that F 0 = F . First, Miquel’s theorem on triangle AED with respect to F, C, and B implies that F 0 lies on DE. It is also well-known that OF 0 ⊥ DE.1 For sake of completeness, this can be proved as follows: F 0 is the spiral similarity center mapping M C to BA, so letting X, Y be the midpoints of M C, AB, we get that the same spiral similarity also maps X to Y . Thus F 0 XY E is cyclic (since F 0 is the Miquel point of M BXY ), but this is the circle with diameter OE, so OF 0 ⊥ F 0 E as desired. Now by Brokard’s theorem, ED is the polar of G. This implies that O, G, F 0 are collinear, and furthermore that F 0 is the inverse of G with respect to Γ. It then suffices to show that F 0 lies on M A0 . Indeed, we claim that F 0 and A0 are inverses with respect to ω. Note that ∠M BA0 = ∠A0 BC − ∠M BC = ∠ABC − ∠M CB = ∠BEM = ∠BF 0 M and similarly, ∠M CA0 = ∠M F 0 C. A0 is uniquely determined by these two angle conditions, so it must be the inverse of F 0 . Thus F 0 = F , as desired. 2

R , where R is the circumradius of 4ABC. Straightforward computaFinally, it’s left to find OF 0 = OG tion yields s = 140, p √ √ K = s(s − a)(s − b)(s − c) = 140 · 30 · 42 · 68 = 840 17

and

abc 72 · 98 · 110 231 √ = =√ 4K 4 · 840 17 17 where s, K, R refer to the semiperimeter, area, and circumradius of 4ABC respectively. Additionally, R=

BG = Let N be the midpoint of BC, so GN =

792 72 · 110 = . 72 + 98 17

143 17 .

Then

p p OG = GN 2 + N O2 = GN 2 + R2 − AG2 =

s

143 17

2 +

231 2312 − 552 = 17 17

Giving us our final answer of R2 2312 17 = · = 231. OG 17 231

Solution 2. First, we prove a lemma. Lemma 1 (Commutativity of Inversion). Suppose (A), (B), (C) are circles centered at A, B, C, and denote by α, β, γ the inversions about these circles. Suppose that α switches (B) and (C). Then for any point P in the plane, betaα(P ) = αγ(P ).2 Proof. Let Γ be the circle through P orthogonal to (A) and (B). Since inversion preserves orthogonality, Γ is orthogonal to (C) as well. Let (A) intersect Γ at A1 and A2 , and define B1 , B2 , C2 , C2 similarly. Note that AA1 , etc. are tangent to Γ, and that without loss of generality, A, B1 , C1 and A, B2 , C2 are collinear triples of points. Let AP meet Γ again at Q, CP meet Γ again at R, and AR meet Γ again at S. Now Q=α(P ), R = γ(P ), and S = αγ(P ), so it suffices to show that S = β(Q), or that B, S, Q are collinear. But (C1 , C2 ; P, R) is harmonic and inversion preserves cross products, so after applying α, we get that (B1 , B2 ; S, Q) is harmonic as well. This implies B, S, Q are collinear. 1 See

http://yufeizhao.com/olympiad/cyclic_quad.pdf for more details about this configuration. to Victor Reis, from http://www.artofproblemsolving.com/community/c6h595784p3536985.

2 Credits

11

OMO Fall 2015 Official Solutions Now we can directly apply the above lemma on ω, Γ, and BC (as the image of Γ after inversion about ω is the line BC). Inversion with respect to a line is simply reflection across that line. Applying the lemma to point A implies that the inverse of A0 with respect to ω is the inverse of G with respect to Γ (as G is the inverse of A with respect to ω). This easily leads us to the finish after showing that the inverse of G lies on ED as before.   27. For 0 ≤ m, n ≤ 64, let α(m, n) be the number of nonnegative integers k for which m/2k and  integers  n/2k are both odd integers. Consider a 65 × 65 matrix M whose (i, j)th entry (for 1 ≤ i, j ≤ 65) is (−1)α(i−1,j−1) . Compute the unique integer 0 ≤ r < 1000 such that det M ≡ r (mod 1000). Proposed by Evan Chen. Answer. 208 . Solution 1. Lemma 2. Let A be a n × n invertible matrix, and let B be the 2n × 2n block matrix   A A B= . A −A Then det B = (−2)n (det A)2 . Proof. Perform row reductions which reduce A to a diagonal matrix on the first n rows of B, and then again on the second n rows of B. The determinant of B is preserved, and the new matrix is in the form   λ1 0 . . . 0 λ1 0 ... 0  0 λ2 . . . 0 0 λ2 . . . 0     .. .. . . .. .. .. ..  . ..  . . . . . . .   0 0 . . . λn 0 0 . . . λn    λ1 0 . . . 0 −λ1 0 ... 0     0 λ2 . . . 0 0 −λ2 . . . 0    . .. . . .. .. .. ..  ..  .. . . . . . . .  0

0

...

λn

0

0

...

−λn

where det A = λ1 λ2 · · · λn . Subtracting each row k from each row n + k yields the upper triangular matrix   λ1 0 . . . 0 λ1 0 ... 0  0 λ2 . . . 0 0 λ2 ... 0     .. .. . . .. .. .. ..  . . . . . . . . . .    0 0 . . . λn 0 0 ... λn    0 0 . . . 0 −2λ1 0 ... 0    0 0 ... 0 0 −2λ2 . . . 0    . .. . . .. .. .. ..  ..  .. . . . . . . .  0 0 ... 0 0 0 . . . −2λn Thus det B = λ1 λ2 · · · λn (−2λ1 )(−2λ2 ) · · · (−2λn ) = (−2)n (det A)2 as desired.

12

OMO Fall 2015 Official Solutions Now denote by Mn the matrix of side length n with entries as described in the problem. We claim that   M2n M2n M2n+1 = . M2n −M2n It suffices to show that for 0 ≤ i, j < 2n , (−1)α(i,j) = (−1)α(i+2

n

,j)

n

= (−1)α(i,j+2

)

n

= −(−1)α(i+2

,j+2n )

But it’s easy to see α(x, y) is the number of places for which x and y both have a 1 in their respectives binary representations. Thus α(i, j) = α(i + 2n , j) = α(i, j + 2n ) = α(i + 2n , j + 2n ) − 1 implying the above. We wish to compute det M65 , and to do this, we first compute det M64 . Note that det M20 = 1, det M21 = −2, and for n ≥ 1, n

n

det M2n+1 = (−2)2 (det M2n )2 = 22 (det M2n )2 so is easy to prove by induction that for n > 1, n−1

det M2n = 2n·2

Now consider M2n +1 . After subtracting the first row from the last, the matrix is in the form " # .. . . M2n +1 = M2n 0 −2 where the bottom left 0 represents a row of 0s. Thus by cofactor expansion, n−1

det M2n +1 = (−2) det M2n = −2n·2

+1

Plugging in n = 6 yields a determinant of −2193 , which is easily computed to be 208 (mod 1000). Solution 2. In M2n , consider any two different row vectors. We claim that they are orthogonal, i.e. that for any 0 ≤ i, j < 2n , n 2X −1 (−1)α(i,k)+α(j,k) = 0. k=0

We prove this by induction. For n = 1, the base case, it is clear. Otherwise, let vi and vj be the row vectors corresponding to some i and j in M2n+1 . Also, let a1 , a2 , · · · a2n and b1 , b2 , · · · b2n denote the first 2n entries of vi and vj . By a similar argument to that of the first solution, we get that if i < 2n , then vi = ha1 , a2 , · · · a2n , a1 , a2 , · · · a2n i and if i ≥ 2n , then vi = ha1 , a2 , · · · a2n , −a1 , −a2 , · · · − a2n i So if i 6≡ j (mod 2n ), then the first and second halve of each of the two vectors are orthogonal, implying that vi and vj are orthogonal. If j = i + 2n , then vi · vj = a21 + · · · + a22n − a21 − · · · − a22n = 0 so vi and vj are orthogonal in all cases. Now since the matrix is symmetric, this implies that all entries in M22n are 0 other than the entires n on the diagonal. But the entries on the diagonal are clearly 2n , so (det M2n )2 = det M22n = 2n·2 . We can’t actually determine the sign of det M2n using this solution approach, but we get that det M2n = n−1 ±2n·2 , with the way to obtain the correct sign and how to finish described in the first solution. 13

OMO Fall 2015 Official Solutions 28. Let N be the number of 2015-tuples of (not necessarily distinct) subsets (S1 , S2 , . . . , S2015 ) of {1, 2, . . . , 2015} such that the number of permutations σ of {1, 2, . . . , 2015} satisfying σ(i) ∈ Si for all 1 ≤ i ≤ 2015 is odd. Let k2 , k3 be the largest integers such that 2k2 |N and 3k3 |N respectively. Find k2 + k3 . Proposed by Yang Liu. Answer. 2030612 . Solution. Call a permutation good if it satisfies the desired property. Consider each subset as a vector in {0, 1}2015 , and write these vectors in a 2015 × 2015 matrix in order. Define the permanent of this matrix to be the unsigned determinant, i.e. for all permutations σ, n XY

aiσ(i) .

σ i=1

By definition, this obviously counts the number of good permutations. On the other hand, the determinant is n X Y (−1)sgn(σ) aiσ(i) , σ

i=1

where sgn denotes the sign of the permutation. Now we work in F2 for the remainder of the solution. Note that permanent is congruent to determinant (mod 2), so we want a nonzero determinant in F2 . This is equivalent to these 2015 vector to be linearly independent. To count this, choose the rows of the matrix one by one. The first row can clearly be picked in 22015 − 1 ways, since we can pick anything other than the 0-vector. When picking the i + 1-st row, the span of the previous i rows has size 2i by linear independence. So we can pick the i + 1-st row in 22015 − 2i ways, that is, anything not in the span of the previous i rows. So the total number of n-tuples of subsets is 2014 Y (22015 − 2i ). i=0

Now we can see that k2 = 2029105, and we can compute that k3 = 1507 with some simple applications of the lifting the exponent lemma (LTE). So k2 + k3 = 2030612. 29. Given vectors v1 , . . . , vn and the string v1 v2 . . . vn , we consider valid expressions formed by inserting n − 1 sets of balanced parentheses and n − 1 binary products, such that every product is surrounded by a parentheses and is one of the following forms: • A “normal product” ab, which takes a pair of scalars and returns a scalar, or takes a scalar and vector (in any order) and returns a vector. • A “dot product” a · b, which takes in two vectors and returns a scalar. • A “cross product” a × b, which takes in two vectors and returns a vector. An example of a valid expression when n = 5 is (((v1 · v2 )v3 ) · (v4 × v5 )), whose final output is a scalar. An example of an invalid expression is (((v1 × (v2 × v3 )) × (v4 · v5 )); even though every product is surrounded by parentheses, in the last step one tries to take the cross product of a vector and a scalar. Denote by Tn the number of valid expressions (with T1 = 1), and let Rn denote the remainder when Tn is divided by 4. Compute R1 + R2 + R3 + . . . + R1,000,000 . Proposed by Ashwin Sah. Answer. 320 .

14

OMO Fall 2015 Official Solutions Solution. So let Sn be the number of ways to insert n − 1 pairs of parentheses among n vectors to get a scalar result and Vn with a vector result. So S1 = 0, V1 = 1. Pn−1 Pn−1 Pn−1 A recursion argument gives that Sn = Sk Sn−k + k=1 Vk Vn−k and Vn = 2 k=1 Sk Vn−k + k=1 Pn−1 k=1 Vk Vn−k . P P Define S(x), V (x) to be the generating functions of {Si }, {Vi }; so S(x) = i≥1 Si xi , V (x) = i≥1 Vi xi . Then by the above recurrences, S(x) = S(x)2 + V (x)2 , V (x) − x = 2S(x)V (x) + V (x)2 . So V (x) − x = 2S(x)V (x) + S(x) − S(x)2 , and thus V (x)(1 − 2S(x)) = x + S(x) − S(x)2 . Then (1 − 2S(x))2 S(x) = (1 − 2S(x))2 S(x)2 + (x + S(x) − S(x)2 )2 . For the below, note that f (x)2 = f (x2 ) in F2 [[x]] (otherwise known as power series with coefficients (mod 2)) for a power series f . Taking (mod 2) gives S(x) ≡ x2 + S(x4 ) (mod 2), so S(x) ≡ x2 + x8 + x32 + x128 + . . . by recursively substituting x → x4 . Similarly, (mod 2) gives V (x) ≡ x + V (x2 ) (mod 2), too, so V (x) ≡ x + x2 + x4 + x8 + . . . (mod 2). Now we can move onto (mod 4). Notice that stuff within squares can be taken modulo 2. In other words, knowing if f (x) ≡ g(x) (mod 2), then f (x)2 ≡ g(x)2 (mod 4). So S(x) ≡ (x2 + x8 + x32 + . . .)2 + (x + x2 + x4 + x8 + . . .)2 . And V (x) = x + V (x)2 + 2S(x)V (x) ≡ x + (x + x2 + x4 + x8 + . . .)2 + 2(x2 + x8 + x32 + . . .)(x + x2 + x4 + x8 + . . .)

(mod 4).

Add the two to find S(x) + V (x) ≡ 2

4

8

2

2

8

32

x+2(x+x +x +x +. . .) +(x +x +x +. . .)2 +2(x2 +x8 +x32 +. . .)(x+x2 +x4 +x8 +. . .)

(mod 4).

Then we can find that R(x) is 1 (mod 4) for x powers of four, 2 (mod 4) for twice powers of four and numbers n = 2a + 2b for a 6= b and not both even. The rest are divisible by four. Now 20 , 21 , · · · , 219 are the powers of two that are less than 1000000.   From being powers of four and 10 twice powers of 4, this contributes a sum of 30. There are 20 − 2 2 = 145 ways to choose two of the numbers from 0 to 19 to not be both even. These contribute a sum of 2 · 145 = 290. Summing both of these gives 30 + 290 = 320. 30. Ryan is learning number theory. He reads about the M¨ obius function µ : N → Z, defined by µ(1) = 1 and X µ(n) = − µ(d) d|n d6=n

for n > 1 (here N is the set of positive integers). However, Ryan doesn’t like negative numbers, so he invents his own function: the dubious function δ : N → N, defined by the relations δ(1) = 1 and X δ(n) = δ(d) d|n d6=n

for n > 1. Help Ryan determine the value of 1000p + q, where p, q are relatively prime positive integers satisfying ∞ p X δ(15k ) = . q 15k k=0

Proposed by Michael Kural. 15

OMO Fall 2015 Official Solutions Answer. 11007 . Solution 1. Throughout this solution, [xi ] denotes the coefficient of xi in some power series of x. Let f (i, j) = δ(3i 5j ), and let X F (x, y) = f (i, j)xi y j . i,j≥0

Note that for (i, j) 6= (0, 0), X

2f (i, j) = 2δ(3i 5j ) =

δ(3k 5l ) =

0≤k≤i 0≤l≤j

X

f (k, l)

0≤k≤i 0≤l≤j

Let g(i, j) =

X

f (k, l)

0≤k≤i 0≤l≤j

Then

X X F (x, y) = g(i, j)xi y j = −1 + 2f (i, j)xi y j = 2F (x, y) − 1 (1 − x)(1 − y) i,j≥0

i,j≥0

implying after rearrangement that 1 F (x, y) = 2

 1+

1 1 − 2x − 2y + 2xy

 .

Now it simply suffices to find the generating function for the diagonal of F , or the coefficients of its xi y i terms. If G(x, y) is a formal power series with G(0, 0) = 0, we can write 1 = 1 + G(x, y) + G(x, y)2 + G(x, y)3 + · · · 1 − G(x, y) so if we let F1 (x, y) =

1 1−2x−2y+2xy

for simpification purposes, then       1 1   F1 (x, y) = 2(x + y)  1 + 2xy  1− 1 + 2xy !      2 1 2(x + y) 2(x + y) = 1+ + + ··· 1 + 2xy 1 + 2xy 1 + 2xy

Now it suffices to find D(z) =

X 1 1 ([xi ][y i ]F1 )z i (indeed, our final answer will be (1 + D( )). Note 2 15 i≥0

that as 1 + 2xy only has equal coefficients in x, y, we can disregard any terms in the second expression in the form cxi y j for i 6= j (why?). If n is odd, then (x + y)n is homogeneous of odd degree, and thus all of its terms can be disregarded in computing D(z). If n = 2k is even, then (x + y)n has exactly one symmetric term (a term in the form cxi y i ), namely 2k k k k x y . From these, and the fact that a term in the form cxi y j for i 6= j cannot have any symmetric terms when multiplied by a power series of xy, it follows that    X   k 1 2k (4z)   D(z) = 1 + 2z k (1 + 2z)2k k≥0

16

OMO Fall 2015 Official Solutions  It is well-known (and can be derived by the Binomial Theorem and the identity that

− 21 k



= (−4)n



 2k ) k

X 2k  1 √ = sk 1 − 4s k≥0 k

so  D(z) = Then directly plugging in z =

1 15

1 1 + 2z





 1

q

1−

16z (1+2z)2

= √

1 1 − 12z + 4z 2

yields our final fraction 1 1 11 (1 + D( )) = 2 15 7

and final answer 1000 · 11 + 7 = 11007 Comment. There are several alternate solutions which use a similar approach. A more direct, but 1 ) is to evaluate the constant term of slightly less rigorous approach to finding D( 15 F1 (x,

1 1 )= 2 15x 1 − 2x − 15x +

2 15

considered as a doubly infinite formal series in x. The issue here is that in general, we can’t use a formal Laurent series (series with negative powers of x) unless the negative powers are bounded below, but it will work for our purposes for extracting the answer. Indeed, simply expanding    k 15 X 30x 15 1 2 = + 2 17 1 − 30x 17 17 17x 17 − 17x k≥0

and extracting the constant terms as before gives the correct answer. 1 If we instead use the function F1 (x, 15x ) on C, we can use a technique from complex analysis, as opposed 1 to combinatorial expansion. To find the constant term of an expansion of F1 (x, 15x ), it suffices to find the contour integral Z 1 1 1 F1 (x, )dx 2πi γ x 15x

where γ is a ”small” counterclockwise circular path around 0. This is equal to the residue at the smaller 1 of the two poles of x1 F1 (x, 15x ); formally, some care must be taken to show essentially how small the circle is, and thus which poles are contained within it. (The answer for the curious is that such a pole 1 must of x1 F1 (x, xz ) must approach 0 as z approaches 0, where z is currently taken as 15 .) So note that

15 1 1 1 1 F1 (x, ) = =− 2 2x 1 2 x x 2 (x − 6 )(x − 25 ) x − 2x − 15 + 15 1 15 1 which has residue − 1 2 = at 61 , yielding D( 15 ) = 15 7 as before. 7 2( 6 − 5 ) Finally, using the factorization of the denominator above, there is simpler way to determine the coefficient of x1 , but again formally care would have to be taken regarding what the ”correct” expansion in x is. Note that   15 1 1 1 1 = − − 2 (x − 16 )(x − 25 ) 7 x − 16 x − 25 but this cannot be expanded directly as a normal power series in x to determine the coefficient of x1 here. Instead, for similar subtle reasons as above regarding which poles to take the residues at, we should expand this as        −1−k X  5 k+1 15 1 1 5 1 15  X 1 15  = xk  + xk  1 + 2 7 x 1 − 6x 7 6 7 2 1 − 5x 2 k≤−1

17

k≥0

OMO Fall 2015 Official Solutions which has

15 7

as the coefficient of

1 x.

For more information regarding determining the diagonal of a generating function, see Enumerative Combinatorics Volume 2 by Richard Stanley. Solution 2. The following solution is due to Kevin Ren. Throughout this solution, the binomial coefficient ab is considered to be 0 if a < 0, b < 0,b > a, Note that because the denominator of F (x, y) from solution 1 is 1 − 2x − 2y + 2xy, the recursion f (i, j) = 2f (i − 1, j) + 2f (i, j − 1) − 2f (i − 1, j − 1) holds for i, j > 0 and (i, j) 6= (1, 1). This can also be derived directly from the recursive definition of f (i, j). We claim by induction that for (k, l) 6= (0, 0), X k ` f (k, `) = 2k+`−i−1 i i i≥0

The base cases f (k, 0) = f (0, k) = 2k−1 , k > 0 and f (1, 1) = 3 are easily established. The inductive step follows as           X k `−1 k−1 `−1 k−1 ` +2 − f (k, l) = 2 2k+`−i−3 2 i i i i i i i≥0             X k−1 ` k `−1 k−1 `−1 k−1 `−1 = 2k+`−i−1 + − + i i i i i i i−1 i−1 i≥0    X k ` = 2k+`−i−1 i i i≥0

where the second equality follows from    X     X k−1 `−1 k−1 `−1 2k+`−(i−1)−1 = 2k+`−i−1 2 i−1 i−1 i i i≥0

i≥0

and the third follows from the identity            k−1 `−1 k k ` ` = − − i−1 i−1 i i−1 i i−1             k ` k−1 ` k `−1 k−1 `−1 = − − + . i i i i i i i i Thus now, to compute D(z) as in the first solution, it suffices to derive an expression for D(z) =

X

z

k≥0

Also note that

X k 2 i≥0

i

22k−i =

k

X k 2 i≥0

i

22k−i

X  k 2 X k 2 2k+i = 2k+i . k−i i i≥0

i≥0

18

OMO Fall 2015 Official Solutions so we can derive D(z) =

X

k

(2z)

k≥0

=

X

X k  i

i≥0

2i

(2z)k [tk ]((1 + 2t)(1 + t))k

k≥0

=

X

(2z)k [tk ]((1 + 3t + 2t2 )k

k≥0

  k (3t + 2t2 )n n k≥0 n≥0   X X m+n (2z)m+n [tm ] = (3 + 2t)n n m≥0 n≥m    X X m+n n m n−m (2z)m+n 2 3 = n m m≥0 n≥m    X X  4z m m+n n 2m = (6z) 3 m 2m m≥0 n≥0       X 4z m 2m (6z)m = 3 m (1 − 6z)2m+1 =

XX

(2z)k [tk ]

m≥0

=

1 1 q 1 − 6z 1 −

=√

32z 2 (1−6z)2

1 1 − 12z + 4z 2

and we can finish as before.

19

The Online Math Open Spring Contest Official Solutions March 18 - 29, 2016

Acknowledgements Head Problem Staff • Yang Liu • James Lin • Michael Kural • Yannick Yao

Problem Contributors and Test Solvers • Ashwin Sah • Michael Ma • Vincent Huang • Tristan Shin

Website Manager • Douglas Chen

Python/LATEX Geek • Evan Chen

OMO Spring 2016 Official Solutions 1. Let An denote the answer to the nth problem on this contest (n = 1, . . . , 30); in particular, the answer to this problem is A1 . Compute 2A1 (A1 + A2 + · · · + A30 ). Proposed by Yang Liu. Answer. 0 . Solution. Since A1 is the answer to this problem, we know that A1 = 2A1 (A1 + A2 + · · · + A30 ). This means that either A1 = 0 or A1 + A2 + · · · + A30 = 21 . The latter is impossible because all answers are nonnegative integers. Therefore, A1 = 0. 2. Let x, y, and z be real numbers such that x + y + z = 20 and x + 2y + 3z = 16. What is the value of x + 3y + 5z? Proposed by James Lin. Answer. 12 . Solution. We present three different solutions. Solution 1. Note that x + y + z, x + 2y + 3z, x + 3y + 5z form an arithmetic sequence, giving us answer of 12. Solution 2. Subtracting the first equation from twice the second gives that x + 3y + 5z = 2(x + 2y + 3z) − (x + y + z) = 2(16) − 20 = 12. Solution 3. Note that we are given three variables but only two equations, so assuming that the answer is constant, we can assume x = 0. Then, y + z = 20 and 2y + 3z = 16, and solving gives y = 44 and z = −24. Hence, 3y + 5z = 132 − 120 = 12.

3. A store offers packages of 12 pens for $10 and packages of 20 pens for $15. Using only these two types of packages of pens, find the greatest number of pens $173 can buy at this store. Proposed by James Lin. Answer. 224 . Solution. For every $30, it’s clear that our best option is to buy 40 pens through the latter option. After we do this 5 times, we are left with $23, which we can use to either buy two packages of 12 pens or a package of 20 pens. The first option is better, giving 5 · 40 + 2 · 12 = 224 pens. 4. Given that x is a real number, find the minimum value of f (x) = |x + 1| + 3|x + 3| + 6|x + 6| + 10|x + 10|. Proposed by Yannick Yao. Answer. 54 . Solution. Notice that it suffices to minimize the last term because its coefficients is as large as the sum of the other three (in other words, the slope of f (x) will be nonpositive when x + 10 < 0, and will be nonnegative when x + 10 > 0). Therefore the minimum is achieved when x + 10 = 0, or x = −10, and this minimum is f (−10) = 9 + 3 · 7 + 6 · 4 = 54. 5. Let ` be a line with negative slope passing through the point (20, 16). What is the minimum possible area of a triangle that is bounded by the x-axis, y-axis, and `? Proposed by James Lin. 1

OMO Spring 2016 Official Solutions Answer. 640 . Solution. Let l have a slope of −k for a positive real number k, so that l intersects the √ √ x-axis at 16 128 (10k 2 − 8 2)2 (20+ , 0) and the y-axis at (0, 16+20k). Then, the area is 320+200k+ = +640 ≥ k k k 4 640, giving a minimal area of 640 at k = . 5 6. In a round-robin basketball tournament, each basketball team plays every other basketball team exactly once. If there are 20 basketball teams, what is the greatest number of basketball teams that could have at least 16 wins after the tournament is completed? Proposed by James Lin. Answer. 7 . Solution. We will show that the answer is 7. It’s clear that each team with at least 16 wins must have at most 3 losses. Assume  for  the sake of contradiction that there are 8 such teams with at most 8 3 losses. Then, consider the = 28 games among these 8 teams, which must consist of 28 losses. 2 28 By the Pigeonhole Principle, some team must have at least = 3.5 losses, which is a contradiction. 8 Hence, our answer is at most 7. For the construction, let the 7 teams with at least 16 wins be labeled 0, 1, · · · , 6. Say that team i beats team j for i 6= j if and only if i − j (mod 7) ∈ {1, 2, 3}. Then, each team will have 3 wins and 3 losses among these 7 teams, and let these teams beat all of the 13 other teams. In this scenario, it is clear that each team has 16 wins. 7. Compute the number of ordered quadruples of positive integers (a, b, c, d) such that a! · b! · c! · d! = 24!. Proposed by Michael Kural. Answer. 28 . Solution. Without loss of generality assume a ≤ b ≤ c ≤ d. Of course, d ≤ 24. If d = 24, then a = b = c = 1, so we get the solution (1, 1, 1, 24). Otherwise, we must have 23 | a! · b! · c! · d!, so 23 | d!. But as 23 is prime, we must have d = 23. So a! · b! · c! = 24. Now c ≤ 4. If c = 4, then a = b = 1, so we get the solution (1, 1, 4, 23). Otherwise, 3 | a! · b! · c!, so 3 | c!, and c = 3. Thus a! · b! = 4, from which it is clear that a = b = 2. Thus we get the final solution (2, 2, 3, 23). Finally, the number of ordered quadruples is the number of nonequivalent permutations of (1, 1, 1, 24), 4! 4! (1, 1, 4, 23), and (2, 2, 3, 23), which is 4! 3! + 2! + 2! = 4 + 12 + 12 = 28. 8. Let ABCDEF be a regular hexagon of side length 3. Let X, Y, and Z be points on segments AB, CD, and √ EF such that AX = CY = EZ = 1. The area of triangle XY Z can be expressed in the form a b where a, b, c are positive integers such that b is not divisible by the square of any prime and c gcd(a, c) = 1. Find 100a + 10b + c. Proposed by James Lin. Answer. 2134 .

2

OMO Spring 2016 Official Solutions Solution. We present three solutions to this problem. Solution 1. Extend lines AB, CD, EF to intersect at AB ∩ CD = G, CD ∩ EF = H, EF ∩ AB = I. ◦ Then, GH = HI = IG = 9. Note that IX = 4, IZ = 5, and ∠XIZ √ = 60 , so by the Law of Cosines, √ 21 3 XZ = 21. Then, since XY = Y Z = ZX, the area of XY Z is , so the answer is 2134. 4 [XIZ] 4 5 20 Solution 2. Notice that = · = , so since [XIZ] = [Y GX] = [ZHY ], we get that [GHI] √ 9 9 81 √ 21 81 3 21 3 [XY Z] = . Because [GHI] = , it follows that [XY Z] = and the answer is 2134. [GHI] 81 4 4 Solution 3. Let O be the center of equilateral triangle XY Z, √ √ so it’s the center of ABCDEF as well. √ 21 3 1 3 3 Let the foot of O to AB be K. Then XK = and KO = , so XO = 7 giving [XY Z] = . 2 2 4 Hence the answer is 2134. 9. Let f (n) = 1 × 3 × 5 × · · · × (2n − 1). Compute the remainder when f (1) + f (2) + f (3) + · · · + f (2016) is divided by 100. Proposed by James Lin. Answer. 24 . Solution. We evaluate modulo 4 and modulo 25. f (1), f (2), f (3), f (4) are 1, 3, 3, 1 (mod 4), respectively, and repeat every four integers, so hence our answer is 504 · (1 + 3 + 3 + 1) ≡ 0 (mod 4). Notice that f (n) is divisible by 25 for n ≥ 8. f (1) + f (2) + f (3) + f (4) + f (5) + f (6) + f (7) ≡ 1 + 3 + 5 · (3 + 1 + 4 + 4 + 2) ≡ 24 (mod 25), so the last two digits are 24. 10. Lazy Linus wants to minimize his amount of laundry over the course of a week (seven days), so he decides to wear only three different T-shirts and three different pairs of pants for the week. However, he doesn’t want to look dirty or boring, so he decides to wear each piece of clothing for either two or three (possibly nonconsecutive) days total, and he cannot wear the same outfit (which consists of one T-shirt and one pair of pants) on two different (not necessarily consecutive) days. How many ways can he choose the outfits for these seven days? Proposed by Yannick Yao. Answer. 90720 . Solution. The problem is equivalent to the number of ways to choose 7 out of 9 squares in a 3 by 3 grid and label them from 1 to 7 inclusive such that the two blank squares don’t lie on the same row or column. Once this configuration is fixed, we can map each column to a T-shirt and each row to a pair of pants (and therefore each square correspond to a possible outfit), and the number in each square (or 2 2 lack thereof) sigifies which day to where this outfit, if at all. There are 3 2·2 = 18 ways to choose the two blanks and 7! = 5040 ways to label the 7 other squares, for 18 · 5040 = 90720 ways in total. 11. For how many positive integers x less than 4032 is x2 − 20 divisible by 16 and x2 − 16 divisible by 20? Proposed by Tristan Shin. Answer. 403 . Solution. We just a|b to denote that b/a is an integer. We must solve the system of quadratic congruences of x2 ≡ 4 (mod 16) and x2 ≡ 16 (mod 20). The first is equivalent to 16 | (x − 2) (x + 2), while the second is 5, 4 | (x − 4) (x + 4). 5 | (x − 4) (x + 4) is

3

OMO Spring 2016 Official Solutions equivalent to x ≡ ±1 (mod 5), while 4 | x2 − 16 is equivalent to x ≡ 0 (mod 2). These two give that x ≡ 4, 6 (mod 10). Now, I claim that x ≡ 2 (mod 4). Assume not, then neither x − 2 nor x + 2 is divisible by 4, so then (x − 2) (x + 2) is not divisible by 16, contradiction. Thus, x ≡ 2 (mod 4) and x ≡ 4, 6 (mod 10), so x ≡ 6, 14 (mod 20). It suffices to confirm that every number of this type works. Let x = 20k + 10 ± 4, 2 then x2 = (20k + 10) ±8 (20k + 10)+16 = 400k 2 +400k+116±160k±80. Now, x2 ≡ 0k 2 +0k+4±0k±0 2 (mod 16), so x − 20 is divisible by 16, and x2 ≡ 0k 2 + 0k + 16 ± 0k ± 0 (mod 20), so x2 − 16 is divisible by 20. Thus, every 20 integers, there will be 2, for 402 up until 4020. But between 4021 and 4032, there is only one: 4026, as 4034 is too large. Therefore, there are 403 such positive integers.

12. A 9-cube is a nine-dimensional hypercube (and hence has 29 vertices, for example). How many fivedimensional faces does it have? (An n dimensional hypercube is defined to have vertices at each of the points (a1 , a2 , · · · , an ) with ai ∈ {0, 1} for 1 ≤ i ≤ n.) Proposed by Evan Chen. Answer. 2016 . Solution. Without loss of generality let’s consider the 9-cube as [0, 1]9 in the 9-dimension Euclidean space. On each 5-dimensional face, there are 9 − 5 = 4 coordinates that are fixed, and each of them  can be 0 or 1. Therefore, there are 94 · 24 = 2016 5-dimensional faces in total. 13. For a positive integer n, let f (n) be the integer formed by reversing the digits of n (and removing any leading zeroes). For example f (14172) = 27141. Define a sequence of numbers {an }n≥0 by a0 = 1 and for all i ≥ 0, ai+1 = 11ai or ai+1 = f (ai ) . How many possible values are there for a8 ? Proposed by James Lin. Answer. 13 . Solution. Note that we can have ai = ai+1 whenever ai ≤ 14641, so it’s clear that we can assume a0 = 1, a1 = 11, a2 = 121, a3 = 1331, a4 = 14641, a5 = 161051, and find all possible values among a0 , a1 , . . . , a8 . Notice that f (116 ) = 11f (115 ) because 115 does not have consecutive digits adding up to at least 10, so no digits carry. Now, we see that the other numbers we can have are f (115 ), 116 , f (116 ), 117 , f (117 ), 11f (116 ), 118 , which we can easily check are distinct, giving a total of 6 + 7 = 13 possible values for a8 . 14. Let ABC be a triangle with BC = 20 and CA = 16, and let I be its incenter. If the altitude from A to BC, the perpendicular bisector of AC, and the line through I perpendicular to AB intersect at a √ common point, then the length AB can be written as m + n for positive integers m and n. What is 100m + n? Proposed by Tristan Shin. Answer. 460 . Solution. First, assume that we have an arbitrary triangle with side lengths a, b, and c that satisfy this concurrency. Let D be the foot of the altitude from A to BC. We will prove a lemma that is known as Carnot’s Theorem.

4

OMO Spring 2016 Official Solutions Lemma. Let ABC be a triangle, and let D, E, F be on BC, AC, AB respectively. If the perpendiculars through D, E, F to their respective sides concur, then BD2 + CE 2 + AF 2 = CD2 + AE 2 + BF 2 . Proof. Suppose the perpendiculars concur at a point P . Then P B 2 − P C 2 = (BD2 + P D2 ) − (CD2 + P D2 ) = BD2 − CD2 . Similarly, P C 2 − P A2 = CE 2 − AE 2 and P A2 − P B 2 = AF 2 − BF 2 so summing the three equations yields the desired result.

2 2 2 2 Now by Carnot’s Theorem, we need BD2 −DC 2 + 2b − 2b +(s − a) −(s − b) = 0. Simplifying this 2 gives BD2 −DC 2 +c (b − a) = 0. By the Perpendicularity Lemma, BD2 −DC 2 = BA2 −AC 2 = c√ −b2 , 2 so we have c2 +(b − a) c−b2 = 0. With a = 20 and b = 16, we have that c −4c−256 = 0, so c = 2± 260. √ But c must be positive, so c = 2 + 260 and 100m + n = 460.

15. Let a, b, c, d be four real numbers such that a + b + c + d = 20 and ab + bc + cd + da = 16. Find the maximum possible value of abc + bcd + cda + dab. Proposed by Yannick Yao. Answer. 80 . Solution. Note that ab+bc+cd+da = (a+c)(b+d) = 16, which implies along with (a+c)+(b+d) = 20 and Vieta’s Theorem that a + c, b + d are roots √ of the equation x2 − 20x√+ 16x. Solving the quadratic, we get without loss of generality a + c = 10 − 2 21 and b + d = 10 + 2 21. Now abc + bcd + cda + dab = (a + c)bd + (b + d)ac √ √ so it suffices to maximize bd and ac subject to the constraints a + c = 10 − 2 21 √ √ and b + d = 10 + 2 21 (noting that 10 − 2√ 21 > 0). By AM-GM, ac is maximized when a = c = 5 − 21 and bd is maxmized when b = d = 5 + 21. Thus the answer is √ √ √ √ (5 + 21)2 (10 − 2 21) + (5 − 21)2 (10 + 2 21) = 80

16. Jay is given a permutation {p1 , p2 , . . . , p8 } of {1, 2, . . . , 8}. He may take two dividers and split the permutation into three non-empty sets, and he concatenates each set into a single integer. In other words, if Jay chooses a, b with 1 ≤ a < b < 8, he will get the three integers p1 p2 . . . pa , pa+1 pa+2 . . . pb , and pb+1 pb+2 . . . p8 . Jay then sums the three integers into a sum N = p1 p2 . . . pa + pa+1 pa+2 . . . pb + pb+1 pb+2 . . . p8 . Find the smallest positive integer M such that no matter what permutation Jay is given, he may choose two dividers such that N ≤ M . Proposed by James Lin. Answer. 1404 .

5

OMO Spring 2016 Official Solutions Solution. We want to use the divisors to split the permutation into sets of size 3, 3, 2 in some order. We consider all three possible uses of these divisors, let these three uses be U1 = 3 − 3 − 2, U2 = 3 − 2 − 3, U3 = 2 − 3 − 3. p1 appears as the hundreds digit in U1 and U2 , p6 in U2 and U3 , p3 in U3 , and p4 in U1 . Note that 2p1 + 2p6 + p3 + p4 ≤ 2(8 + 7) + 6 + 5 = 41, and we wish to maximize m = min(p1 + p4 , p1 + p6 , p3 + p6 ). We can achieve the clear maximum of m = 13 by {p1 , p6 } = {7, 8}, p4 = 13 − p1 , p3 = 13 − p6 , or {p1 , p6 } = {6, 8}, p4 = 13 − p1 , p3 = 13 − p6 , and any other possibilities will match up k ≤ 5 with a number less than 8. For U2 , m < p1 + p6 , so we do not worry about this case. But since p3 and p6 happen to both be units digits in U1 , and p1 and p4 happen to both be tens digits in U3 , choosing any of our four possibilities for (p1 , p3 , p4 , p6 ) does not affect our minimum value for N . Since p7 is a tens digit of both U1 and U3 , and p8 is a units digit of both U1 and U3 , we can set p7 = 4 and p8 = 1. Then we set {p2 , p5 } = {2, 3} in some order since p2 , p5 are both tens digits in U1 and both units digits in U3 . Now, we get U1 = 1404 and U3 = 1476, so M = 1404 17. A set S ⊆ N satisfies the following conditions: (a) If x, y ∈ S (not necessarily distinct), then x + y ∈ S. (b) If x is an integer and 2x ∈ S, then x ∈ S. Find the number of pairs of integers (a, b) with 1 ≤ a, b ≤ 50 such that if a, b ∈ S then S = N. Proposed by Yang Liu. Answer. 2068 . Solution. Call a pair (a, b) forcing if a, b ∈ S forces S = N. Lemma. (a, b) is forcing if and only if a, b share no odd factor that is greater than 1. Proof. If a, b share an odd factor greater than 1, then neither operation can change this. Therefore, 1 6∈ S, so S is not forced to be N. We proceed by induction on the pairs, where pairs are sorted by first coordinate, then by second coordinate. The base cases are clear, since if 1 ∈ S, then using condition (a) repeatedly shows that S = N. Assume that a < b. If either is even, we can halve it and finish by induction. This doesn’t change whether they have a common odd factor greater than 1. Now assume that a, b are both odd. Now because a, b ∈ S, and a, b are both odd, a+b 2 is in the set (use condition (a), then (b)). It’s easy to a+b check that a, 2 share no common odd factor if a, b do not. More explicitly, if an odd number p| a+b 2 and p|a, then p|a + b and therefore, p|(a + b) − a = b. Now because a+b < b, we can finish by induction. 2

To finish, one could use the principle of inclusion and exclusion to eliminate pairs that share common odd prime factors. The odd primes less than 50 are 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47. Therefore, the final answer is 502 −



50 3

2



 −

50 5



2

50 41

2



 −

50 7



2

50 43

2





2



50 11



2

50 47

 − 

+

50 13

50 15

2

 −

2

 +

6

50 17

50 21

2

 −

2

 +

50 19

50 33

2

 −

2

 +

50 23

50 35

2

 −

2

 +

50 29

2

50 39

2

 −

50 31

2

= 2068.

 −

50 37

2

OMO Spring 2016 Official Solutions Remark. I apologize for the inclusion-exclusion part of the problem. I could not find a cleaner answer extraction. If people have better answer extraction ideas, please post them in the corresponding forum on AoPS. Also, it might be nicer to think about the induction described as an algorithm. It was worded as induction in this solution as it is easier to word solutions that way. 18. Kevin is in kindergarten, so his teacher puts a 100 × 200 addition table on the board during class. The teacher first randomly generates distinct positive integers a1 , a2 , . . . , a100 in the range [1, 2016] corresponding to the rows, and then she randomly generates distinct positive integers b1 , b2 , . . . , b200 in the range [1, 2016] corresponding to the columns. She then fills in the addition table by writing the number ai + bj in the square (i, j) for each 1 ≤ i ≤ 100, 1 ≤ j ≤ 200. During recess, Kevin takes the addition table and draws it on the playground using chalk. Now he can play hopscotch on it! He wants to hop from (1, 1) to (100, 200). At each step, he can jump in one of 8 directions to a new square bordering the square he stands on a side or at a corner. Let M be the minimum possible sum of the numbers on the squares he jumps on during his path to (100, 200) (including both the starting and ending squares). The expected value of M can be expressed in the form pq for relatively prime positive integers p, q. Find p + q. Proposed by Yang Liu. Answer. 30759351 . Solution. Say (1, 1) is upper left, and (100, 200) is bottom right. Note that Kevin must hop in at least 200 squares to get from (1, 1) to (100, 200). He also must hop in each row and column at least once. Therefore, we can see that M≥

200 X

bi +

100 X

ai + 100 min(a1 , a2 , . . . , a100 ).

i=1

i=1

The extra term with the minimum at the end comes from the fact that the numbers written on the rows must be added at least 200 times in total, as Kevin hops on at least 200 squares. To see that this minimum is attainable, Kevin could just hop diagonally until he gets to the row with minimum sum, stay in that row for 100 steps while increasing his column number one by one, and then hopping diagonally until the finish. By linearity of expectation, E[M ] =

200 X i=1

E[bi ] +

100 X

E[ai ] + 100 · E[min(a1 , a2 , . . . , a100 )] = 300 ·

i=1

2017 + 100E[min(a1 , a2 , . . . , a100 )], 2

as E[ai ] = E[bi ] = 2017 2 . To finish, we need to compute the expected value of the minimum. This is a classical problem with many ways to do it, one of which is a straightforward computation using the Hockey-Stick Identity. Instead, I will present an alternate proof, one that I like better. Say a1 < a2 < · · · < a100 . Consider the ranges of integers (some of which may be empty) [1, a1 − 1], [a1 + 1, a2 − 1], . . . , [a99 + 1, a100 − 1], [a100 + 1, 2016]. There are 101 of these ranges, with 1916 total integers among them. We can compute the min by taking the first of these ranges and adding 1 to its length. By symmetry, the average length of the first range will be 1916 101 , so the expected value of the 2017 minimum number is 1916 + 1 = . 101 101 Plugging this in, our final answer is

2017 2

· 300 + 100 ·

7

2017 101

=

30759250 101

=⇒ p + q = 30759351.

OMO Spring 2016 Official Solutions 19. Let Z≥0 denote the set of nonnegative integers. Define a function f : Z≥0 → Z with f (0) = 1 and f (n) = 512bn/10c f (bn/10c) for all n ≥ 1. Determine the number of nonnegative integers n such that the hexadecimal (base 16) representation of f (n) contains no more than 2500 digits. Proposed by Tristan Shin. Answer. 10010 . Solution. I claim that f (n) = 2n−s(n) , where s (n) is the sum of the digits of n in base 10. We proceed by induction on d, the number of digits of n in base 10. For d = 1, we have f (bn/10c) = f (0) = 1, and the 512 part becomes just 1 also, so f (n) = 1 = 2n−n . Now, assume for some d = k ≥ 1, f (n) = 2n−s(n) for all n with k digits. The base case of k = 1 has just been proven. Then, let n = 10a + b for a k digit number a and a single digit number b. Then f (n) = 512a f (a). But a is a k digit number, so f (a) = 2a−s(a) . Thus, f (n) = 29a+a−s(a) = 210a−s(a) . But note that s (a) = s (a) + s (b) − b as b = s (b), and s (a) + s (b) = s (10a) + s (b) = s (10a + b) = s (n), so f (n) = 210a+b−s(n) = 2n−s(n) . Thus, by induction on d, we have f (n) = 2n−s(n) for all nonnegative integers n. Then about 502 = 2500 digits means that blog16 f (n)c + 1 ≤ 2500. This is equivalent k j the condition n−s(n) < 1111 + 19 . But note that n − s (n) is ≤ 2499, which in turn is equivalent to n−s(n) to 4 9 always divisible by 9, so the LHS must be an integer, implying that n−s(n) ≤ 1111. Now, if we let 9 P∞ n = i=0 ai 10i for integers ai ∈ [0, 9], then n−s(n) = a + 11a + 111a + . . . . This shows that n − s (n) 1 2 3 9 is always nonnegative. We can then easily determine that for every integer k ∈ [0, 1111] except for 1110 and those in [0, 1109] that are 10, 21, 32, 43, 54, 65, 76, 87, 98, 109, 110 (mod 111), there exist exactly 10 solutions to n−s(n) = k. This is a total of 1001 numbers, so 10010 solutions. Alternatively, one can see 9 there are 1001 numbers by noting that this is essentially a worse version of base 10, but we can still plug in digits 0 to 9. 20. Define A(n) as the average of all positive divisors of the positive integer n. Find the sum of all solutions to A(n) = 42. Proposed by Yannick Yao. Answer. 1374 . Solution. Notice that the function A is multiplicative, which means whenever m, n are relatively t+1 −1)/(p−1) prime, we have A(m)A(n) = A(mn). So we can focus our attention to A(pt ) = (p (t+1) ≤ 42 for prime p and positive integer t. Then since we don’t want prime factors other than 2,3,7 in either numerator or denominator (which is because any prime factor greater or equal to 11 on the numerator are too big since they requires something to the 10th power or higher to cancel this factor out on the denominator, and A(210 ) = 2047 11 > 42 already. Cancelling a factor of 5 also requires a fourth power, > 42 is already too large and A(34 ) = 121/5, A(24 ) = 31/5, both creating factors and A(54 ) = 781 5 that are too large to cancel out), the candidate components are further narrowed down to A(2t ) for t = 0, 1, 2, 5 and A(p) = p+1 2 for primes p between 3 and 83 inclusive. Here is a complete list of all candidates at this point: A(1) = 1, A(2) = 3/2, A(4) = 7/3, A(32) = 21/2, A(3) = 2, A(5) = 3, A(7) = 4, A(11) = 6, A(13) = 7, A(17) = 9, A(23) = 12, A(31) = 16, A(41) = 21, A(47) = 24, A(53) = 27, A(71) = 36, A(83) = 42. 8

OMO Spring 2016 Official Solutions We can now case work on the maximum power of 2 dividing n, let this power be 2t . If t = 0 then we look for distinct primes whose A-values multiply to 42, so we have 83, 3 · 41 = 123, 11 · 13 = 143, 3 · 5 · 13 = 195. If t = 1 then the A-values multiply to

42 3/2

= 28, so we have 2 · 7 · 13 = 182.

If t = 2 then the A-values multiply to

42 7/3

= 18, so we have 22 · 3 · 17 = 204, 22 · 5 · 11 = 220.

If t = 5 then the A-values multiply to

42 21/2

= 4, so we have 25 · 7 = 224.

Summing up all cases, we get that there are 8 possibilities: 83, 123, 143, 182, 195, 204, 220, 224, and their sum is 1374. 21. Say a real number r is repetitive if there exist two distinct complex numbers z1 , z2 with |z1 | = |z2 | = 1 and {z1 , z2 } = 6 {−i, i} such that z1 (z13 + z12 + rz1 + 1) = z2 (z23 + z22 + rz2 + 1). There exist real numbers a, b such that a real number r is repetitive if and only if a < r ≤ b. If the value of |a| + |b| can be expressed in the form pq for relatively prime positive integers p and q, find 100p + q. Proposed by James Lin. Answer. 2504 . Solution. Let the argument of z, with |z| = 1, be θ. Note that f (z) = z 4 + z 3 + rz 2 + z + 1 is in the direction of argument 2θ with a signed magnitude of r + 2 cos θ + 2 cos(2θ) = 4 cos2 θ + 2 cos θ − 2 + r = 1 9 4(cos θ + )2 − + r. 4 4 9 For r > , then note that this signed magnitude is always positive. Then, f (z1 ) = f (z2 ) can only 4 happen for z1 6= z2 if their arguments θ1 , θ2 satisfy 2θ1 = 2θ2 =⇒ θ1 = θ2 + π. But then their signed magnitudes can only be equal if cos θ1 = cos θ2 , but that implies {z1 , z2 } = {i, −i}. Hence f (z1 ) 6= f (z2 ) 5 1 for all distinct z1 , z2 . For r < −4, the signed magnitude is always negative since | cos θ + | ≤ over 4 4 all θ. Once again, this implies that f (z1 ) 6= f (z2 ). 9 1 However, if −4 ≤ r ≤ , then there exists a unique value for cos θ with − ≤ cos θ ≤ 1 such that the 4 4 signed magnitude is equal to 0. For all cos θ 6= 1, there are two values of θ giving the desired value of cos θ, showing there exist distinct z1 , z2 giving f (z1 ) = f (z2 ) = 0. However, cos θ = 1 only when θ = 0, meaning for r = −4 we see that the signed magnitude is always negative except for θ = 0, 9 when the signed magnitude is exactly 0. Hence r = −4 is also repetitive. Hence a = −4 and b = so 4 100p + q = 2504. 22. Let ABC be a triangle with AB = 5, BC = 7, CA = 8, and circumcircle ω. Let P be a point inside −→ −−→ −−→ ABC such that P A : P B : P C = 2 : 3 : 6. Let rays AP , BP , and √ CP intersect ω again at X, Y , p q and Z, respectively. The area of XY Z can be expressed in the form where p and r are relatively r prime positive integers and q is a positive integer not divisible by the square of any prime. What is p + q + r? Proposed by James Lin. Answer. 940 .

9

OMO Spring 2016 Official Solutions Solution. Let the pedal triangle of P with respect to ABC be DEF such that D is on BC, E is on CA, and F is on AB. Note that ∠P Y X = ∠BY X = ∠BAX = ∠F AP = ∠F EP . Similarly, ∠P Y Z = ∠DEP , so then ∠XY Z = ∠DEF . Similarly ∠Y ZX = ∠EF D, so 4DEF ∼ 4XY Z. Then by the Law of Sines on triangles DEP and F EP , ED YX = YZ EF   EP sin EP D sin EDP  =  EP sin EP F sin EF P sin EP D sin EF P = · sin EP F sin EDP sin C sin EAP = · sin A sin ECP BA P C · . = BC P A Symmetry shows that Y Z : ZX : XY = P A · BC : P B · CA : P C · AB = 7 : 12 : 15. 52 + 82 − 72 1 BC Note that cos BAC = = , so ∠BAC = 60◦ , so then the circumradius R of ω is = 2·5·8 2 2 sin A √ √ 7 √ . By Heron’s formula, a triangles with side lengths 7, 12, 15 has area 17 · 10 · 5 · 2 = 10 17 and 3 7 · 12 · 15 63 √ = √ . Since XY Z also has circumcircle ω, we can scale the 7 − 12 − 15 circumradius 4 · 10 17 2 17  2 7 √  √3  √ 680 17   = , so the answer is 940. triangle to find the area of XY Z is 10 17 ·  63  243 √ 2 17 23. Let S be the set of all 20172 lattice points (x, y) with x, y ∈ {0} ∪ {20 , 21 , · · · , 22015 }. A subset X ⊆ S is called BQ if it has the following properties: (a) X contains at least three points, no three of which are collinear. (b) One of the points in X is (0, 0). (c) For any three distinct points A, B, C ∈ X, the orthocenter of 4ABC is in X. (d) The convex hull of X contains at least one horizontal line segment. Determine the number of BQ subsets of S. Proposed by Vincent Huang. Answer. 17274095 . Solution. First we will determine the possible kinds of BQ subsets X. Consider the convex hull of X. Clearly it cannot have any obtuse angles or else we take A, B, C with ∠ABC obtuse to get that the orthocenter of ABC is outside the convex hull, a clear contradiction.Thus we can conclude that the convex hull has either 3 or 4 sides, since it is well-known that any convex polygon of more than 4 sides has an obtuse angle. If the convex hull of X has four sides, then for it to not have obtuse angles, it must be a rectangle. If the rectangle is ABCD, we can’t have a point P inside or else WLOG assume P is strictly inside 10

OMO Spring 2016 Official Solutions triangle ABC and then the orthocenter of P AC is outside the rectangle, a contradiction. The rectangle contains (0, 0) as its bottom left vertex, so it must be of the form (0, 0), (2x , 0), (0, 2y ), (2x , 2y ) with 0 ≤ x, y ≤ 2015. This yields 20162 possibilities for X. If the convex hull has three sides, it is a non-obtuse triangle ABC. Then its orthocenter H is also obviously in the set. I claim that no other points can be in the set. Suppose another point P is in the set, and WLOG assume P is strictly inside triangle BCH. Now consider the orthocenter of P BC, and it is easy to see from ∠BP C > ∠BHC ≥ 90◦ that the orthocenter of P BC is outside the convex hull of X, a contradiction. Now we must count the number of triangles whose vertices are in the set and whose orthocenters are also in the set S. We split into two cases: Case 1. The orthocenter is (0, 0). Then the other two vertices of the triangle are (2x , 0), (0, 2y ) which yields 20162 possibilities as before. Case 2. The orthocenter is not (0, 0). Case 2.1. Suppose there is no point in X of the form (a, 0) with a 6= 0. We need a horizontal segment somewhere in the convex hull, and since the convex hull is non-obtuse this implies the horizontal side is somewhere above (0, 0), so the set X is (0, 0), (0, a), (b, a) for some a, b. This yields 20162 more possibilities. Case 2.2. There is another point in the set which is of the form (a, 0), since the convex hull of X contains at least one horizontal segment. Let the third point be (b, c) and from  of the triangle  b(a − b) coordinates we can easily solve for the orthocenter which is b, . Notice that since the c orthocenter is inside the triangle that b(a − b) ≤ c2 . b(a − b) Since a, b, c, are powers of two, we conclude a − b is a power of two and thus either a = b or c a = 2b. Case 2.2.1. a = b. Then our set is just (0, 0), (a, 0), (a, c) and the orthocenter is (a, 0),m which is already inside X. So we need 1 ≤ a ≤ 22015 , 1 ≤ c ≤ 22015 which yields another 20162 possibilities.  2 b Case 2.2.2. a = 2b. So our points are (0, 0), (2b, 0), (b, c), b, . Recall from earlier that b ≤ c but c also every coordinate must be ≤ 22015 . So let b = 2x with 0 ≤ x ≤ 2014 and let c = 2y . We know c|b2 , c ≥ b which translates into x ≤ y ≤ min(2x, 2015). Counting the number of pairs (x, y) satisfying this is easy to do by splitting the sum at x = 1007: When x ≤ 1007 we have x + 1 choices for y and when 1008 ≤ x ≤ 2014 we have 2016 − x choices for y, yielding a total of (1 + 2 + ... + 1008) + (1008 + 1007 + ... + 2) = 1008 · 1009 − 1 pairs (x, y). Thus our final answer is the sum 4 · 20162 + 1008 · 1009 − 1 = 17274095

24. Bessie and her 2015 bovine buddies work at the Organic Milk Organization, for a total of 2016 workers. They have a hierarchy of bosses, where obviously no cow is its own boss. In other words, for some pairs of employees (A, B), B is the boss of A. This relationship satisfies an obvious condition: if B is the boss of A and C is the boss of B, then C is also a boss of A. Business has been slow, so Bessie hires an outside organizational company to partition the company into some number of groups. To promote growth, every group is one of two forms. Either no one in the group is the boss of another in the group, or for every pair of cows in the group, one is the boss of the other. Let G be the minimum number of groups needed in such a partition. Find the maximum value of G over all possible company structures. Proposed by Yang Liu. Answer. 63 . 11

OMO Spring 2016 Official Solutions Solution. This solution will use the language of posets, chains, and antichains. A poset is exactly the structure defined in the problem. A chain is a subset of elements of the poset such that all pairs are comparable, and an antichain is a subset of elements of the poset such that no two are comparable. This problem is then asking to cover G with chains and antichains. Note that 2016 = lemma.

63·64 2 .

I claim that the answer is 63. The upper bound will be shown in the following

Lemma. In a poset with

k(k+1) 2

elements, it can be covered using at most k chains or antichains.

Proof. This can be done easily with Dilworth’s Theorem, but I will present a proof here that doesn’t appeal to Dilworth’s Theorem. For each v ∈ G, label v with the longest path in the poset that starts at v. Let f (v) denote this label. More explicitly, if we let < denote the binary comparator on G, f (v) is the largest m such that there exists a sequence v = v1 < v2 < · · · < vm , where vi ∈ G ∀ i. You can think of this as grouping the poset into “layers”. If f (v) ≥ k for some v, then there exists a chain of length k starting at v. Now delete this chain. Afterwards, we are left with a poset with (k−1)k 2 elements, which can be covered in k − 1 chains or antichains by induction. So in this case we use k in total. Otherwise, f (v) < k for all v. This now admits a decomposition into k − 1 antichains, where the i-th antichain is simply the set of all v such that f (v) = i. To see that each of these sets is an antichain, assume that there exist u, v within the same set such that u < v. But this obviously means that f (u) ≥ f (v) + 1, contradiction. So in this case, there exists a covering using only k − 1 antichains, as desired.

Now we prove the lower bound by providing a construction. For the construction, let the elements be grouped into k groups G1 , G2 , . . . , Gk such that |Gi | = i and such that for all i < j, if vi ∈ Gi , vj ∈ Gj , then vi > vj . These are also the only relations, which means that each Gi is an antichain. This has a total of k(k+1) elements. I claim that it needs at least k chains or antichains to cover it. We proceed 2 by induction. If a chain is used, it might as well be of length k, since deleting more vertices doesn’t hurt us later on. After deleting this chain of length k, we have reduced the poset to the case with (k−1)k elements of the 2 same construction, which requires k − 1 more chains or antichains. If no chain is used, then obviously we need at least k antichains to cover everything. Therefore, we are done.

25. Given a prime p and positive integer k, an integer n with 0 ≤ n < p is called a (p, k)-Hofstadterian residue if there exists an infinite sequence of integers n0 , n1 , n2 , . . . such that n0 ≡ n and nki+1 ≡ ni (mod p) for all integers i ≥ 0. If f (p, k) is the number of (p, k)-Hofstadterian residues, then compute 2016 X f (2017, k). k=1

Proposed by Ashwin Sah. Answer. 1296144 . Solution. Let p = 2017 throughout this solution. Also, let p prime factorize as

Qm

ei i=1 qi .

For an integer k, let d(k, p − 1) denote the largest divisor of p − 1 that is relatively prime to k. Using primitive roots, it is not hard to see that there are exactly d(k, p − 1) + 1 (p, k)-Hofstaderian residues. Pp−1 The plus 1 comes from including 0. Now we must compute p − 1 + k=1 d(k, p − 1).

12

OMO Spring 2016 Official Solutions To compute this sum, say  that exactly the primes qa1 , qa2 , . . . , qaj divide gcd(k, p − 1). It’s easy to see Qj  1 that (p − 1) i=1 1 − qa values of k satisfy this. For these k, d(k, p − 1) = Qjφ(p−1) . Therefore, (q −1) i

i=1

ai

our sum can be rewritten as (where the sum is over all subsets of the prime factors of p − 1)  Y X p−1 1 φ(p − 1) · Q eai = (p − 1)φ(p − 1) 1 + ei = 1296144, Qj qi (qi − 1) qai qa ,qa ,...,qa i=1 (qai − 1) 1

2

j

as desired.

26. Let S be the set of all pairs (a, b) of integers satisfying 0 ≤ a, b ≤ 2014. For any pairs s1 = (a1 , b1 ), s2 = (a2 , b2 ) ∈ S, define s1 + s2 = ((a1 + a2 )2015 , (b1 + b2 )2015 ) and s1 × s2 = ((a1 a2 + 2b1 b2 )2015 , (a1 b2 + a2 b1 )2015 ), where n2015 denotes the remainder when an integer n is divided by 2015. Compute the number of functions f : S → S satisfying f (s1 + s2 ) = f (s1 ) + f (s2 ) and f (s1 × s2 ) = f (s1 ) × f (s2 ) for all s1 , s2 ∈ S. Proposed by Yang Liu. Answer. 81 . √ Solution 1. We can think of S as the set of all a + b 2, where a, b are taken (mod 2015). Then the sum and product work how we expect: √ √ √ (a1 + b1 2) + (a2 + b2 2) = (a1 + a1 ) + (b1 + b2 ) 2 and

√ √ √ (a1 + b1 2) × (a2 + b2 2) = (a1 a2 + 2b1 b2 ) + (b1 a2 + a1 b2 ) 2

We want to find all functions f : S → S that preserve both addition and multiplication. First, suppose such a function f exists. Note that for any a ∈ S, f (a + a) = f (a) + f (a) = 2f (a), f (3a) = f (a) + f (2a) = 3f (a), and so on, showing that for any positive integer n, f (na) = nf (a). Since all integers are taken (mod 2015), we equivalently have f (na) = nf (a) for any remainder n (mod 2015). √ Let f (1) = x and f ( 2) = y. From f (na) = nf (a) and preservation of addition, we get √ √ f (a + b 2) = af (1) + bf ( 2) = ax + by. Additionally, note that so x =

y2 2 .

√ 2x = 2f (1) = f (2) = f ( 2)2 = y 2 ,

Also, √ √ y3 = xy = f (1)f ( 2) = f ( 2) = y 2

so y 3 = 2y. Thus any valid f must be in the form √



f (a + b 2) = a

13

y2 2

 + by

OMO Spring 2016 Official Solutions for some y ∈ S satisfying y 3 = 2y. We claim that this is also sufficient for f to preserve both addition and multiplication. It is clear that such an f preserves addition, and  2  2  √ √ ay cy f (a + b 2)f (c + d 2) = + by + dy 2 2 acy 4 bcy 3 ady 3 = + + + bdy 2 4 2 2 acy 2 + bcy + ady + bdy 2 = 2  2 y = (ac + 2bd) + (bd + ad) (y) 2 √ = f ((ac + 2bd) + (bd + ad) 2) √ √ = f ((a + b 2)(c + d 2)) so it preserves multiplication as well. Thus it suffices to find the number of solutions to y 3 = 2y in S. √ √ Now for some a, b (mod 2015), (a + b 2)3 = 2(a + b 2) is a set of polynomial equations in a, b. So by the Chinese Remainder Theorem, the answer is the product of the number of solutions to y 3 = 2y when the coefficients are taken (mod 5), (mod 13), and (mod 31). √ Let Fp denote integers (mod p), and let Sp be the set of all a + b 2, where a, b ∈ Fp for an odd prime p. Suppose two elements of Sp multiply to 0; i.e. √ √ √ 0 = (a + b 2)(c + d 2) = (ac + 2bd) + (bc + ad) 2 Then ac + 2bd ≡ 0 (mod p) and bc + ad ≡ 0 (mod p). Now if a = b = 0 or c = d = 0, we clearly get a solution. Assuming neither of these hold, now suppose a = 0 (mod p); then bd = 0 (mod p) and bc = 0 (mod p). This is only possible if either a = b = 0 or c = d = 0, so this is a contradiction. Similarly, we can assume that all of b, c, d are nonzero (mod p). Then 2bd 2b2 d c≡− =⇒ = ad a a 2 which is equivalent to ab = 2. 1 It’s well-known that in Fp for odd p, the equation z 2 = 2 has no 2 solution if p ≡ 3, 5 (mod 8), and there 2 if and only z = ±g. So √ exists√(nonzero) g ∈ Fp√such that z = √ in Sp , for p ≡ 3, 5 (mod 8), (a + b 2)(c + d 2) implies a + b 2 = 0 or c + d 2 = 0. √ √ If (a + b 2)(c + d 2) = 0 in Sp for p ≡ 1, 7 (mod 8) (and neither a = b = 0 nor c = d = 0 holds), then a = gb, which implies c = −gd from bc + ad = 0, or a = −gb, which implies c = gd. Thus √ √ √ √ {a + b 2, c + d 2} = {k(g − 2), `(g + 2)} for some k, ` ∈ Fp . We finally now consider the number of solutions to y 3 = 2y in Sp for p = 5, 13, 31. If p = 5 or p = 13, then p ≡ √ 3, 5 (mod√8), so mn = 0 implies m = 0 or n√ = 0 for m, n ∈√Sp . Note then that if y 3 = 2y, then y(y − 2)(y + 2) = 0. Thus either y = 0, y = 2, or y = − 2. So in both cases, there are 3 solutions to y 3 = 2y. √ √ If p = 31, then p ≡ 7 (mod 8), so mn = 0 implies m = 0, n = 0, or {m, n} = {k(8 − √2), `(8 + 2)} (noting that 82 ≡ 2 (mod 31)). So if y(y 2 − 2) = 0, either y = 0, y 2 = 2, or y = k(8 ± 2). If y = 0, of course we have 1 solution for y. √ √ √ √ √ If y 2 =√2, then either y = ± 2 or y − 2 = k(8± 2). If the second case holds, then k(8± 2)+2 2 = `(8 ∓ 2), implying 8k = ∓8(2 ± k). Thus either 8k = 16 − 8k or 8k = −16 − 8k, yielding k = 1 and 1 Note

that

a b

is in Fp , not Sp . We must be careful to distinguish

14



2 ∈ Sp and an element of Fp which is a root of z 2 − 2.

OMO Spring 2016 Official Solutions √ √ √ √ y − 2 = 8 − 2, or k = −1 and y − 2 = −8 + 2. These two cases give the solutions y = 8 and y = −8 additionally, so there are 4 solutions to y 2 = 2. √ √ If y = k(8 ± 2), then y 2 − 2 = `(8 ∓ 2). Note that √ y 2 − 2 = −2 + k 2 (4 ± 16 2) so (4k 2 − 2) = ∓8(±16k 2 ) = −4k 2 Implying 4k√2 = 1 and so k √ = 15 or k = 16. So √ in this case we get the 4 solutions k = 15(8 + k = 16(8 + 2), k = 15(8 − 2), and k = 16(8 − 2).



2),

In total, the p = 31 case gives 1 + 4 + 4 = 9 solutions for y 3 = 2y in S31 . The other two primes, p = 5 and p = 13, each yield 3 solutions, so the number of solutions to y 3 = y in S is 3 · 3 · 9 = 81 (by the Chinese Remainder Theorem). So our final answer is 81. Solution 2. There is an alternate solution which avoids much of the casework of the p = 31 case, but √ requires a little more tricky theory. The key is to note that in the ring Z[ 2], 2015’s full factorization √ √ √ into primes is not 5 × 13 × 31, but rather 5 × 13 × (−1 + 4 2) × (1 + 4 2). (We use the fact that Z[ 2] is a unique factorization domain, which allows us to identify primes and irreducibles.) To of these √ prove 2that each √ factors are √ each indeed prime, we consider the multiplicative norm N (a + b √ 2) = a − 2b2 . −1 + 4 √ 2 and 1 + 4 2 each have norm −31, which is prime. Thus if two elements of Z[ 2] multiply to ±1 + 4 2, then one must have norm ±1, which would √make it a unit. This implies that both are irreducible, and therefore prime. Now note that if a + b 2 | 5, then by taking norms √ we get a2 − 2b2 | 52 , so either a + b 2 is a unit or 5 | a2 − 2b2 . But as 2 is not a quadratic residue (mod 5), this is impossible unless 5 | a and 5 | b, which would make a+b5√2 a unit. Therefore 5, and by √ a similar argument 13, are each prime in Z[ 2]. √ √ Let 5, 13, −1 + 4 2, and 1 + 4 2 be denoted by p1 , p2 , p3 , and p4 , respectively. Note that √ √ S = Z[ 2]/(2015) = Z[ 2]/(p1 p2 p3 p4 ) Now by the Chinese Remainder Theorem, there is an isomorphism between S and the product of the quotient rings formed by each of the ideals (pi ), assuming these ideals pairwise coprime (which is easy to check): R/(p1 p2 p3 p4 ) ∼ = R/(p1 ) ⊕ R/(p2 ) ⊕ R/(p3 ) ⊕ R/(p4 ) √ where R = Z[ 2] is a commutative ring. Thus the number of solutions to y 3 = 2y in S = R/(p1 p2 p3 p4 ) is the product of the number of solutions in each R/(pi ). Now the quotient R/(pi ) of a commutative ring by a prime ideal is an integral domain. (In fact, since it is finite, it is a field as well; explicitly we have the decomposition S∼ = F52 ⊕ F132 ⊕ F231 , √ √ but we won’t need this for our purposes.) So within each integral√domain, y(y − 2)(y + 2) = 0 only holds when one of the terms vanishes, i.e. when y = 0 or y = ± 2. So the total number of solutions is 34 = 81. 27. Let ABC be a triangle with circumradius 2 and ∠B − ∠C = 15◦ . Denote its circumcenter as O, orthocenter as H, and centroid as G. Let the reflection of H over O be L, and let lines AG and AL intersect the circumcircle again at X and Y , respectively. Define B1 and C1 as the points on the circumcircle of ABC √ such that BB1 k AC and CC1 k AB, and let lines √ XY and B1 C1 intersect at Z. Given that OZ = 2 5, then AZ 2 can be expressed in the form m − n for positive integers m and n. Find 100m + n. Proposed by Michael Ren. 15

OMO Spring 2016 Official Solutions Answer. 3248 . Solution. Let Ω be the circumcircle of ABC, and A1 is on Ω such that AA1 k BC. Let lines BB1 and CC1 intersect at P , lines CC1 and AA1 intersect at Q, and lines AA1 and BB1 intersect at R. Note that A, G, and P are collinear. Also, note that H is the circumcenter and O is the nine-point center of P QR, so hence L is the orthocenter of P QR. Hence, L is the incenter of A1 B1 C1 . Let ω1 be the incircle of A1 B1 C1 , so ω1 has center L and let it touch side B1 C1 at D. Similarly, let ω2 be the A1 -excircle of A1 B1 C1 , so ω2 has center P and let it touch side B1 C1 at E. Note that A is the midpoint of arc B1 A1 C1 , so let AA1 (the external angle bisector of ∠B1 A1 C1 ) intersect B1 C1 at K. √ Let F be the inversion centered at A1 with radius A1 B1 · A1 C1 , and let G be the reflection through the internal angle bisector of ∠B1 A1 C1 . Let H = F ◦ G. Note that ∠LA1 K = ∠LDK = 90◦ , so A1 LDK is cyclic. Note that H(ω1 ) is the A1 -mixtillinear excircle of A1 B1 C1 . Hence, the line through H(L) = P and H(K) = A1 intersects Ω at H(D), so then X is the tangency point of the A1 -mixtillinear excircle of A1 B1 C1 and Ω. Similarly, since ∠P A1 K = ∠P EK = 90◦ , A1 P EK is cyclic. Note that H(ω2 ) is the A1 -mixtillinear incircle of A1 B1 C1 , so the line through H(P ) = L and H(K) = A1 intersects Ω at H(E), so then Y is the tangency point of the A1 -mixtillinear incircle of A1 B1 C1 and Ω. Let the tangent of X to Ω be `1 , and the tangent of Y to Ω be `2 . Let `1 ∩ `2 = T . Note that H(`1 ) is the circle tangent to BC at D passing through A1 , and H(`2 ) is the circle tangent to BC at E passing through A1 . Let H(T ) = S be the second intersection of the two circles, so that A1 T is the radical axis of these two circles. But the midpoint M of side B1 C1 is the midpoint of DE, so A1 , S, M are collinear so hence A1 T is the A1 -symmedian of triangle A1 B1 C1 . Let the tangents of B1 and C1 to Ω be F , so then note that Z lies on the polar of both T and F with respect to Ω. Hence, Z is the pole of line T F , but T and F both lie on the A1 -symmedian of A1 B1 C1 , so Z lies on the polar of A1 and hence ZA1 is tangent to Ω. Now, let the Z1 . Note that ABA1 = ∠B − ∠C = 15◦ √ foot√of the perpendicular from Z to line AA1 be ◦ 6− √ 2, and ∠AA1 Z = − (∠B − ∠C) = 165 so ∠ZA1 Z1 = ∠15◦ . Note that so AA1 = √ √ 180 √ √ ZA1 = 4, so A1 Z1 = 6 + 2 and ZZ1 = 6 − 2 so by the Pythagorean Theorem, AZ 2 = 32 − 48, so our answer is 3248. 28. Let N be the number of polynomials P (x1 , x2 , . . . , x2016 ) of degree at most 2015 with coefficients in the set {0, 1, 2} such that P (a1 , a2 , · · · , a2016 ) ≡ 1 (mod 3) for all (a1 , a2 , · · · , a2016 ) ∈ {0, 1}2016 . Compute the remainder when v3 (N ) is divided by 2011, where v3 (N ) denotes the largest integer k such that 3k |N. Proposed by Yang Liu. Answer. 189 . Solution. Let n = 2016 throughout this solution. We therefore need to compute the number of nvariable polynomials of degree at most n − 1 such that it is identically 1 on the set {0, 1}n . We first prove a useful lemma. Say a multivariate polynomial is simple if the exponent of every variable is at most 1 in all terms. Therefore, x1 x2 x3 is simple, while x1 x2 + x23 x4 isn’t. Lemma. If Q(x1 , x2 , . . . , xn ) is simple and Q(x1 , x2 , . . . , xn ) = 0 ∀ (x1 , x2 , . . . , xn ) ∈ {0, 1}n , then Q ≡ 0. Proof. We go by induction on n, the number of variables. If x1 doesn’t appear then we are done by induction. Otherwise, we can find simple polynomials P0 (x2 , x3 , . . . , xn ), P1 (x2 , x3 , . . . , xn ) such Q = x1 P1 + P2 . Since x1 appears, P1 is not identically 0 as a polynomial. By induction, there exists a (n − 1)-tuple a = (a2 , a3 , . . . , an ) ∈ {0, 1}n−1 such that P1 (a2 , a3 , . . . , an ) 6= 0. Then the single variable polynomial x1 · P1 (a) + P2 (a) = 0 for x1 ∈ {0, 1}, a contradiction because the degree of the previous term is 1 but has 2 roots.

16

OMO Spring 2016 Official Solutions Let Q(x) = P (x) − 1. If P (x) = 1 for all x ∈ {0, 1}n , then Q(x) = 0 for all x ∈ {0, 1}n , and the degree of Q is at most is defined to be −1). Consider all terms P Qn n − 1 (where the degree of the 0 polynomial ei ≤ n − 1. One can easily count that there are of the form i=1 xei i where ei ≥ 2 for some i, and  n 2n−1 n (2n−1 n−1 )−2 +1 ways to choose the coefficients of n−1 − 2 + 1 of these terms. Therefore, there are 3 these terms. I now claim that the coefficients of the remaining terms (where ei ≤ 1 ∀ i) must be fixed. Qn Qn min(ei ,1) 2 , as xi if To prove this, note that for (x1 , x2 , . . . , xn ) ∈ {0, 1}n , i=1 xei i = i=1 xi Qnxi = 0 xi ∈ {0, 1}. Now transform Q into a new polynomial Q by replacing every term i=1 xei i with Qn min(ei ,1) . Now by the above lemma, Q0 must be the zero polynomial. Therefore, there was i=1 xi exactly one way to choose the coefficients of each simple monomial in Q that makes the coefficient vanish in Q0 . This proves the claim. 2n−1 n Therefore, the number of different Q is 3( n−1 )−2 +1 . Extracting the answer is easy from here.

Remark. Simulating the above proof in the correct generality leads to a proof of the Combinatorial Nullstellensatz. In fact, the above lemma follows directly from an application of this theorem. For a proof and applications, see Problems From the Book Chapter 23, or this abbreviated handout. 29. Yang the Spinning Square Sheep is a square in the plane such that his four legs are his four vertices. Yang can do two different types of tricks: (a) Yang can choose one of his sides, then reflect himself over the side. (b) Yang can choose one of his legs, then rotate 90◦ counterclockwise around the leg. Yang notices that after 2016 tricks, each leg ends up in exactly the same place the leg started out in! Let there be N ways for Yang to perform his 2016 tricks. What is the remainder when N is divided by 100000? Proposed by James Lin. Answer. 20000 . Solution. Assume Yang has his sides parallel to the coordinate axes. Denote the reflection tricks as R1 , U1 , L1 , D1 depending on whether the reflection takes his body to the right, up, left, or down. Similarly define R2 , U2 , L2 , D2 for the rotations. First we count the number of ways for Yang to arrive back at his original square after 2016 tricks, regardless of his orientation or direction. Assume his only 1008 X 20162k 2016 − 2k  moves are R, U, L, D. Then it’s clear that the number of ways is = 2k k 1008 − k k=0      2 2016 1008 1008 2016 . By Vandermonde’s Identity, this is equal to . Multiplying by 1008 k 1008 − k 1008  2 2016 2016 2 to take into account that each move may be a rotation or a reflection gives a total of · 1008 2016 2 . Now, we consider the orientations and directions. Take the right side of Yang and denote it as his head. We give Yang two orientations: S for when his legs are in the same counterclockwise order as originally and O for when his legs are in the opposite counterclockwise order as originally. Let the subscripts 0, 1, 2, 3 denote whether Yang’s head is facing east, north, west, or south, respectively. Now, split the orientations/directions of Yang into two groups: Group A consists of S0 , S2 , O1 , O3 and Group B consists of S1 , S3 , O0 , O2 . Note that each rotation keeps the same orientation but increases the index by 1, and each reflection flips the orientation but keeps the index the same modulo 2. Hence, each move switches the group the sequence is in, so Yang must be in Group A after 2016 tricks. 17

OMO Spring 2016 Official Solutions Now, fix a sequence of moves that results in Yang at his original square. Note that a rotation with R and L, and similarly for a reflection with R and L, are indistinguishable when it comes to orientation and direction. Thus, we denote them both by H. Similarly, we denote U and D by the single movement V . We split into two cases: a case where there are two consecutive H’s or two consecutive V ’s, or another case where the sequence is either HV HV · · · HV , or V HV H · · · V H. Case 1. Assume that there are two consecutive H’s. We will show that the sequence is equally likely to be any of the four orientations/directions in Group A after 2016 tricks. Let M be the sequence before the two H’s. We perform a bijection by varying over all rotation/reflection possibilities of the two H’s. Let H1 be a horizontal reflection, and H2 be a horizontal rotation. H1 H1 gives the same orientation as M and an index increase of 2, H2 H2 gives the same orientation as M and an index increase of 0 or 4, and both of H1 H2 and H2 H1 flip the orientation and one gives an increase of 1 while the other gives an increase of 3, depending on the direction of M. Thus, Yang is equally like to take any orientation/direction in the group he must be in after the two H’s, and no different choices for the rotation/reflection of the H’s will result in the same orientation/direction of Yang ever again. Hence, exactly one of the four choices for the rotation/reflection of the two H’s will allow Yang to go back to S0 after 2016 moves. Case 2. Assume the sequence is HV HV · · · HV . V HV H · · · V H follows analogously. The number  2 1008 of ways this can result in Yang being in his original square is · 22016 , since we must choose 504 the H and V ’s to be L and R, or U and D, respectively. Now, we show that after 2n moves, Yang is equally likely to be in either S2n or O2n+1 , for n ≥ 1. Define V1 and V2 similarly to how H1 and H2 were defined in the previous case. After one move, note that both H1 V1 and H2 V2 give S2 , and H1 V2 and H2 V1 both give O3 . Now, assume that 2n = k holds, we will show it for 2n = k + 2. Assume that For each way Yang is in S2k , H1 V1 and H2 V2 both give S2k+2 , H1 V2 and H2 V1 are both in O2k+3 ; and for each way Yang is in O2k+1 , H1 V1 and H2 V2 both give O2k+3 and H1 V2 and H2 V1 both give S2k+2 . 1 Hence, since 2016 ≡ 0 (mod 4), Yang has a chance of being in his original position. Hence, our final 2  2  2 2016 1008 2014 2015 answer is ·2 + ·2 after doubling to account for V HV H · · · V H. Now, we 1008 504 wish to evaluate this modulo 100000, which by the Chinese Remainder Theorem we simply have to do for 32 and 55 = 3125. It’s clear that our answer is divisible by 32.    2   2016 1008 2016 Note that to compute and (mod 3125), we only need to compute and 1008 504 1008       1008 2016 1008 (mod 125) since it’s easy to check that v5 = = 2. Here, we use the fact that 504 1008 504       pa a 2016 3 ≡ ≡ (mod p ) for all integers a, b and p > 3. Using this fact, we get that pb b 1008     2  2 2000 16 16 2016 ≡ (mod 125). Then, ≡ 54 · 25744 ≡ 625 (mod 3125). Similarly, 1000 8 8 1008  2 1008 ≡ 54 · 144 ≡ 625 (mod 3125). Also, note that 22014 ≡ 4 (mod 5) and 22015 ≡ 3 (mod 5), so 504  2  2 2016 1008 · 22014 + · 22015 ≡ 2500 + 1875 ≡ 1250 (mod 3125). Then, since our answer is 1250 1008 504 (mod 3125) and 0 (mod 32), our final answer modulo 100000 is 20000. √ √ √ √ 30. In triangle ABC, AB = 3 30 − 10, BC = 12, and CA = 3 30 + 10. Let M be the midpoint of AB and N be the midpoint of AC. Denote l as the line passing through the circumcenter O and orthocenter H of ABC, and let E and F be the feet of the perpendiculars from B and C to l, respectively. Let l0 be the reflection of l in BC such that l0 intersects lines AE and AF at P and Q, respectively. Let lines BP and CQ intersect at K. X, Y , and Z are the reflections of K over the perpendicular bisectors of 18

OMO Spring 2016 Official Solutions sides BC, CA, and AB, respectively, and R and S are the midpoints of XY and XZ, respectively. If lines M R and N S intersect at T , then the length of OT can be expressed in the form pq for relatively prime positive integers p and q. Find 100p + q. Proposed by Vincent Huang and James Lin. Answer. 11271 . Solution. Let O1 , O2 , and O3 be the circumcenters of AHO, BHO and CHO. Remark that BE, CF , and the line through A perpendicular to OH are mutually parallel and thus concur at ∞⊥OH . Then since AH, AO are isogonal w.r.t. ∠BAC, we know that AO1 , BO2 , CO3 concur at the isogonal conjugate of ∞⊥OH , and the isogonal conjugate of a point at infinity is a point on ω. Let this point of concurrence be W . Lemma 1. W lies on l0 . Proof. Let L be the midpoint of side BC, and let G0 be the reflection of centroid G over M . Let F be the reflection over line BC, G be the reflection over the perpendicular bisector, and H be the reflection over the point L. Note that F(l) = G(H(l)). Now, note that H(l) is a homothety of factor 2 from A.

Now, let U be the foot of the altitude from A to AOH, and let V be where line AU intersect the circumcircle of ABC again. Note that H(U ) = V and G(V ) = W , so W is on l0 . Lemma 2. Let AW intersect line OH at D. Then D and K are isogonal conjugates. Proof. Let J be the intersection of l and line BC. Note that AEW JP D is a complete quadrilateral formed by the four lines AE, AW, JE and JW . By the dual of Desargues’ Involution Theorem, there must be an involution mapping BE → BW , BA → BJ, and BP → BD. But since the reflection across the angle bisector of ∠ABC is an involution mapping BE → BW and BA → BJ, it must be the same as the prior involution. Thus it also maps BP → BD, implying that BP and BD are isogonal with respect to ∠ABC. Similarly, we can show that the lines CQ and CD are isogonal with respect to ∠BCA, so D and K are isogonal conjugates with respect to triangle ABC. Lemma 3. Let I be the homothety of factor −

1 centered at G. Then I(D) = T . 2

Proof. We will show that N , S, and I(D) are collinear. Let the foot of K to sides BC and BA be K1 and K3 , respectively. Let the reflection of K over K1 and K3 be KA and KC , respectively. Note that AKC BZ is a parallelogram because M is the midpoint of KC Z. Similarly, CKA BX is a parallelogram. BK is the diameter of the circumcircle of BK1 KK3 , so it follows that BD is perpendicular to K1 K3 from Lemma 2, and hence KA KC . But since BKA = BKC , BD is the perpendicular bisector of → − → − → − → − → − → − −→ −−→ → − → − −−→ → − → − X+Z A−Z C −X ZA + XC A+C − = + = = KA KC . Now, note that SN = N − S = 2 2 2 2 2 −−−→ −−−→ −−−→ BKC + BKA = BMB , where MB is the midpoint of KA KC , so hence BD k SN . But since I(B) = N , 2 it follows that BD k N I(D) and hence N, S, and I(D) are collinear. Similarly, it follows that M, R, and I(D) are collinear, so I(D) = T , as desired.

4 , and cos(B − C) = 5 1 This gives AO = 10, OH = 14, and HA = 16. Then, sin DAH = cos AOH = and sin DAO 7 Now, note that the conditions give us that the circumradius R = 10, cos A =

19

1 . 2 =

OMO Spring 2016 Official Solutions 11 , so by the Ratio Lemma we get that HD : DO = 16 : 55. Then, since HG : GO = 2 : 1, 14 8 112 we get that HT : T O = 63 : 8 from Lemma 3. Then, OT = 14 × = , so the answer is 11271. 71 71 cos AHO =

20

The Online Math Open Fall Contest Official Solutions November 4 – 15, 2016

Acknowledgements Tournament Director • James Lin

Problem Authors • Vincent Huang • Yang Liu • Michael Ren • Ashwin Sah • Tristan Shin • Yannick Yao

Website Manager • Evan Chen • Douglas Chen

LATEX/Python Geek • Evan Chen

OMO Fall 2016 Official Solutions 1. Kevin is in first grade, so his teacher asks him to calculate 20 + 1 · 6 + k, where k is a real number revealed to Kevin. However, since Kevin is rude to his Aunt Sally, he instead calculates (20+1)·(6+k). Surprisingly, Kevin gets the correct answer! Assuming Kevin did his computations correctly, what was his answer? Proposed by James Lin. Answer. 21 . Solution. Equating the given expression and Kevin’s incorrect expression gives 26 + k = 21(6 + k) = 126 + 21k =⇒ k = −5, so hence 26 + k = 21. 2. Yang has a standard 6-sided die, a standard 8-sided die, and a standard 10-sided die. He tosses these three dice simultaneously. The probability that the three numbers that show up form the side lengths of a right triangle can be expressed as m n , for relatively prime positive integers m and n. Find 100m+n. Proposed by Yannick Yao. Answer. 1180 . Solution. Notice that the only ways for the three rolls to form a right triangle are by getting 3 − 4 − 5 and 6 − 8 − 10, in some order. It is not difficult to see that there are 3! = 6 ways to get 3 − 4 − 5 and 6+1 7 1 way to get 6 − 8 − 10, so the desired probability is 6·8·10 = 480 , so our answer is 1180. 3. In a rectangle ABCD, let M and N be the midpoints of sides BC and CD, respectively, such that √ AM is perpendicular to M N . Given that the length of AN is 60, the area of rectangle ABCD is m n for positive integers m and n such that n is not divisible by the square of any prime. Compute 100m + n. Proposed by Yannick Yao. Answer. 160002 . AB Solution. Notice that 4ABM is similar to 4M CN , so BM = CM = CM and AB = CN . Since BM q √ √  2 AN AD 2 2CN , it follows that BC = 2AB and therefore AD = 2 2DN . Hence, DN = + DN = DN DN q √  √ √ 2 2 2 + 12 = 3. Thus, DN = 60/3 = 20 ⇒ CD = 40 and the area of ABCD is 40·40 2 = 1600 2, giving an answer of 160002. 100

4. Let G = 1010

(a.k.a. a googolplex). Then log(log

can be expressed in the form the digits of m + n.

m n

(log10 G)

G)

G

for relatively prime positive integers m and n. Determine the sum of

Proposed by Yannick Yao. Answer. 18 . Solution. We compute log10 G = 10100 , and log(log10 G) G = log(log

(log10 G)

G) G =

log10 G 10100 = = 1098 ; log10 (log10 G) 100

log10 G 10100 5 · 1099 = = . log10 (log(log10 G) G) 98 49

Therefore m + n = 5 · 1099 + 49, so the sum of the digits of m + n is 18. 1

OMO Fall 2016 Official Solutions 5. Jay notices that there are n primes that form an arithmetic sequence with common difference 12. What is the maximum possible value for n? Proposed by James Lin. Answer. 5 . Solution. Assume there exist 5 prime numbers that form an arithmetic sequence with common difference 12, denoted by p, p + 12, p + 24, p + 36, p + 48. Notice that these 5 primes have 5 different residues modulo 5, hence one of them is divisible 5. Therefore p = 5. It follows that any arithmetic progression that does not contain 5 must have at most four primes. Otherwise, if the sequence contains a 5, it can have at most 5 terms: 5, 17, 29, 41, 53, because the potential next term is 65. Thus the answer is 5. 2

6. For a positive integer n, define n? = 1n · 2n−1 · 3n−2 · · · (n − 1) · n1 . Find the positive integer k for which 7?9? = 5?k?. Proposed by Tristan Shin. Answer. 10 . n? Solution. Notice that (n−1)? = n!. Thus, we can see that n? = 1!2! · · · n!. Because of this, we have k? 7? that 9? = 5? = 7!6!. Noting that 10 · 9 · 8 = 6! =⇒ 10! = 7!6!, it follows that k? = 9?10! = 10? and k = 10.

7. The 2016 players in the Gensokyo Tennis Club are playing Up and Down the River. The players first randomly form 1008 pairs, and each pair is assigned to a tennis court (The courts are numbered from 1 to 1008). Every day, the two players on the same court play a match against each other to determine a winner and a loser. For 2 ≤ i ≤ 1008, the winner on court i will move to court i − 1 the next day (and the winner on court 1 does not move). Likewise, for 1 ≤ j ≤ 1007, the loser on court j will move to court j + 1 the next day (and the loser on court 1008 does not move). On Day 1, Reimu is playing on court 123 and Marisa is playing on court 876. Find the smallest positive integer value of n for which it is possible that Reimu and Marisa play one another on Day n. Proposed by Yannick Yao. Answer. 500 . Solution. If both Reimu and Marisa (or neither of them) change courts each day, then the difference between their court numbers will increase by 2, decrease by 2, or stay constant. If one of them doesn’t change courts (because she either won on court 1 or lost on court 1008), then the difference changes by 1. Since 876 − 123 = 753 is odd, this means that they will never play each other unless one of them gets to court 1 and 1008 and stays for an odd number of rounds. Since Reimu is closer to court 1 than Marisa to court 1008, it can be seen that the fastest way for Reimu and Marisa to play one another is to have Reimu rise to court 1 (Reaching there on Day 123) and stay for 1 day (So she loses on Day 124) before losing to meet Marisa, who is rising the whole time. At Day 124, Marisa is on court 876 − 123 = 753. Then it takes (753 − 1)/2 = 376 days for them to meet each other on court 377 on Day 124 + 376 = 500. Thus 500 is our answer. 8. For a positive integer n, define the nth triangular number Tn to be n(n+1) , and define the nth square 2 number Sn to be n2 . Find the value of v s u r q u p t S62 + T63 S61 + T62 · · · S2 + T3 S1 + T2 . Proposed by Yannick Yao.

2

OMO Fall 2016 Official Solutions Answer. 1954 . r Solution. For each positive integer n, let Kn = that Kn = Tn + 1 for all n.

q Sn + Tn+1

Sn−1 + Tn

p

···



S1 + T2 . We claim

√ √ We proceed by induction. For the base case of n=‘, K1 = S1 + T2 = p 1 + 3 = 2 = T1 +1. Now assume that the claim is true for n = t, then it suffices to show that Kt+1 = St+1 + Tt+2 (Tt + 1) = Tt+1 + 1. Note that (Tt+1 +1)2 −St+1 = (Tt+1 +1)2 −(t+1)2 = (Tt+1 +1+(t+1))(Tt+1 +1−(t+1)) = (Tt+1 +(t+2))(Tt+1 −t) = Tt+2 (Tt +1), p so hence Tt+1 + 1 = St+1 + Tt+2 (Tt + 1), thus finishing the inductive step and proving the claim. Now, K62 = T62 + 1 =

62·63 2

+ 1 = 1954.

9. In quadrilateral ABCD, AB = 7, BC = 24, CD = 15, DA = 20, and AC = 25. Let segments AC and BD intersect at E. What is the length of EC? Proposed by James Lin. Answer. 18 . Solution. Note that ∠ABC = ∠ADC = 90◦ , so ABCD is a cyclic quadrilateral. Then, 4BEC ∼ BC 6 CE CD 15 CE BE CE BE = = and 4AEB ∼ 4DEC so = = . Hence, = · = 4AED so AE AD 5 BE AB 7 AE AE BE 6 15 18 · = . Since AE + EC = 25, it follows that EC = 18. 5 7 7 10. Let a1 < a2 < a3 < a4 be positive integers such that the following conditions hold: • gcd(ai , aj ) > 1 holds for all integers 1 ≤ i < j ≤ 4. • gcd(ai , aj , ak ) = 1 holds for all integers 1 ≤ i < j < k ≤ 4. Find the smallest possible value of a4 . Proposed by James Lin. Answer. 231 . Solution. Every two integers must share at least one prime factor, but this prime factor cannot divide a third number to comply with the second condition. Therefore there must be at least six different primes p1,2 , p1,3 , p1,4 , p2,3 , p2,4 , p3,4 such that p1,2 p1,3 p1,4 | a1 , p1,2 p2,3 p2,4 | a2 , p1,3 p2,3 p3,4 | a3 , p1,4 p2,4 p3,4 | a4 . In order to minimize a4 , we may assume that {p1,2 , p1,3 , p1,4 , p2,3 , p2,4 , p3,4 } = {2, 3, 5, 7, 11, 13} and a1 = p1,2 p1,3 p1,4 ; a2 = p1,2 p2,3 p2,4 ; a3 = p1,3 p2,3 p3,4 ; a4 = p1,4 p2,4 p3,4 . We will ignore the condition that a1 < a2 < a3 < a4 and instead find max(a1 , a2 , a3 , a4 ). Assume that p3,4 = 13. If 11 ∈ {p1,3 , p1,4 , p2,3 , p2,4 }, then max(a3 , a4 ) ≥ 2·11·13 = 286. Otherwise p1,2 = 11, and as p1,3 , p1,4 , p2,3 , p2,4 are again symmetric, we can assume that p2,4 = 7. Hence, we have a1 = 11p1,3 p1,4 , a2 = 77p2,3 , a3 = 13p1,3 p2,3 , a4 = 91p1,4 , so since max(p1,4 , p2,3 ) ≥ 3, we have that max(a3 , a4 ) ≥ 77 · 3 = 231. This maximum value of 231 can be achieved by letting p2,3 = 3, p1,4 = 2, p1,3 = 5, so that a1 = 110, a2 = 231, a3 = 195, a4 = 182. 11. Let f be a random permutation on {1, 2, . . . , 100} satisfying f (1) > f (4) and f (9) > f (16). The probability that f (1) > f (16) > f (25) can be written as m n where m and n are relatively prime positive integers. Compute 100m + n. Note: In other words, f is a function such that {f (1), f (2), . . . , f (100)} is a permutation of {1, 2, . . . , 100}. Proposed by Evan Chen. 3

OMO Fall 2016 Official Solutions Answer. 730 . 5! Solution. There are = 30 ways to order f (1), f (4), f (9), f (16), f (25) such that the given con2! · 2! dition is true. Now, we will count the number of these orderings of f (1), f (4), f (9), f (16), f (25) such that the second condition is true. First we count the number of conditions such that f (1) > f (16). Consider f (1), f (4), f (9), f (16), and note that f (1), f (9) > f (16). If f (4) > f (16), there are 3 ways to order f (1), f (4), f (9) since f (1) > f (4) and there is 1 way to place f (25). If f (16) > f (4), then there are 2 ways to order f (1) and f (9), and there are 2 ways to place f (25). Hence, of the 30 ways to order the 7 , and our answer is 730. five numbers, 3 + 2 · 2 = 7 of them are valid, so the desired probability is 30 Alternate Solution. consider the ordering of f (1), f (9), f (16), f (25) first. If it’s f (9) > f (1) > f (16) > f (25), then there are 3 ways to place f (4). If it’s f (1) > f (9) > f (16) > f (25), then there are 4 ways 7 . to place f (4), this also gives 3 + 4 = 7 valid orders. Hence, the probability is 30 m

12. For each positive integer n ≥ 2, define k (n) to be the largest integer m such that (n!) What is the minimum possible value of n + k (n)?

divides 2016!.

Proposed by Tristan Shin. Answer. 89 . Solution. Let a = 2016. Let m be a positive integer. First, note that m bxc ≤ bmxc for all positive real numbers x. In particular,  X  ∞  ∞  X n mn m ≤ pk pk k=1

k=1

for all primes p and positive integers m and n. But by Legendre’s Formula, this is just mvp (n!) ≤ m vp ((mn)!). We can then see that (n!) | (nm)! for all positive integers m and n.       a Now, this means that (n!)b n c |√n na ! | a!, as n na ≤ a. This gives that k (n) ≥ na > na − 1. But then n + k (n) > n + na − 1 ≥ 2 a − 1 ≈ 88.8 by AM-GM. Thus, n + k (n) ≥ 89, as it is an integer. Next,  2016 we will that k (47) ≤ 42. This is obvious, as (47!) = 42. 47

43

cannot divide 2016! because v47 (2016!) =

But then 89 ≤ 47 + k (47) ≤ 89, so hence 89 = 47 + k (47). Thus, the answer is 89. 13. Let A1 B1 C1 be a triangle with A1 B1 = 16, B1 C1 = 14, and C1 A1 = 10. Given a positive integer i and a triangle Ai Bi Ci with circumcenter Oi , define triangle Ai+1 Bi+1 Ci+1 in the following way: (a) Ai+1 is on side Bi Ci such that Ci Ai+1 = 2Bi Ai+1 . (b) Bi+1 6= Ci is the intersection of line Ai Ci with the circumcircle of Oi Ai+1 Ci . (c) Ci+1 6= Bi is the intersection of line Ai Bi with the circumcircle of Oi Ai+1 Bi . Find ∞ X [Ai Bi Ci ] i=1

Note: [K] denotes the area of K. Proposed by Yang Liu. Answer. 10800 .

4

!2 .

OMO Fall 2016 Official Solutions Solution. Note that for all integers i ≥ 1, Ai Bi+1 Oi Ci+1 is a cyclic quadrilateral by Miquel’s Theorem. Then, ∠Bi+1 Ai+1 Ci+1 = ∠Bi+1 Ai+1 Oi + ∠Oi Ai+1 Ci+1 = ∠Ai Ci Oi + ∠Oi Bi Ai = ∠Ci Ai Oi + ∠Bi Ai Oi = ∠Bi Ai Ci . Similarly, we can show ∠Ci+1 Bi+1 Ai+1 = ∠Ci Bi Ai , so 4Ai+1 Bi+1 Ci+1 ∼ [Ai+1 Bi+1 Ci+1 ] [A2 B2 C2 ] [A2 B2 C2 ] 4Ai Bi Ci . Hence, it follows that = , so it suffices to calculate . [Ai Bi Ci ] [A1 B1 C1 ] [A1 B1 C1 ] Let R1 and R2 denote the circumradii of A1 B1 C1 and A2 B2 C2 , respectively. Note that ∠C2 A2 O1 + ∠A2 C2 B2 = ∠B1 A1 O1 + ∠A1 C1 B1 = 90◦ , so C2 O1 is perpendicular to A2 B2 . Similarly, B2 O1 is perpendicular to C2 A2 , so O1 is the orthocenter of A2 B2 C2 . Note that it’s well-known by the Law of 14 14 B1 C 1 = √ , B1 A2 = , Cosines that ∠B1 A1 C1 = 60◦ =⇒ O2 B1 C1 = 30◦ . Also, R1 = 2 sin B1 A1 C1 3 3 √ 1 and [A1 B1 C1 ] = · A1 B1 · A1 C1 · sin B1 A1 C1 = 40 3. By the Law of Cosines on 4A2 B1 O1 , A2 B1 = 2 s √ 2  2 14 14 14 3 14 14 √ + −2· ·√ · = . Since O1 is the orthocenter of A2 B2 C2 , it’s well-known 3 2 3 3 3 3  2 14 1 [A2 B2 C2 ] R2 that = = A2 O1 = 2R2 cos B2 A2 C2 = 2R2 cos B1 A1 C1 = R2 . Then, = and 3 [A1 B1 C1 ] R1 3 !2  2  ∞ X √ 2 [A1 B1 C1 ] 3 = 10800. [Ai Bi Ci ] = = 60 1 − 13 i=1 Alternate Solution: As before, note that 4Ai+1 Bi+1 Ci+1 ∼ 4Ai Bi Ci , so we only need to com[A2 B2 C2 ] 7 pute . Let M denote the midpoint of B1 C1 . It can be computed that A2 M = and [A1 B1 C1 ] 3 7 O1 M = A1 O1 sin O1 A1 M = √ , so ∠A2 O1 M = 30◦ and 90◦ = ∠A2 O1 C1 = ∠A2 B2 C1 . Then since 3 √ 3 √ 16 · B1 A1 sin B1 A1 C1 4 3 2 sin B1 C1 A1 = = = , it follows that A2 B2 = A2 C1 sin B1 C1 A1 = B1 C 1 14  7 √ 2 28 4 3 16 [A2 B2 C2 ] A2 B 2 1 · = √ . It follows that = = . Proceed to do the calculation as in the 3 7 [A1 B1 C1 ] A1 B 1 3 3 previous solution. 14. In Yang’s number theory class, Michael K, Michael M, and Michael R take a series of tests. Afterwards, Yang makes the following observations about the test scores: • Michael K had an average test score of 90, Michael M had an average test score of 91, and Michael R had an average test score of 92. • Michael K took more tests than Michael M, who in turn took more tests than Michael R. • Michael M got a higher total test score than Michael R, who in turn got a higher total test score than Michael K. (The total test score is the sum of the test scores over all tests) What is the least number of tests that Michael K, Michael M, and Michael R could have taken combined? Proposed by James Lin. Answer. 413 . Solution. Say that Michael K took x tests, Michael M took y tests, and Michael R took z tests, so we need to minimize x + y + z given that x > y > z and 91y > 92z > 90x. Note that y ≤ x − 1 =⇒ 90x < 91y ≤ 91(x − 1) =⇒ 91 < x. If z = x − 2, then 90x < 92z = 92(x − 2) =⇒ x < 92, contradicting 91 < x. Hence, z ≤ x − 3. If z = x − 3, then 92z > 90x = 90(z + 3) =⇒ z > 135. If y − z = 1, it follows that 92z < 91y = 91(z + 1) =⇒ z < 91, a contradiction. Hence, y − z = 2, so x + y + z ≥ 139 + 138 + 136 = 413. Now, assume that z = x − k for an integer k ≥ 3. Then, 92z > 90x = 90(z + k) =⇒ z > 45k. Then, x + y + z > 3z > 135k ≥ 540. It follows that the minimum possible value of x + y + z is 413. 5

OMO Fall 2016 Official Solutions 15. Two bored millionaires, Bilion and Trilion, decide to play a game. They each have a sufficient supply of $1, $2, $5, and $10 bills. Starting with Bilion, they take turns putting one of the bills they have into a pile. The game ends when the bills in the pile total exactly $1,000,000, and whoever makes the last move wins the $1,000,000 in the pile (if the pile is worth more than $1,000,000 after a move, then the person who made the last move loses instead, and the other person wins the amount of cash in the pile). Assuming optimal play, how many dollars will the winning player gain? Proposed by Yannick Yao. Answer. 333333 . Solution. Note that there are bills that are 1 and 2 modulo 3, but not 0 modulo 3. Hence, Bilion has a winning strategy by watching the number of dollars in the pile modulo 3: he first plays $1 or $10, and then makes sure that after each of his turns, the amount of money in the pile is 1 modulo 3. (He can always ensure that he will not go over by playing $1 or $2 at the end.) In fact, he must adopt this strategy, as if he ever veers from it, Trilion will have the opportunity to adopt it and thus win. As Bilion is the guaranteed winner, it’s clear that both Bilion and Trilion will try to put the least amount of money they can each round. (With the exception that Bilion’s first priority is to watch the number of dollars in the pile modulo 3.) Therefore Bilion and Trilion will both want to play a $1 bill over a $10 bill, and a $2 over a $5. After Bilion puts a $1 bill on the first turn, it becomes clear that each turn will alternate between Trilion putting a $1 bill into the pile and Bilion puttting a $2 bill into the = 333333 times, Bilion will end up winning $333333 from pile. Since they will do this so 1000000−1 3 Trilion. 16. For her zeroth project at Magic School, Emilia needs to grow six perfectly-shaped apple trees. First she plants six tree saplings at the end of Day 0. On each day afterwards, Emilia attempts to use her magic to turn each sapling into a perfectly-shaped apple tree, and for each sapling she succeeds in turning it into a perfectly-shaped apple tree that day with a probability of 12 . (Once a sapling is turned into a perfectly-shaped apple tree, it will stay a perfectly-shaped apple tree.) The expected number of days it will take Emilia to obtain six perfectly-shaped apple trees is m n for relatively prime positive integers m and n. Find 100m + n. Proposed by Yannick Yao. Answer. 789953 . Solution. Let N be the number of days that Emilia took to grow six perfectly-shaped apple trees. We can see that E(N ) = 1 · P (N = 1) + 2 · P (N = 2) + 3 · P (N = 3) + . . . = P (N ≥ 1) + P (N ≥ 2) + P (N ≥ 3) + . . . , which means that it suffices to sum the probability that the first day is needed, the second day is needed, etc. For each integer k, the probability that Emilia does not need the k-th day is the probability that all 6 saplings are grown into perfectly-shaped apple trees in the first k − 1 days. By complementary  k−1 6 counting, we can find P (N ≥ k) = 1 − 1 − 12 . In order to sum the probabilities over all positive integers k, we rewrite the probability as 1 1 1 1 1 1 P (N ≥ k) = 6( )k−1 − 15( )k−1 + 20( )k−1 − 15( )k−1 + 6( )k−1 − ( )k−1 2 4 8 16 32 64 and sum each of the six terms term across all k since each of them is a geometric series. We can see that the sum is 6(2/1) − 15(4/3) + 20(8/7) − 15(16/15) + 6(32/31) − (64/63) = 7880/1953, and the answer is 789953. 6

OMO Fall 2016 Official Solutions 17. Let n be a positive integer. S is a set of points such that the points in S are arranged in a regular 2016-simplex grid, with an edge of the simplex having n points in S. (For example, the 2-dimensional n(n + 1) analog would have points arranged in an equilateral triangle grid). Each point in S is labeled 2 with a real number such that the following conditions hold: • Not all the points in S are labeled with 0. • If ` is a line that is parallel to an edge of the simplex and that passes through at least one point in S, then the labels of all the points in S that are on ` add to 0. • The labels of the points in S are symmetric along any such line `. Find the smallest positive integer n such that this is possible. Note: A regular 2016-simplex has 2017 vertices in 2016-dimensional space such that the distances between every pair of vertices are equal. Proposed by James Lin. Answer. 4066273 . Solution. We interpret S as a polynomial P (x1 , x2 , . . . , x2017 ) expressed in Chinese Dumbass Notation. That is, if the vertices of the 2016-simplex are V1 , V2 , . . . , V2017 , then we associate Vi with 1 the monomial xn−1 , and for all points of the form W = n−1 (c1 V1 + c2 V2 + · · · + c2017 V2017 ) for i non-negative integers c1 , c2 , . . . , c2017 summing to n − 1 (Where the points are treated as vectors), 2017 we associate W with the monomial x1c1 xc22 . . . xc2017 . It’s clear that the set of all possible tuples (c1 , c2 , .X . . , c2017 ) corresponds exactly with the points in S. Then, if W is labeled with w, we let 2017 P = wxc11 xc22 . . . xc2017 . The first condition tells us that P 6= 0. Let T be the set of all W ∈S

lines ` parallel to V1 V2 and passing through at least one point S. Then, applying the second condition over all lines in T tells us that P (x1 , x1 , x3 , . . . , x2017 ) = 0, and applying the third condition over all lines in T tells us that P (x1 , x2 , x3 , . . . , x2017 ) = P (x2 , x1 x3 , . . . , x2017 ). It’s well2 known Y that this occurs if and only if (x1 − x2 ) |P (x1 , x2 , . . . , x2017), so by symmetry, it follows that 2 (xi − xj ) |P (x1 , x2 , . . . , x2017 ), so n − 1 = deg P ≥ 2 2017 . Equality can be achieved simply 2 1≤i
by letting P (x1 , x2 , . . . , x2017 ) =

Y

(xi − xj )2 , so n = 2

2017 2



+ 1 = 4066273.

1≤i
18. Find the smallest positive integer k such that there exist positive integers M, O > 1 satisfying (O · M · O)k = (O · M ) · (N · O · M ) · (N · O · M ) · . . . · (N · O · M ), | {z } 2016 (N ·O·M )s

where N = OM . Note: This is edited from the previous text, which did not clarify that N OM represented N · O · M , for example. Proposed by Yannick Yao and James Lin. Answer. 2823 . Solution. Rewrite as O2k M k = O2017+2016M M 2017 . Note that if k ≤ 2016, then O4032 M 2016 ≥ O2k M k = O2017+2016M M 2017 , a contradiction since M > 1. If k = 2017, then we need O4034 M 2017 = O2017+2016M M 2017 , which has no integer solution for M since O > 1. Hence, k > 2017, so rewrite the equation as M k−2017 = O2017+2016M −2k . Note that logM O is a rational number.

7

OMO Fall 2016 Official Solutions If M = 2, then we have 2k−2017 = O6049−2k , so we have 6049−2k | k −2017 | 2k −4034 =⇒ 6049−2k | 2015 = 5 · 13 · 31. Since k > 2017, 6049 − 2k < 2015, so hence we have 6049 − 2k ≤ 403 = 13 · 31 =⇒ k ≥ 2823. k = 2823 is achieved when M = 2 and O = 4. Now, assume for the sake of contradiction that some k < 2823 gives a solution for M and O. We must have M ≥ 3. If M ≤ O, then k − 2017 ≥ 2017 + 2016M − 2k ≥ 2017 + 2016 · 3 − 2k =⇒ 3k ≥ 10082, which contradicts k < 2823. Hence, M > O. Let M = xy , where x ≥ 2 is not the perfect power of any integer (Other than itself) and y ≥ 2, since otherwise there is no choice for O. Then, O ≥ x, so xy(k−2017) = M k−2017 = O2017+2016M −2k ≥ x2017+2016x

y

−2k

=⇒ y(k − 2017) ≥ 2017 + 2016xy − 2k ≥ 2017 + 2016 · 2y − 2k =⇒ (y + 2)(k − 2017) ≥ 2016 · 2y − 2017 2016 · 2y − 2017 . =⇒ 806 > k − 2017 ≥ y+2 2016 · 2y − 2017 , which will y+2 show that k < 2823 is impossible. This is clearly true for y = 2, now assume it is true for y = z 2016 · 2z − 2017 for some integer z ≥ 2. We will show it holds for y = z + 1. Note that 806 ≤ = z+2 z z+1 2(2016 · 2 − 2017) 2016 · 2 − 2017 ≤ , so the induction is complete. 2(z + 2) z+3

We will now show by induction on y that for y ≥ 2, we have 806 ≤

19. Let S be the set of all polynomials Q(x, y, z) with coefficients in {0, 1} such that there exists a homogeneous polynomial P (x, y, z) of degree 2016 with integer coefficients and a polynomial R(x, y, z) with integer coefficients so that P (x, y, z)Q(x, y, z) = P (yz, zx, xy) + 2R(x, y, z) and P (1, 1, 1) is odd. Determine the size of S. Note: A homogeneous polynomial of degree d consists solely of terms of degree d. Proposed by Vincent Huang. Answer. 509545 . Solution. We work entirely in F2 [X, Y, Z]. First it’s clear that deg Q = 2016 by examining degrees in the relation. Now, notice that P (x, y, z)|P (yz, zx, xy). Therefore, we know that P (yz, zx, xy)|P (zx · xy, yz · xy, yz · zx) = P (xyz · x, xyz · y, xyz · z) = (xyz)2016 P (x, y, z), where the last equality holds because P is homogeneous with degree 2016. Then it’s clear that Q(x, y, z)|(xyz)2016 , implying that Q(x, y, z) is a monomial of the form xa y b z c with a + b + c = 2016. Now suppose P has any term xd y e z f . Then P (yz, zx, xy) contains the term xd+a y e+b z f +c . But this term can only come from multiplying (yz)n−d−a (zx)n−b−e (xy)n−c−f which means that P (x, y, z) contains a term of the form xn−d−a y n−b−e z n−c−f . So we have a bijection in the nonzero terms of P which is (d, e, f ) ⇐⇒ (n − d − a, n − b − e, n − c − f ). But since P (1, 1, 1) 6= 0 (mod 2) by the given condition, we must have that some (d, e, f ) is equal to (n − d − a, n − b − e, n − c − f ), otherwise the total number of terms would be even. Then we deduce n = 2d+a = 2e+b = 2f +c. It’s evident that a, b, c ≡ 2016 mod 2 with a+b+c = 2016. Clearly all such polynomials in Q will work as we can just take P = x0.5(n−a) y 0.5(n−b) z 0.5(n−c) . To evaluate the size of Q, note there’s a bijection  between the working triples (a, b, c) and the solutions to x + y + z = 1008, which evaluates to 1008+2 = 509545. 2 8

OMO Fall 2016 Official Solutions 20. For a positive integer k, define the sequence {an }n≥0 such that a0 = 1 and for all positive integers n, an is the smallest positive integer greater than an−1 for which an ≡kan−1 (mod 2017). What is the number of positive integers 1 ≤ k ≤ 2016 for which a2016 = 1 + 2017 ? 2 Proposed by James Lin. Answer. 1953 . Solution. Let p = 2017 and M = E(an+1 − an ), where n ranges from 0 to p − 2, inclusive. We  p for a2016 = 1 + 2017 . Note that for k = 1, M = p, so we can assume that k > 1. If need M = 2 2 n+1 n k − k ≡ i (mod p), for 1 ≤ i ≤ p − 1, then i ≡ k n (k − 1) (mod p). p Let ordp (k) = d. We will show that M = if and only if d is even. Note that M is also E(an+1 − an ), 2 where n ranges from 0 to d − 1, inclusive. If d = 2g is even, then note that k −g ≡ −1 (mod p) so k j ≡ −k j+g 6= 0 (mod p) for all nonnegative integers j. Since k − 1 6= 0 (mod p), k j (k − 1) = p by ranging over all 0 ≤ j ≤ g − 1. If d is −k j+g (k − 1) 6= 0 (mod p). Then, it’s clear that M = 2 dp p , which is not a odd, then note that it is impossible for M = , as then it would require ad − a0 = 2 2 positive integer. Let q be the largest odd factor of p − 1. It’s well-known that X the number of residues with order d modulo p, where d|p − 1, is φ(d), so our answer is (p − 1) − φ(d) = (p − 1) − q, so letting p = 2017 d|q

gives q = 63, and our answer is 1953. 21. Mark the Martian and Bark the Bartian live on planet Blok, in the year 2019. Mark and Bark decide to play a game on a 10 × 10 grid of cells. First, Mark randomly generates a subset S of {1, 2, . . . , 2019} with |S| = 100. Then, Bark writes each of the 100 integers in a different cell of the 10 × 10 grid. Afterwards, Bark constructs a solid out of this grid in the following way: for each grid cell, if the number written on it is n, then she stacks n 1 × 1 × 1 blocks on top of one other in that cell. Let B be the largest possible surface area of the resulting solid, including the bottom of the solid, over all possible ways Bark could have inserted the 100 integers into the grid of cells. Find the expected value of B over all possible sets S Mark could have generated. Proposed by Yang Liu. Answer. 234040 . Solution. Let the numbers Mark generate be s1 < s2 < · · · < s100 be the number that Mark chooses. Note that any other number s ∈ {1, 2, . . . , 2019} \ S if equally likely to be in the open intervals (0, s1 ), (s1 , s2 ), . . . (s99 , s100 ), (s100 , 2020), so it follows that E(sk ) = 2019−100 · k + k = 20k. 101 Now, fix s1 , s2 , . . . s100 , and randomly place them in the grid cells. Draw empty cells next to the edges of the grid (they are shaded below), and define total cells to be the union of grid cells and empty cells. Say that two total cells are adjacent if they share a side. Define a grid cell to be an edge cell if it is adjacent to an empty cell.

9

OMO Fall 2016 Official Solutions

Label the rows and columns of the grid by 1, 2, . . . , 10, and let the cell in the ith row and j th column be denoted by ci,j , with a total of ti,j blocks on it. Furthermore, denote ti,j = 0 when either i = 0, i = 11, j = 0, or j = 11. Let ai,j for 1 ≤ i, j ≤ 10 denote the size of the set {t : t ∈ {ti−1,j , ti,j−1 , ti+1,j , ti,j+1 } and t < ti,j }. That is, the stack on a grid cell ci,j is taller than ai,j of the stack on its 4 adjacent total cells (Where the empty cells are stacks of 0 blocks). Note that the top and bottom of the stacks on grid cells contribute 200 to the surface area of Bark’s solid; now, it remains to calculate the lateral surface area of the solid. Note that the region between any two stacks on two adjacent total cells of size x and y contributeX |x − y| to the surface area, so it becomes clear that the lateral surface area of the solid is simply (2ai,j − 4)ti,j . Since the ti,j ’s are fixed, it 1≤i,j≤10

suffices to maximize to maximize M =

X

ai,j ti,j . Write the set {ai,j : 1 ≤ i, j ≤ 10} as {b1 , b2 , . . . b100 }, so we need

1≤i,j≤10 X bi s101−i . 1≤i≤100

Define a sequence ci by ci = 4 for 1 ≤ i ≤ 50, ci = 2 for i = 51 ≤ i ≤ 52, ci = 1 for 53 ≤ i ≤ 68, and ci = 0 for 69 ≤ i ≤ 100. We will show that the sequence ci majorizes the sequence bi , or that c1 + c2 + · · · + ci ≥ b1 + b2 + · · · + bi for 1 ≤ i ≤ 100, where equality holds for i = 100. Since the sequence {s101−i } is increasing, it’s clear that M is maximized when bi = ci for all i. Let yi = b1 + b2 + · · · + bi and zi = c1 + c2 + · · · + ci for 1 ≤ i ≤ 100. Note that y100 = 220 = z100 since there are 220 pairs of adjacent total cells, and it follows that yi ≤ zi = 220 for 68 ≤ i ≤ 99. Furthermore, 0 ≤ bi ≤ 4 for all i, so yi ≤ zi = 4i for 1 ≤ i ≤ 50 certainly holds.

10

OMO Fall 2016 Official Solutions Next, we will show that y51 ≤ z51 = 202. If b50 < 4, then it’s clear that we are done. Otherwise, assume b50 = 4. We can find a Hamiltonian cycle on the grid cells, as labeled in red above. Note that ai,j = 4 cannot hold for consecutive grid cells along the Hamiltonian cycle, since b50 = 4, it follows that in fact every other cell along the Hamiltonian cycle satisfies ai,j = 4. This means that a the cells satisfying ai,j = 4 are the black squares on a 10 × 10 chessboard, but it’s then clear that b51 ≤ 2 since any white square on a chessboard neighbors at least two black squares. Now, it remains to prove that bi ≤ ci = 152+i for 52 ≤ i ≤ 67. Note that we can tile the 8×8 grid cells in rows 2 − 9 and columns 2 − 9 with 32 dominoes, and ai,j ≥ 1 for at least one grid cell in each domino, and ai,j ≥ 1 for all 36 edge grid cells, so b68 ≥ 1. It’s then clear that that bi+1 + bi+2 + · · · + b68 ≥ 68 − i for 52 ≤ i ≤ 67, so we are done. Hence, our answer is maximized when bi = 4 for 1 ≤ i ≤ 50, bi = 2 for 51 ≤ i ≤ 52, bi = 1 for 53 ≤ i ≤ 68, and bi = 0 for 69 ≤ i ≤ 100. This means that by linearity of expectation, our answer is

200 + E(4 · (s51 + s52 + · · · + s100 ) − 2 · (s33 + s34 + · · · + s48 ) − 4 · (s1 + s2 + · + s32 ))) =200 + (4 · (E(s51 ) + E(s52 ) + · · · + E(s100 )) − 2 · (E(s33 ) + E(s34 ) + · · · + E(s48 )) − 4 · (E(s1 ) + E(s2 ) + · + E(s32 )) =200 + 302000 − 25920 − 42240 =234040

22. Let ABC be a triangle with AB = 3 and AC = 4. It is given that there does not exist a point D, different from A and not lying on line BC, such that the Euler line of ABC coincides with the Euler line of DBC. The square of the product of all possible lengths of BC can be expressed in the form √ m + n p, where m, n, and p are positive integers and p is not divisible by the square of any prime. Find 100m + 10n + p. Note: For this problem, consider every line passing through the center of an equilateral triangle to be an Euler line of the equilateral triangle. Hence, if D is chosen such that DBC is an equilateral triangle and the Euler line of ABC passes through the center of DBC, then consider the Euler line of ABC to coincide with ”the” Euler line of DBC. Proposed by Michael Ren. Answer. 10782 . Solution. Suppose that ABC and DBC have the same Euler line `. Then, note that the circumcenters of ABC and DBC must lie on both the perpendicular bisector of BC and `. Because AB 6= AC, ` is not the perpendicular bisector of BC, so the two lines do not coincide. This means that ABC and DBC have a common circumcenter, O. Let M be the midpoint of BC. Note that a homothety centered at M with ratio 3 takes ` to AD because the centroids of ABC and DBC lie on `. Hence, D does not exist if and only if the parallel to ` through A does not intersect the circumcircle of ABC at a point different from A, B, and C. We either have that ` k AB, ` k AC, or ` is parallel to the tangent to the circumcircle of ABC at A. Let x = BC. By the Law of Cosines, cos A =

25−x2 24 ,

cos B =

x2 −7 6x ,

and cos C =

x2 +7 8x .

Let H and O respectively be the orthocenter and circumcenter of ABC. It is well-known that the heights from H and O to AB have lengths 2R cos A cos B and R cos C, respectively. If OH k AB, then 2 x2 −7 x2 +7 we must have 2 cos A cos B = cos C, or 2 · 25−x =⇒ (25 − x2 )(x2 − 7) = 9(x2 + 7) =⇒ 24 · 6x = 8x 4 2 x − 23x + 238 = 0, which has no real solutions. 2

2

2

+7 Similarly, if OH k AC, then we must have 2 cos A cos C = cos B, or 2 · 25−x · x 8x = x −7 =⇒ 24 √ √ 6x 2 2 2 4 2 2 2 (25 − x )(x + 7) = 16(x − 7) =⇒ x − 2x + 287 =⇒ x = 1 ± 12 2, so x = 1 + 12 2 is the only solution for this case.

11

OMO Fall 2016 Official Solutions Finally, if ` is parallel to the tangent to the circumcircle of ABC at A, then note that ∠AOG = 90◦ , where G is the centroid of ABC. Let R be the circumradius of ABC. It is well known that 2 2 2 2 2 +2c2 AG2 = −a +2b and OG2 = R2 − a +b9 +c . Hence, by the Pythagorean theorem we have that 9 2 2 2 2 2 +2c2 =⇒ b2 +c2 = 6R2 =⇒ R2 = 25 AO2 +OG2 = AG2 =⇒ R2 +R2 − a +b9 +c = −a +2b 9 6 . We just want to find the product of the possible lengths of the third side of a triangle with sides 4 and 3 and a fixed circumradius R. Suppose that those sides correspond to an inscribed arc of measure x and y respectively. Then, note that the third side can correspond to an inscribed arc of measure x−y or x+y. Then, their product is 2R sin(x+y)2R sin(x−y) = 4R2 sin(x+y) sin(x−y) = 2R2 (cos(2x)−cos(2y)) = 4R2 (sin2 x − sin2 y) = 42 − 32 = 7. √ √ The product of the squares of all solutions is 72 (1 + 12 2) = 49 + 588 2, so the answer is 10782. 23. Let N denote the set of positive integers. Let f : N → N be a function such that the following conditions hold: • For any n ∈ N, we have f (n)|n2016 . • For any a, b, c ∈ N satisfying a2 + b2 = c2 , we have f (a)f (b) = f (c). Over all possible functions f , determine the number of distinct values that can be achieved by f (2014)+ f (2) − f (2016). Proposed by Vincent Huang. Answer. 2035153 . Solution. Let P (x, y, z) denote the assertion that x2 + y 2 = z 2 and f (x)f (y) = f (z). Let a denote an odd positive integer and let k denote a positive integer. Note that f (1) = 1, and if a > 1,   2   2 2016  a2 − 1 a2 + 1 a +1 a +1 P a, , =⇒ f (a) | f | 2 2 2 2  2 2016 !  2016 a +1 a2 + 1 2016 =⇒ f (a) | gcd a , = gcd a, = 1, 2 2 so f (x) = 1 for all odd integers x. Then,    P 2k a, 22k−2 a2 − 1, 22k−2 a2 + 1 =⇒ f 2k a | f 22k−2 a2 + 1 .   If k > 1, then f 22k−2 a2 + 1 = 1 since 22k−2 a2 + 1 is odd, so f 2k a = 1, so f (x) = 1 for all integers x divisible by 4.   2016 2016  2016 If k = 1, then f (2a) | f a2 + 1 | a2 + 1 =⇒ f (2a) | gcd (2a)2016 , a2 + 1 = gcd 2a, a2 + 1 = 22016 . Hence, f (2a) ∈ {20 , 21 , 22 . . . , 22016 } for all odd a. Note that f (2) can be any of these 2017 values without affecting any of the other values of f since 2 is not a part of any Pythagorean triple. For all 0 ≤ i ≤ 2016, there exists a function f such that f (2014) = 2i , namely f (2a) = 2i for all odd a > 1. Thus, it suffices to find the number of values that can be achieved by 2x + 2y − 1 for integers 0 ≤ x, y ≤ 2016, which is just 2018 = 2035153. 2 24. Let P (x, y) be a polynomial such that degx (P ), degy (P ) ≤ 2020 and   i+j P (i, j) = i

12

OMO Fall 2016 Official Solutions over all 20212 ordered pairs (i, j) with 0 ≤ i, j ≤ 2020. Find the remainder when P (4040, 4040) is divided by 2017. Note: degx (P ) is the highest exponent of x in a nonzero term of P (x, y). degy (P ) is defined similarly. Proposed by Michael Ren. Answer. 1555 . Solution. Let n = 2020. Note that the polynomial is unique by solving a linear system of (n + 1)2 linearly independent equations in (n + 1)2 variables. We claim that             x y x y x y x y P (x, y) = + + + ... + 0 0 1 1 2 2 n n satisfies the condition. Indeed, note that P (i, j) =

n    X i j

k

k=0

because

 i k

= 0 for k > i and

 j k

k

min(i,j) 

=

X

k=0

i k

  j k

= 0 for k > j.

Without loss of generality, assume that i ≤ j. Then, we have that P (i, j) =

i    X i j

k

k=0

k

=

    i  X i j i+j = k−i k i

k=0

by Vandermonde’s identity, as desired. Hence, the answer is P (2n, 2n) =

2 n  X 2n k=0

k

=

n−1 X k=0

2n k



P2n   2 2n 2n k=0 + = 2n − k n

2n k



2n 2n−k

2



+

 2n 2 n

=

4n 2n



+ 2

 2n 2 n

by Vandermonde’s identity again. 2

2

Now, by Lucas’s Theorem, the answer is

4040 (8080 4040)+(2020)

2



2 6 (42)(12 6 )+[(1)(3)]

2

= 3572 ≡ 1555 (mod 2017)

25. Let X1 X2 X3 be a triangle with X1 X2 = 4, X2 X3 = 5, X3 X1 = 7, and centroid G. For all integers n ≥ 3, define the set Sn to be the set of n2 ordered pairs (i, j) such that 1 ≤ i ≤ n and 1 ≤ j ≤ n. Then, for each integer n ≥ 3, when given the points X1 , X2 , . . . , Xn , randomly choose an element (i, j) ∈ Sn and define Xn+1 to be the midpoint of Xi and Xj . The value of ∞ X



E Xi+4 G

i=0

 2

 i ! 3 4

m can be expressed in the form p + q ln 2 + r ln 3 for rational numbers p, q, r. Let |p| + |q| + |r| = for n relatively prime positive integers m and n. Compute 100m + n. Note: E(x) denotes the expected value of x. Proposed by Yang Liu. Answer. 932821 .

13

OMO Fall 2016 Official Solutions Solution. Without loss of generality, let the centroid G be at the origin, so G = 0 as a vector. Let En denote the expectation over all the choices of (i, j) ∈ Sm for 3 ≤ m ≤ n − 1. In other words, the points X1 , . . . , Xn have been chosen. Define an = En [E1≤i≤n [Xi2 ]] and bn = En [E1≤i≤n [Xi ]2 ]. A direct computation shows that a3 = 10 and b3 = 0. We now compute a recursion for an and bn . Note that

" 2 En+1 [Xn+1 ] = En E(i,j)∈Sn

"

Xi + Xj 2

2 ## =

1 1 a n + bn . 2 2

Therefore, 2 nan + En+1 [Xn+1 ] (2n + 1)an + bn = . n+1 2n + 2 We can do similarly computations for bn . We can compute " " 2 ## X1 + · · · + Xn + Xn+1 2 En+1 [E1≤i≤n+1 [Xi ] ] = En E(i,j)∈Sn . n+1

an+1 = En+1 [E1≤i≤n+1 [Xi2 ]] =

If we let Tn = X1 + . . . Xn , then the previous expression equals     2  1 1 (2n2 + 4n + 1)bn + an n+2 2 2 2 E E T + 2T X + X = E T + X n n n+1 n (i,j)∈Sn n n+1 n n+1 = 2 2 (n + 1) (n + 1) n 2(n + 1)2 2 as En [Xn+1 ] = 21 an + 12 bn as above and En [Tn2 ] = n2 bn by definition.

Our next claim is the explicit formulas for bn+1 − bn and an+1 − an for n ≥ 3. The formulas are     96 1 2(n + 1) 96 1 2(n + 1) an+1 − an = − and b − b = . n+1 n 7 4n+1 · n n + 1 7 4n+1 · n(n + 1) n + 1 Though the proof is messy, one can verify this by induction. The proof is omitted. Now, define 2 sn = En+1 [Xn+1 ] = 21 (an + bn ) for n ≥ 3, and otherwise, sn = 0. In particular, s3 = 21 a3 = 5. By the above,   2(n + 1) 1 48 . sn+1 − sn = − 7 4n+1 · (n + 1) n + 1 Our final step will be to compute the generating function       X X X 48 1 2(n + 3) sn+3 xn = (1−x)−1 5 + (sn+3 − sn+2 )xn  = (1−x)−1 5 − xn  . 7 4n+3 (n + 3) n + 3 n≥0

n≥1

n≥1

Let’s only deal with the innermost sum for now. Note that     Z X X 2(n + 3) n 1 1 2(n + 3) n+2 −3 x =x x dx, 4n+3 (n + 3) n + 3 4n+3 n+3 n≥1

n≥1

R

where the denotes an antiderivative (we will find the correct constant term later). Only dealing with  n P √1 , the antiderivative right now, and remembering that n≥0 41n 2n x = n 1−x Z X n≥1

    Z 2(n + 3) n+2 1 1 3 2 5 3 1 √ x dx = − 1 − x − x − x dx 4n+3 n+3 x 2 8 16 1−x 1

= C − 2 ln(1 +



1 3 5 1 − x) − x − x2 − x3 2 16 48 14

OMO Fall 2016 Official Solutions for some constant C. Note that substituting x = 0 should give a result of 0, so C = 2 ln 2. Substituting everything back into the original expression, !! √ 3 2 5 3 X x − 48 x 48 2 ln 2 − 2 ln(1 + 1 − x) − 12 x − 16 n −1 sn+3 x = (1 − x) 5− . 7 x3 n≥0

Substituting x =

3 4

gives us the final answer

1136 16384 8192 9328 − ln 2 + ln 3 =⇒ |p| + |q| + |r| = =⇒ 100m + n = 932821. 21 63 63 21

26. Let ABC be a triangle with BC = 9, CA = 8, and AB = 10. Let the incenter and incircle of ABC be I and γ, respectively, and let N be the midpoint of major arc BC of the cirucmcircle of ABC. Line N I meets the circumcircle of ABC a second time at P . Let the line through I perpendicular to AI meet segments AB, AC, and AP at C1 , B1 , and Q, respectively. Let B2 lie on segment CQ such that line B1 B2 is tangent to γ, and let C2 lie on segment BQ such that line C1 C2 tangent to γ. The length of B2 C2 can be expressed in the form m n for relatively prime positive integers m and n. Determine 100m + n. Proposed by Vincent Huang. Answer. 72163 . Solution. It is well known that (B1 C1 P ) is the A-mixtillinear circle ω of 4ABC, i.e. ω is tangent to AB, AC, and (ABC). Lemma 1: BC1 : B1 C = BP : CP . Proof: Let BP, CP meet ω at B3 , C3 . A homothety centered at P takes ω to (ABC) and B3 C3 to BC, so B3 C3 ||BC. Then BC12 : B1 C 2 = BB3 · BP : CC3 · CP = BP 2 : CP 2 , hence BC1 : B1 C = BP : CP . Now let N I meet BC at R, so that by the Angle Bisector Theorem on ∠BP C, BR : CR = BP : CP . Combining this with lemma 1, we know by the converse of Ceva that AR, BB1 , CC1 concur. Let Q0 be the projection of R onto B1 C1 and let B1 C1 , BC meet at S. Due to the concurrency (S, R; B, C) is harmonic, hence since ∠SQ0 R = 90◦ it’s well-known that Q0 R, Q0 S must bisect ∠BQ0 C. Then ∠CQ0 B1 = ∠BQ0 C1 , ∠BC1 Q0 = ∠CB1 Q0 , so 4BC1 Q0 ∼ 4CB1 Q0 , thus BQ0 : CQ0 = BC1 : CB1 = BP : CP . It’s clear that C1 Q : B1 Q = AC1 sin QAC: AB1 sin B1 AQ = sin BAP : sin CAP = BP : CP , hence Q = Q0 . Define X = BQ ∩ AC, Y = CQ ∩ AB. Then since QY, QC2 are reflections across B1 C1 , and it’s easy to see C1 C2 , AB are reflections, we see that C2 , Y are reflections across B1 C1 , and similarly X, B2 are reflections so B2 C2 = XY . It remains to compute some lengths. It’s known that ω is the image of γ under a homothety centered (s − a) b+c−a 2bc = = , and thus BC1 = at A with factor cos210.5A , so AB1 = AC1 = cos2 0.5A 1 + cos A a+b+c c(a+c−b) b(a+b−c) a+b+c , CB1 = a+b+c . Now from similar triangles Y BQ, XCQ we know that BY : CX = BC1 : B1 C = c(a+c−b) : b(a+b−c). From ∠XBY = ∠XCY we know BCXY is cyclic, hence AX · AC = AY · AB. Let k be the ratio of similarity between 4AXY, 4ABC so that BY = c − bk, CX = b − ck. Then using the ratio from 2abc 720 before, we can solve to deduce k = b2 +c22bc +ab+ac =⇒ B2 C2 = XY = ka = b2 +c2 +ab+ac which is 163 , yielding an answer of 72163 27. Compute the number of monic polynomials q(x) with integer coefficients of degree 12 such that there exists an integer polynomial p(x) satisfying q(x)p(x) = q(x2 ). Proposed by Yang Liu. 15

OMO Fall 2016 Official Solutions Answer. 569 . Solution. Notice that it is necessary and sufficient to have q(x)|q(x2 ) due to polynomial long division. n Now, if r is a root of q(x) then we easily find that r2 is as well. Thus r2 is a root of q for all positive n m n integers n, so since {r2 : n ∈ N} is a finite set so there are positive integers m 6= n with r2 = r2 . Therefore each root of q(x) is either zero or a root of unity. Now let

∞ Y

q(x) = xn

Φm (x)em ,

m=1

where n and the ei are nonnegative integers with n+

∞ X

em φ(m) = 12,

m=1

defining Φm to be the mth cyclotomic polynomial. Utilizing Φn (x2 ) = Φn (x)Φ2n (x) when n is odd and Φn (x2 ) = Φ2n (x) when n is even, we find that q(x)|q(x2 ) becomes ∞ ∞ ∞ Y Y Y e xn Φm (x)em x2n (Φ2k−1 (x)Φ4k−2 (x)) 2k−1 Φ4k (x)e2k . m=1

k=1

k=1

It follows that q(x)|q(x2 ) if and only if en ≥ e2n for all integers n. Therefore, if t is the largest non-negative integer for which xt |q(x), then we can break q(x)/xt uniquely up into products of the form κ2v m (x) = Φm (x)Φ2m (x) · · · Φ2v m (x), where m is odd. For instance, Φ3 (x)5 Φ6 (x)3 Φ12 (x)2 Φ24 (x) = κ24 (x)κ12 (x)κ6 (x)κ3 (x)2 . Let k2v m = deg κ2v m (x). Note that k2v m = 2v φ(m) if m is odd and v is a nonnegative integer, and that this degree must be at most 12. The only odd powers of primes n with φ(n) ≤ 12 are n = 3, 9, 5, 7, 11, 13, with φ(3) = 2, φ(9) = 6, φ(5) = 4, φ(7) = 6, φ(11) = 10, φ(13) = 12, hence it follows from φ(mn) = φ(m)φ(n) for relatively prime m, n, the only other odd n with φ(n) ≤ 12 are n = 1, 15, 21 with φ(1) = 1, φ(15) = 8, φ(21) = 12. Hence, k1 = 1, k2 = k3 = 2, k4 = k5 = k6 = 4, k7 = k9 = 6, k8 = k10 = k12 = k15 = 8, k11 = 10, and k13 = k14 = k18 = k21 = 12. It then becomes clear that the number of desired q(x) is just the coefficient of x12 in 1 , (1 − x)2 (1 − x2 )2 (1 − x4 )3 (1 − x6 )2 (1 − x8 )4 (1 − x10 )(1 − x12 )4 where the extra factor of 1 − x in the denominator accounts for the factor of xt in q(x). Now, it simply remains tbe above expression modulo x13] :

16

OMO Fall 2016 Official Solutions

1 (1 − − − − x6 )2 (1 − x8 )4 (1 − x10 )(1 − x12 )4 10 (1 + x )(1 + 4x12 ) (mod x13 ) ≡ (1 − x)2 (1 − x2 )2 (1 − x4 )3 (1 − x6 )2 (1 − x8 )4 (1 + 4x8 )(1 + x10 + 4x12 ) ≡ (mod x13 ) (1 − x)2 (1 − x2 )2 (1 − x4 )3 (1 − x6 )2 (1 + 2x6 + 3x12 )(1 + 4x8 + x10 + 4x12 ) (mod x13 ) ≡ (1 − x)2 (1 − x2 )2 (1 − x4 )3 (1 + 3x4 + 6x8 + 10x12 )(1 + 2x6 + 4x8 + x10 + 7x12 ) ≡ (mod x13 ) (1 − x)2 (1 − x2 )2 (1 + 2x2 + 3x4 + 4x6 + 5x8 + 6x10 + 7x12 )(1 + 3x4 + 2x6 + 10x8 + 7x10 + 29x12 ) ≡ (1 − x)2 1 + 2x2 + 6x4 + 12x6 + 28x8 + 51x10 + 103x12 (mod x13 ). ≡ (1 − x)2 x)2 (1

x2 )2 (1

x4 )3 (1

(mod x13 )

We wish to find the coefficient of x12 in the final expression. Since the numerator is an even polynomial, we just need to find [x12 ](1 + 3x2 + 5x4 + 7x6 + 9x8 + 11x10 + 13x12 )(1 + 2x2 + 6x4 + 12x6 + 28x8 + 51x10 + 103x12 ) =1 · 103 + 3 · 51 + 5 · 28 + 7 · 12 + 9 · 6 + 11 · 2 + 13 · 1 =569.

28. Let ABC be a triangle with AB = 34, BC = 25, and CA = 39. Let O, H, and ω be the circumcenter, orthocenter, and circumcircle of 4ABC, respectively. Let line AH meet ω a second time at A1 and let the reflection of H over the perpendicular bisector of BC be H1 . Suppose the line through O perpendicular to A1 O meets ω at two points Q and R with Q on minor arc AC and R on minor arc AB. Denote H as the hyperbola passing through A, B, C, H, H1 , and suppose HO meets H again at P . Let X, Y be points with XH k AR k Y P, XP k AQ k Y H. Let P1 , P2 be points on the tangent to H at P with XP1 k OH k Y P2 and let P3 , P4 be points on the tangent to H at H with XP3 k OH k Y P4 . If P1 P4 and P2 P3 meet at N , and ON may be written in the form ab where a, b are positive coprime integers, find 100a + b. Proposed by Vincent Huang. Answer. 43040 . Solution. Let D be on ω with AD||BC. Lemma 1: Given any points A0 , B 0 , C 0 , a hyperbola H0 through A0 , B 0 , C 0 is rectangular (has perpendicular asymptotes) if and only if H0 passes through the orthocenter H 0 of 4A0 B 0 C 0 . Proof: This is well-known, see Theorems 1 and 2 here: http://www.artofproblemsolving.com/ community/c2927h1273728_rectangular_circumhyperbolas.  By Lemma 1 on 4ABC, H is rectangular. By the converse of lemma 1 on 4BH1 C, since D is the orthocenter of 4DH1 C, we know H passes through D. Therefore the isogonal conjugate of H in 4ABC is line OD0 where D0 is the isogonal conjugate of D (so it is at infinity). It’s clear from the isogonality of AD, AD0 that OD0 is parallel to the A-tangent in ω. Then if OD0 meets ω at Q0 , R0 with Q0 on minor arc AB and R0 on minor arc AC, we know that Q0 R0 = OD0 ⊥ AO. Hence Q0 R0 , QR are symmetric in the perpendicular bisector of BC, meaning that AR, AR0 are isogonal, as are AQ, AQ0 in ∠BAC. Since Q0 , R0 are the isogonal conjugates of the points at infinity lying on H, it follows that AQ, AR are parallel to the asymptotes of H. 17

OMO Fall 2016 Official Solutions Next let U = ∞AR , V = ∞AQ . Define N 0 as the center of H. Let P10 = N 0 U ∩P P , P20 = N 0 V ∩P P, P30 = N 0 V ∩ HH, P40 = N 0 U ∩ HH. Let Z = P P ∩ HH. Lemma 2: P10 , X, P30 are collinear, as are P20 , Y, P40 . Proof: By Newton’s Theorem on quadrilateral N 0 P10 ZP30 with inscribed conic H we deduce that N 0 Z, P10 P30 , HU, P V concur at X. Similarly, N 0 Z, P20 P40 , HV, P U concur at Y . We also know that since N 0 Z passes through X, Y that N 0 XY Z is collinear.  Lemma 3: P10 P30 ||HP ||P20 P40 . Proof: First, note that the polar of P10 in H is P U , and similarly the polar of P30 in H is HV , hence the pole of P10 P30 is just P U ∩ HV = Y . Meanwhile, the pole of U V is N 0 , and the pole of P H is Z, Since Y, N 0 , Z are collinear from lemma 2, we know that U V, P H, P10 P30 concur at infinity, hence P10 P30 ||P H, and similarly P20 P40 ||HP , as desired.  By Lemmas 2 and 3, we know that P10 = P1 , P20 = P2 , P30 = P3 , P40 = P4 . Hence P1 P4 , P2 P3 meet at N = N 0 , the center of H. Let N1 be the midpoint of DH. Let HB , HC be the orthocenters of 4ADC, 4ADB. It’s well-known that N1 is the midpoint of AH1 , DH, BHB , CHC , and we know by lemma 1 on 4ADC, 4ADB that HB , HC ∈ H, hence the reflection of H about N1 has at least eight points in common with H, so they are the same hyperbola. Hence N = N1 is the center of the hyperbola. Now by homothety centered at D with ratio 2, if A2 is the foot of the altitude from A to BC, we 13 33 429 know N O = 0.5HA1 = HA2 . But HA2 = 2R cos B cos C = 2 · 1105 56 · 85 · 65 = 140 , hence the answer is 43040. 29. Let n be a positive integer. Yang the Saltant Sanguivorous Shearling is on the side of a very steep mountain that is embedded in the coordinate plane. There is a blood river along the line y = x, which Yang may reach but is not permitted to go above (i.e. Yang is allowed to be located at (2016, 2015) and (2016, 2016), but not at (2016, 2017)). Yang is currently located at (0, 0) and wishes to reach (n, 0). Yang is permitted only to make the following moves: • Yang may spring, which consists of going from a point (x, y) to the point (x, y + 1). • Yang may stroll, which consists of going from a point (x, y) to the point (x + 1, y). • Yang may sink, which consists of going from a point (x, y) to the point (x, y − 1). In addition, whenever Yang does a sink, he breaks his tiny little legs and may no longer do a spring at any time afterwards. Yang also expends a lot of energy doing a spring and gets bloodthirsty, so he must visit the blood river at least once afterwards to quench his bloodthirst. (So Yang may still spring while bloodthirsty, but he may not finish his journey while bloodthirsty.) Let there be an different ways for which Yang can reach (n, 0), given that Yang is permitted to pass by (n, 0) in the middle of his journey. Find the 2016th smallest positive integer n for which an ≡ 1 (mod 5). Proposed by James Lin. Answer. 475756 .  2k 1 Solution. Let Ck = k+1 k denote the kth Catalan number. If (k, k) is the lastpoint on Yang’s path where he is at the River, then there are Ck ways for Yang to reach (k, k), and nk ways for Yang to go   n X n from (k, k) to (n, 0). Hence, an = Ci . We will now use generating functions, with the aid of i i=0 two well-known lemmas: ∞   X n n xi • x = . i (1 − x)i+1 n=i √ ∞ X 1 − 1 − 4x n • Cn x = . 2x n=0 18

OMO Fall 2016 Official Solutions Now, notice that an is the coefficient of xn in ∞ X n X

  n n Ci x i n=0 i=0 ∞ ∞   X X n n = Ci x i i=0 n=i   ∞ X xi = Ci (1 − x)i+1 i=0  i ∞ 1 X x = Ci 1 − x i=0 1−x q 4x 1 − 1 − 1−x 1 = · 2x 1−x 1−x q 1 − 1−5x 1−x = 2x Note that an ≡ 1 (mod 5) exactly when the coefficient of xn+1 in

q

1−5x 1−x

is 3 (mod 5), where we note √ that all coefficients of this expression are integers since are integers. Note that 1 − 5x ≡ 1 q the ai ’s2n+2 ( ) 1 (mod 5), so it remains to compute when N = [xn+1 ] 1−x = 4n+1 is 3 (mod 5). n+1 Write the base 5 representation of n + 1 as bk bk−1 . . . b0 and the base 5 representation of 2n + 2 as cl cl−1 . . . c0 . If there is a 3 or 4 among bk , bk−1 , . . . , b0 ’s, then consider bi , the rightmost 3 or 4 in the the representation. Then, since there is no carryover when doubling any of bi−1 , bi−2 , . . . , b0 , it  follows  that ci ≡ 2bi (mod 5). But then ci < bi whether bi = 3 or bi = 4, so by Lucas’s Theorem, 5| cbii | 2n+2 n+1 , so N 6= 3 (mod 5) in this case.   Otherwise, k = l and bk , bk−1 , . . . , b0 ∈ {0, 1, 2}. Note that 00 ≡ 1 (mod 5), 21 ≡ 2 (mod 5), and   4 2n+2 ≡ 2t 2 ≡ 1 (mod 5). Hence, if there are t 1’s in the base 5-representation of n + 1, then n+1 n+1 t t (mod 5). Furthermore, note that n + 1 ≡ t (mod 2), so 4 ≡ 4 (mod 5) and thus N ≡ 3 (mod 5). Hence, an ≡ 1 (mod 5) if and only if n + 1 has only 0, 1, 2 in its base 5 representation, where the number of 1’s are 1 (mod 4).

It can easily be computed that the 2016th smallest integer is n + 1 = 1102110125 , n = 1102110115 = 475756. 30. Let P1 (x), P2 (x), . . . , Pn (x) be monic, non-constant polynomials with integer coefficients and let Q(x) be a polynomial with integer coefficients such that 2016

x2

+ x + 1 = P1 (x)P2 (x) . . . Pn (x) + 2Q(x).

Suppose that the maximum possible value of 2016n can be written in the form 2b1 + 2b2 + · · · + 2bk for nonnegative integers b1 < b2 < · · · < bk . Find the value of b1 + b2 + · · · + bk . Proposed by Michael Ren. Answer. 3977 . k

Solution. Let k = 2016. Working in F2 , we want to find the number of irreducible factors of x2 + m k k x + 1. First, we claim that x2 + x + 1 | x2 + x + 1 if and only if m is an odd integer. Note that 2m 2i 2m+i 2i 2m 2m+i 2i (x + x + 1) = x + x + 1 in F2 , so x + x + 1 | x + x + 1 for any positive integer i. m k k−m m k−m m k−m k−2m Now, x2 + x + 1 | x2 + x2 + 1, so x2 + x + 1 | x2 + x. Also, x2 + x + 1 | x2 + x2 + 1, 19

OMO Fall 2016 Official Solutions m

k−2m

so x2 + x + 1 | x2 + x + 1. Hence, we can reduce k mod 2m. Clearly, if k ≡ m (mod 2m) then the divisibility is true, so the if direction is proven. For the only if direction, assume that 0 ≤ k < 2m. k−m Clearly, k ≥ m or the degrees don’t work out. But then, we can reduce to x2 + x, so if k 6= m then we obtain another contradiction with degrees. k

m

Now, we claim that all irreducible factors of x2 + x + 1 either are of degree 2k or divide x2 + x + 1 k for some m < k. Suppose that z is a root of an irreducible factor of x2 + x + 1 that does not divide m k k x2 +x+1 for any m < k. Then, by the Frobenius endomorphism, z 2 = z+1 is also a root of x2 +x+1, k 2k k so z = (z + 1)2 = z 2 , so z is an element of F22k . Since z 2 = z + 1 6= z, z is not an element of F2k . k is an odd positive integer greater than Suppose that z is an element of F22m for some 2m | 2k and m k

2m

k−m

m

m

1 since z is not an element of F2k . However, this means that z + 1 = z 2 = (z 2 )2 2m · z 2 = z 2 , m so z is a root of x2 + x + 1, a contradiction. P ad = 2n . Note that we wish to compute To finish, we define the sequence a1 , a2 , . . . as n+d 2d ∈N  P  2016 12 k+d ∈N add . Note that a32 = 232 , a96 = 296 − 232 , a224 = 2224 − 232 , a288 = 2288 − 296 , 2d

672 672 288 96 a672 = − 2224 − 296 + 232 , and a2016 = 22016  2 2016  − 2 − 2 + 2 . The desired sum then becomes 672 288 224 96 32 2 2 + 2336 + 2336 + 168 + 256 2016 21 22016 + 1008 = 22015 + 2672 + 2289 + 2288 + 2225 + 2224 + 298 + 297 +

236 + 233 so the answer is 2015 + 672 + 289 + 288 + 225 + 224 + 98 + 97 + 36 + 33 = 3977.  P  P P d ϕ( n ) n 1 1 n d d Note: In general, the sum is 12 n ∈2Z+1 2d nd = 2n . n ∈2N−1 2 ϕ d = 2n d|n, d odd ϕ(d)2 d

d

20

d

The Online Math Open Spring Contest Official Solutions March 24 - April 4, 2017

Acknowledgements Tournament Director • James Lin

Head Problem Authors • Zack Chroman • Vincent Huang • Michael Ren • Ashwin Sah • Tristan Shin • Yannick Yao

Other Problem Contributors • Evan Chen • Yang Liu

Website Manager • Evan Chen • Douglas Chen

LATEX/Python Geek • Evan Chen

OMO Spring 2017 Official Solutions 1. Find the smallest positive integer that is relatively prime to each of 2, 20, 204, and 2048. Proposed by Yannick Yao. Answer. 1 . Solution. 1 is the smallest positive integer. 1 is also relatively prime to every positive integer. Therefore the answer is 1. 2. A positive integer n is called bad if it cannot be expressed as the product of two distinct positive integers greater than 1. Find the number of bad positive integers less than 100. Proposed by Michael Ren. Answer. 30 . Solution. If n is a prime number or 1, then it is certainly bad since it has no more than one factor greater than 1. If n = p2 for some prime p, then the only ways to express it as a product of integers greater than 1 is p · p, but the two numbers are not distinct. For all other cases of n, setting one factor to be the smallest prime divisor of n always work. Therefore, since there are 26 non-composites less than 100 (including 1) and 4 prime squares (22 , 32 , 52 , 72 ), there are 26 + 4 = 30 bad positive integers less than 100. 3. In rectangle ABCD, AB = 6 and BC = 16. Points P, Q are chosen on the interior of side AB such that AP = P Q = QB, and points R, S are chosen on the interior of side CD such that CR = RS = SD. Find the area of the region formed by the union of parallelograms AP CR and QBSD. Proposed by Yannick Yao. Answer. 56 . Solution. Suppose that AR and BS, BS and CP , CP and DQ, DQ and AR intersect at W, X, Y, Z respectively, then the quadrilateral W XY Z is a rhombus, where XZ = AP = AB 3 = 2 = P Q. This also implies that triangles P QY, XZY, ZXW, RSW are all congruent, and thus W Y = BC 2 = 8. The area of the union is therefore 2 · 16 · 2 − 2·8 = 56. 2 4. Lunasa, Merlin, and Lyrica each has an instrument. We know the following about the prices of their instruments: • If we raise the price of Lunasa’s violin by 50% and decrease the price of Merlin’s trumpet by 50%, the violin will be $50 more expensive than the trumpet; • If we raise the price of Merlin’s trumpet by 50% and decrease the price of Lyrica’s piano by 50%, the trumpet will be $50 more expensive than the piano. Given these conditions only, there exist integers m and n such that if we raise the price of Lunasa’s violin by m% and decrease the price of Lyrica’s piano by m%, the violin must be exactly $n more expensive than the piano. Find 100m + n. Proposed by Yannick Yao. Answer. 8080 . Solution. Let V, T, P be the original price of the violin, trumpet, and the piano. We have 1.5V − 50 = 0.5T and 1.5T − 50 = 0.5P , which gives 9V − 400 = P , and we want (1 + m%)V − n = (1 − m%)P for 1+m% all V and P satisfying the previous relation. This requires 1−m% = 9, and solving the equation gives 400 m = 80, and thus n = 9 (1 + m%) = 80. Therefore we get 100m + n = 8080. 1

OMO Spring 2017 Official Solutions 5. There are 15 (not necessarily distinct) integers chosen uniformly at random from the range from 0 to 999, inclusive. Yang then computes the sum of their units digits, while Michael computes the last three digits of their sum. The probability of them getting the same result is m n for relatively prime positive integers m, n. Find 100m + n. Proposed by Yannick Yao. Answer. 200 . Solution. Suppose the first 14 integers and the last digit of the 15th integer has already been determined, so Yang’s result is fixed and is less than 150, and is guaranteed to match Michael’s sum in its 1 unit digit. There’s a 100 probability that the first two digits of the 15th integer will make Michael’s result match Yang’s, so the answer is 100(1) + 100 = 200. 6. Let ABCDEF be a regular hexagon with side length 10 inscribed in a circle ω. X, Y , and Z are points on ω such that X is on minor arc AB, Y is on minor arc CD, and Z is on minor arc EF , where X may coincide with A or B (And similarly for Y and Z). Compute the square of the smallest possible area of XY Z. Proposed by Michael Ren. Answer. 7500 . Solution. Suppose that O is the center of ω, and WLOG suppose that A, B, C, D, E, F are labeled clockwise. Let segments OX, OY, OZ intersect segments AB, CD, EF at X 0 , Y 0 , Z 0 respectively. Since none of ∠XOY, ∠Y OZ, ∠ZOX exceeds 180 degrees (when measured from X to Y to Z to X in clockwise direction), X 0 , Y 0 , Z 0 lie on the boundary or interior of XY Z and thus [X 0 Y 0 Z 0 ] ≤ [XY Z]. When two of X 0 , Y 0 , Z 0 are fixed, one can always slide the third point to an endpoint of the segment without increasing the area, which means that in order to minimize the area of X 0 Y 0 Z 0 , one can assume that all three vertices are vertices of the hexagon. Such√triangles take on one of two forms: one is √ √ √ an equilateral triangle with side lengths 10 3 and area 43 (10 3)2 = 75 3, and the other is a right √ √ √ triangle with side lengths 10, 10 3, 20 and area 21 (10)(10 3) = 50 3. Obviously the second one is √ smaller; therefore the minimum area of X 0 Y 0 Z 0 is 50 3 and consequently that is also the √ minimum area of XY Z, achieved when X = X 0 = A, Y = Y 0 = C, Z = Z 0 = D. So the answer is (50 3)2 = 7500. 7. Let S be the set of all positive integers between 1 and 2017, inclusive. Suppose that the least common L multiple of all elements in S is L. Find the number of elements in S that do not divide 2016 . Proposed by Yannick Yao. Answer. 44 . Solution. Since the highest powers of 2, 3, 7 below 2017 are 210 , 36 , 73 respectively, the highest powers L of 2, 3, 7 dividing 2016 are 210−5 = 25 , 36−2 = 34 , 73−1 = 72 respectively. Therefore, those that do L not divide 2016 must be a multiple of 26 = 64, 35 = 243, or 73 = 343. Since a number between 1 and 2017 cannot be a multiple of two of the three numbers, we only need to count the 31 multiples of 64, 8 multiples of 243, and 5 multiples of 343, for 31 + 8 + 5 = 44 numbers in total. 8. A five-digit positive integer is called k-phobic if no matter how one chooses to alter at most four of the digits, the resulting number (after disregarding any leading zeroes) will not be a multiple of k. Find the smallest positive integer value of k such that there exists a k-phobic number. Proposed by Yannick Yao. Answer. 11112 .

2

OMO Spring 2017 Official Solutions Solution. When k ≤ 10000, each of the intervals [10000, 19999], [20000, 29999], . . . , [90000, 99999] contains a multiple of 9 since each interval contains 10000 consecutive integers. When 10000 < k ≤ 11111, these intervals contain k, 2k, . . . , 9k respectively. Therefore, for any k ≤ 11111, there exists a multiple of k with any leading digit, so there does not exist a k-phobic number since one can keep the leading digit and change the rest to have a multiple of k. When k = 11112, the only multiples in range are 00000, 11112, 22224, 33336, 44448, 55560, 66672, 77784, 88896, so we can see that 99959 is a 11112-phobic number, so 11112 is the smallest number that satisfies the condition. 9. Kevin is trying to solve an economics question which has six steps. At each step, he has a probability p of making a sign error. Let q be the probability that Kevin makes an even number of sign errors (thus answering the question correctly!). For how many values of 0 ≤ p ≤ 1 is it true that p + q = 1? Proposed by Evan Chen. Answer. 2 .     Solution. Let (a, b) = (p, 1 − p). Then the desired probability is 60 a6 + 62 a4 b2 + 64 a2 b4 + 66 b6 =   1 6 6 = 12 1 + (2p − 1)6 . Setting this equal to 1 − p gives (2p − 1)6 = 1 − 2p, which 2 (a + b) + (a − b) 1 has p = 2 , p = 0 as real solutions. 10. When Cirno walks into her perfect math class today, she sees a polynomial P (x) = 1 (of degree 0) on the blackboard. As her teacher explains, for her pop quiz today, she will have to perform one of the two actions every minute: • Add a monomial to P (x) so that the degree of P increases by 1 and P remains monic; • Replace the current polynomial P (x) by P (x + 1). For example, if the current polynomial is x2 + 2x + 3, then she will change it to (x + 1)2 + 2(x + 1) + 3 = x2 + 4x + 6. Her score for the pop quiz is the sum of coefficients of the polynomial at the end of 9 minutes. Given that Cirno (miraculously) doesn’t make any mistakes in performing the actions, what is the maximum score that she can get? Proposed by Yannick Yao. Answer. 5461 . Solution. Notice that the sum of coefficients is simply P (1). Call the two actions type-(i) and type(ii) respectively. It is not difficult to see that doing a type-(i) action on a degree-(n − 1) polynomial simply means adding the term xn . Suppose that an xn term is added before m type-(ii) actions, then this term will contribute (m + 1)n to the value of P (1). Therefore, among all strategies with k type-(i) actions and 9 − k type-(ii) actions, the optimal one will have all the type-(i) actions precede k+1 −1 the type-(ii) actions, and the maximal sum is (10 − k)0 + (10 − k)1 + · · · + (10 − k)k = (10−k) , 9−k and we want to maximize this value over k = 0, 1, . . . , 9. When k = 0, 1, . . . , 8, the value of the RHS is equal to 1, 10, 73, 400, 1555, 3906, 5461, 3280, 511 respectively. (Note that when k = 9, the value of the expression is 10 even though the RHS is not defined.) Therefore Cirno can get at most 5461 points for her pop quiz. 11. Let a1 , a2 , a3 , a4 be integers with distinct absolute values. In the coordinate plane, let A1 = (a1 , a21 ), A2 = (a2 , a22 ), A3 = (a3 , a23 ) and A4 = (a4 , a24 ). Assume that lines A1 A2 and A3 A4 intersect on the m y-axis at an acute angle of θ. The maximum possible value for tan θ can be expressed in the form n for relative prime positive integers m and n. Find 100m + n. Proposed by James Lin. Answer. 503 . 3

OMO Spring 2017 Official Solutions Solution. Consider two cases: Case 1: the two lines intersect on the positive y-axis. Without loss of generality, assume that a1 < a3 < 0 < a2 < a4 , and let p = −a1 , q = a2 , r = −a3 , s = a4 . It is not difficult to see that the line v 2 −u2 through (−u, u2 ) and (v, v 2 ) has slope v−(−u) = v − u, and intersect the y-axis at the point (0, uv), which implies that pq = rs. If both (or neither) of p < q and r < s are true, then both lines have positive (or negative) slopes, which means that θ < 45◦ . Otherwise, we assume p > q and r < s, and therefore θ = 180◦ − tan−1 (p − q) − tan−1 (s − r). Since tan−1 (1) = 45◦ and thus θ < 90◦ , we should make both p − q and s − r as small as possible. Since p, q, r, s are all distinct, it is not difficult to see that |(p − q) − (s − r)| ≥ 2. Moreover, we can make one of them 1 and the other 4 by setting (p, q, r, s) = (6, 2, 3, 4) (and θ > 45◦ ), but (p − q, s − r) = (1, 3) or (3, 1) is impossible since it would imply that p, q, r, s are consecutive integers in some order, which 1+4 = 53 . cannot satisfy pq = rs. Therefore, the maximum possible value of tan θ in this case is − 1−1·4 Case 2: the two lines intersect on the non-positive y-axis. In this case, we can see that all four points lie on the same side of y-axis, and so the slopes of both lines are both integers and have the same sign, and thus θ < 45◦ , which we need not consider since we have already found a bigger θ. Therefore, the maximum possible value of tan θ is 35 , and the answer is 503. 12. Alice has an isosceles triangle M0 N0 P , where M0 P = N0 P and ∠M0 P N0 = α◦ . (The angle is measured in degrees.) Given a triangle Mi Nj P for nonnegative integers i and j, Alice may perform one of two elongations: −−→ • an M -elongation, where she extends ray P Mi to a point Mi+1 where Mi Mi+1 = Mi Nj and then removes the point Mi . −−→ • an N -elongation, where she extends ray P Nj to a point Nj+1 where Nj Nj+1 = Mi Nj and then removes the point Nj . After a series of 5 elongations, k of which were M -elongations, Alice finds that triangle Mk N5−k P is an isosceles triangle. Given that 10α is an integer, compute 10α. Proposed by Yannick Yao. Answer. 264 .

∠Mi+1 =

∠Mi ∠Nj

m n . After one M -elongation, we see that m/2 m m i+1 ∠Mi /2 and ∠Nj0 = ∠Nj + ∠Mi /2, which means that ∠M ∠Nj0 = n+m/2 = 2n+m = n+(n+m) . one N -elongation will change the ratio to m+(m+n) . Notice that since initially the ratio is 11 , n

Solution. For each triangle P Mi Nj , consider the ratio

=

Similarly, and each elongation will double the sum of numerator and denominator, the sum of the numerator and denominator after t elongations is 2t+1 (and since both numerator and denominator are odd, this also implies that they will always be relatively prime). Moreover, if we express both m and n in binary, the t-th elongation will add a 1 at the (t + 1) − th digit from the right on either m or n. It is not difficult to see that any pair of (m, n) that are both odd with sum 2t+1 is achievable with some combinations of M - and N - elongations. After 5 elongations, the sum of the numerator and denominator is 26 = 64, and since the final triangle is isosceles, ∠P must be equal to one of the other two angles (since m 6= n starting with the first elogation, ∠Mi 6= ∠Nj ). Therefore, the sum of 64 and one of the m and n needs to be an odd factor of 10 · 180 = 1800, and since this sum is between 64 + 1 = 65 and 64 + 63 = 127, the only possibility is 64 + 11 = 75, achieved when (m, n) = (11, 53) or (53, 11). Thus we can see that the desired ratio is 11 α = 180 · 75 = 26.4 and therefore 10α = 264. 4

OMO Spring 2017 Official Solutions 13. On a real number line, the points 1, 2, 3, . . . , 11 are marked. A grasshopper starts at point 1, then jumps to each of the other 10 marked points in some order so that no point is visited twice, before returning to point 1. The maximal length that he could have jumped in total is L, and there are N possible ways to achieve this maximum. Compute L + N . Proposed by Yannick Yao. Answer. 28860 . Solution. It’s not difficult to see that the longest length is L = 2+4+6+8+10+10+8+6+4+2 = 60, by counting the maximal number of times each unit segment gets covered. Moreover, one can show that each jump must either jump from one of the first 5 points to the last 5 points, or vice versa, or jumping to/from point 6. (The point before and after 6 must also belong to different sides). Using this, we may ultimately compute that the number of ways is N = 2(5!)2 = 28800. Therefore the answer is N + L = 28860. 14. Let ABC be a triangle, not right-angled, with positive integer angle measures (in degrees) and circumcenter O. Say that a triangle ABC is good if the following three conditions hold: • There exists a point P 6= A on side AB such that the circumcircle of 4P OA is tangent to BO. • There exists a point Q 6= A on side AC such that the circumcircle of 4QOA is tangent to CO. • The perimeter of 4AP Q is at least AB + AC. Determine the number of ordered triples (∠A, ∠B, ∠C) for which 4ABC is good. Proposed by Vincent Huang. Answer. 59 . Solution. The first two conditions imply that ∠OBP = ∠BAO = ∠P OB, which means that BP O is similar to triangle BOA, and analogously triangle CQO is similar to COA. This requires that AB, AC > R or equivalently, ∠B, ∠C > 30◦ . We can also see that BP = P O and similarly CQ = QO. Therefore AB +AC = AP +P O+QO+AQ ≥ AP + P Q + AQ, so ABC is good if and only if equality holds, i.e. P, O, Q are collinear in that order. In particular, O is on or inside triangle ABC so ABC is acute or right. But collinearity in this order occurs if and only if ∠P OB + ∠BOC + ∠COQ = 180◦ , i.e. (90◦ − ∠C) + 2∠A + (90◦ − ∠B) = 180◦ , which is equivalent to ∠A = 60◦ . Since ∠B, ∠C > 30◦ , ∠B can range from 31◦ to 89◦ , resulting in 59 good triangles. 15. Let φ(n) denote the number of positive integers less than or equal to n which are relatively prime to n. Over all integers 1 ≤ n ≤ 100, find the maximum value of φ(n2 + 2n) − φ(n2 ). Proposed by Vincent Huang. Answer. 72 . Solution. It’s well known that φ(n2 ) = nφ(n). When n is odd, φ(n2 + 2n) = φ(n)φ(n + 2), and when n is even, φ(n2 + 2n) = 2φ(n)φ(n + 2). Let f (n) = φ(n2 + 2n) − φ(n2 ). Then when n is even, f (n) = φ(n)[2φ(n + 2) − n]. Since n + 2 is even, φ(n + 2) ≤ n+2 2 with equality if and only if n + 2 is a power of 2. When n + 2 is not a power of 2, then f (n) ≤ 0. When n + 2 is a power of 2, f (n) = 2φ(n) ≤ n. Since n + 2 ≤ 102, the largest power of 2 that n + 2 can obtain is 64, giving f (n) ≤ 62. When n is odd, f (n) = φ(n)[φ(n + 2) − n]. Note that φ(n + 2) ≤ n + 1 with equality if and only if n + 2 is a prime. When n + 2 is not a prime, then f (n) ≤ 0. When n + 2 is a prime, f (n) = φ(n) ≤ n. 5

OMO Spring 2017 Official Solutions Note that when n + 2 = 101, 97, 89, 83, 79, we get that f (n) = 60, 72, 56, 54, 60, respectively. Otherwise, n + 2 ≤ 73 =⇒ f (n) ≤ 71. Hence the maximum value of f (n) is achieved when n = 95, giving an answer of 72. 16. Let S denote the set of subsets of {1, 2, . . . , 2017}. For two sets A and B of integers, define A ◦ B as the symmetric difference of A and B. (In other words, A ◦ B is the set of integers that are an element of exactly one of A and B.) Let N be the number of functions f : S → S such that f (A◦B) = f (A)◦f (B) for all A, B ∈ S. Find the remainder when N is divided by 1000. Proposed by Michael Ren. Answer. 112 . Solution. Consider each element A of S as a 2017-dimensional vector vA with entries in F2 , such that the ith entry of vA equal to 1 if i ∈ A and 0 otherwise. Define wA similarly with respect to f (A). Note that we have the condition wA+B = wA◦B = wA ◦ wB = wA + wB , so the problem now becomes determining the number of linear maps on F2017 . By setting A = B = ∅, we have w∅ = w∅+∅ = 2 w∅ + w∅ = 0, so the empty set must map to itself. Moreover, the vectors v{1} , v{2} , . . . , v{2017} are the basis of F2017 , so one can assign each of w{1} , w{2} , . . . , w{2017} to any one of the 22017 vectors which also 2 2 determines all other mappings consistently (because of linearity). Thus there are (22017 )2017 = 22017 2 possible functions, and we can reduce 22017 ≡ 289 ≡ (27 )12 · 25 ≡ 312 · 32 ≡ 112 (mod 125) and thus 2 22017 ≡ 112 (mod 1000). A more combinatorial way to phrase this solution would be to note that empty set must go to empty set by setting A and B to be the empty set and that setting the outputs of {1}, {2}, . . . , {2017} uniquely determines the entire function. 17. Let ABC be a triangle with BC = 7, AB = 5, and AC = 8. Let M, N be the midpoints of sides AC, AB respectively, and let O be the circumcenter of ABC. Let BO, CO meet AC, AB at P and Q, respectively. If M N meets P Q at R and OR meets BC at S, then the value of OS 2 can be written in the form m n where m, n are relatively prime positive integers. Find 100m + n. Proposed by Vincent Huang. Answer. 240607 . Solution. By the Law of Cosines, ∠A = 60◦ . Since ∠BOC = 120◦ = 180◦ − A we know A, P, O, Q are concyclic. Then the Simson line of O with respect to triangle AP Q must be line M N , which meets P Q at R, implying OR ⊥ P Q. Now define S 0 as the point on BC with B, S 0 , O, Q concyclic. By Miquel’s Theorem on triangle ABC and points S 0 , P, Q, we know that C, P, O, S 0 are concyclic as well. It’s easy to see ∠QS 0 O = ∠QBO = ∠OAQ = ∠OP Q = 90◦ − ∠C and similarly we deduce 90◦ − ∠B = ∠P QO = ∠P S 0 O, implying O is the orthocenter of triangle P QS 0 , hence OS 0 ⊥ P Q. Therefore S 0 = S. Furthermore, from the angle-chasing we know that 4SP Q ∼ 4ABC. Let H be the orthocenter of 4ABC. Since ∠A = 60◦ it’s well-known and easy to prove that AH = AO. Therefore by the similarity, OS is equal to the circumradius of 4P QS. Let R, R0 be the circumradii of triangles ABC, P OQ. Since O is the orthocenter of P QS we know that (P OQ), (P SQ) are congruent, so it suffices to find the circumradius of (AP OQ). By the Law of Sines in 4AP O, we know that R = AO = 2R0 sin ∠AP O = 2R0 sin(C + 30◦ ). √ √ 11 By standard methods we can compute [ABC] = 10 3, R = √73 , cos C = 14 , sin C = 5143 , so it’s not hard to find OS 2 = 2401 507 , yielding an answer of 240607.

6

OMO Spring 2017 Official Solutions 18. Let p be an odd prime number less than 105 . Granite and Pomegranate play a game. First, Granite picks a integer c ∈ {2, 3, . . . , p − 1}. Pomegranate then picks two integers d and x, defines f (t) = ct + d, and writes x on a sheet of paper. Next, Granite writes f (x) on the paper, Pomegranate writes f (f (x)), Granite writes f (f (f (x))), and so on, with the players taking turns writing. The game ends when two numbers appear on the paper whose difference is a multiple of p, and the player who wrote the most recent number wins. Find the sum of all p for which Pomegranate has a winning strategy. Proposed by Yang Liu. Answer. 65819 . Solution. Let’s say that c, d are already  chosen. Let f0 be the sequence defined by f0 = x and d d fi+1 = cfi + d. Then fi = − c−1 + x + c−1 · ci . To prevent losing, Pomegranate would of course first d choose and x 6= − c−1 . (Or else fi is a constant sequence).

Otherwise, the sequence fi repeats with period equal to ordp (c). So for Granite to win, he needs ordp (c) to be odd. Since p > c > 1 (a condition), we need for p − 1 to have an odd factor > 1. This happens unless p is a Fermat prime. So the sum of all possible primes is 3 + 5 + 17 + 257 + 65537 = 65819. 19. For each integer 1 ≤ j ≤ 2017, let Sj denote the set of integers 0 ≤ i ≤ 22017 − 1 such that an odd integer. Let P be a polynomial such that  Y

P (x0 , x1 , . . . , x22017 −1 ) =



i 2j−1



is



1 −

Y

xi  .

i∈Sj

1≤j≤2017

Compute the remainder when X

P (x0 , . . . , x22017 −1 ) ∈{0,1}22017

(x0 ,...,x22017 −1 ) is divided by 2017. Proposed by Ashwin Sah. Answer. 1840 .

Solution. First of all, the set Sj is exactly the set of all integers in [0, 22017 − 1] whose j-th rightmost digit in binary is odd. The value of P is equal to 1 if and only if for each j, there is at least one integer i ∈ Sj such that xi = 0. If we consider a bijection between all the integers in [0, 22017 − 1] with the set of all subsets T0 , T1 , . . . , T22017 −1 of T = {1, 2, . . . , 2017} such that j ∈ Ti if and only if i ∈ Sj , and consider each tuple (x0 , x1 , . . . , x22017 −1 ) as a way of choosing a subset of {T0 , T1 , . . . , T22017 −1 } (where 0 correspond to chosen and 1 correspond to not chosen), then for P to be equal to 1, the union of these chosen subsets must be equal to T itself. Therefore it suffices to count the number of ways to pick such a collection of subsets. The number of ways to pick a collection of subsets whose union is a subset of a fixed (2017 − s)-element  22017−s P2017 2017−s 2 ≡ subset is equal to 22 . So by PIE, we find that the number of ways is s=0 (−1)s 2017 s 22017 2017 7 27 2 −2 (mod 2017). We notice 2 ≡ 2 (mod 2016) so that we find 2 −2 ≡ 1840 (mod 2017). 20. Let n be a fixed positive integer. For integer m satisfying |m| ≤ n, define Sm =

X i−j=m 0≤i,j≤n

2 2 lim S−n + S−n+1 + ... + Sn2

n→∞

7



1 2i+j

. Then

OMO Spring 2017 Official Solutions can be expressed in the form

p for relatively prime positive integers p, q. Compute 100p + q. q

Proposed by Vincent Huang. Answer. 8027 . Solution. Let ai = an a1 )2 + (an a0 )2 .

1 . We wish to consider the expression (a0 an )2 +(a0 an−1 +a1 an )2 +...+(an−1 a0 + 2i

Each parenthesis Xconsists of terms of the form ai aj with i − j fixed. So if we expand, we get something of the form ai aj ak al . The key observation is that we can also write this sum in the form i−j=k−l

X

ai aj ak al , and grouping these terms by the value of i + l = j + k, the expression becomes

i+l=j+k

(a0 a0 )2 + (a0 a1 + a1 a0 )2 + ... + (an−1 an + an an−1 )2 + (an an )2 = (n − 1)2 1 + ... + 2n . n+2 4 4 As n approaches infinity, this sum approaches

X (i + 1)2 i≥0

4i

4 (n + 1)2 n2 1 + 1 + ... + + n+1 + 0 n 4 4 4 4

, which evaluates to

80 by standard methods, 27

so the answer is 8027. 21. Let Z≥0 be the set of nonnegative integers. Let f : Z≥0 → Z≥0 be a function such that, for all a, b ∈ Z≥0 : f (a)2 + f (b)2 + f (a + b)2 = 1 + 2f (a)f (b)f (a + b). Furthermore, suppose there exists n ∈ Z≥0 such that f (n) = 577. Let S be the sum of all possible values of f (2017). Find the remainder when S is divided by 2017. Proposed by Zack Chroman. Answer. 1191 . Solution. Note that P (0, 0) =⇒ f (0) = 1. Then, letting f (1) = k, P (1, m) =⇒ f (m + 1)2 − 2kf (m)f (m + 1) = 1 − k 2 − f (m)2 . By P (1, m − 1), this quadratic is satisfied by f (m − 1), so either f (m + 1) = f (m − 1) or f (m + 1) = 2kf (m) − f (m − 1). If f (2) = 1, f (3) is k in both cases, and iterating this we see that the function goes 1, k, 1, k, 1, k, . . . . It turns out this function works, so we can have f (2017) = 577 by taking k = 577. Otherwise, we have f (2) = 2k 2 − 1. Then, f (3) ∈ {k, 4k 3 − 3k}. If f (3) = k, f (4) is one of 2k 2 − 1 and 1. However, P (2, 2) =⇒ f (4) = 1 or f (4) = 2f (2)2 − 1 = 8k 4 − 8k 2 + 1. If this is also 2k 2 − 1, solving the resulting quadratic gives k = ±1, but then f (2) = 1 which puts us back in the first case. Then we take f (4) = 1. Then we immediately get f (5) = f (3) = k, and P (4, 2) tells us that f (6) = 2k 2 − 1, not 1. In general, we get f repeats the sequence {1, k, 2k 2 − 1, k}. Noting that 577 = 2 · 172 − 1, and 2017 ≡ 3 (mod 4), this gives the possible value of 17 for f (2017). In the final case, we take f (3) = 4k 3 − 3k. I claim that from here on out, f (n) is defined as f (n) = 2kf (n − 1) − f (n − 2). This is clear upon computing P (1, n − 1) − P (2, n − 2), which is linear in f (n). It remains to determine which of these sequences 577 belongs to. We already know that k = 17 works, and clearly k = 577 works. It turns√out f (4) = 577 when k = 3, and these are all the cases. Noting √ that f (n) = 21 (3 + 2 2)n + (3 − 2 2)n gives f (2017) ≡ 3 (mod 2017), and similarly when k = 17 and k = 577, f (2017) ≡ 17 (mod 2017) and f (2017) ≡ 577 (mod 2017) respectively. But in this case f (2017) 6= 17 or 577, so they need to be included separately. The sum of all answers modulo 2017 is 577 + 17 + (3 + 17 + 577) = 1191. 8

OMO Spring 2017 Official Solutions 22. Let S = {(x, y) | −1 ≤ xy ≤ 1} be a subset of the real coordinate plane. If the smallest real number that is greater than or equal to the area of any triangle whose interior lies entirely in S is A, compute the greatest integer not exceeding 1000A. Proposed by Yannick Yao. Answer. 5828 . Solution. It is clear that the boundary of S is composed of two hyperbolas, namely xy = 1 and xy = −1. For ease of reference, we call the four branches of the two hyperbolas by the quadrant number they lie in (i.e. branch 1, branch 2, etc.). Note that the affine transformation (x, y) → (kx, y/k) preserves both hyperbola and any area for any positive number k. Also note that the triangle with maximal area necessarily has at least one side tangent to the boundary of S (otherwise we would have three vertices on three different branches, and we could always slide one of them away from the opposite side, increasing the area until one side is tangent), so we may assume that the side is tangent at T (1, 1) (after rotation and the aforementioned transformation). √ √ √ √ The line x + y = 2 intersects branch 2 and 4 at points P (1 − 2, 1 + 2) and Q(1 + 2, 1 − 2) respectively, and if we let R = (−1, −1), we may see that P R and QR are also tangent to branch 2 and branch 4 at P and Q respectively. From this, we may deduce that if we choose P 0 on the interior of P T and Q0 on the interior of QT , then the tangent line to branch 2 through P 0 and the tangent line to branch 4 through Q0 always intersect outside S (in Quadrant 3). As a result, we can always choose a point R0 on branch 3 such that either R0 P 0 is tangent to branch 2 or R0 Q0 is tangent to branch 4. WLOG assume the former case is true, then we can make sure that R0 is to the left of R, and so either (1) we can move Q0 to Q and get a larger area, or (2) in the process of doing (1), we got stuck at a point where R0 Q0 is tangent to branch 3. We show that (2) is impossible. In fact, if we do the affine transformation to make the tangent point on branch 2 (−1, 1), then similar to the argument in the preceeding paragraph, we can show that Q0 needs to be outside S since it’s the intersection of two tangent lines, which contradicts the assumption of (2) itself. Therefore, a maximal triangle necessarily have two vertices on the adjacent branches. With this in mind, we restart and WLOG let these two vertices be A(a, 1/a) (on branch 1) and √ B(b, −1/b) (on 2 1 branch 4). Notice that the tangent line to branch 4 through A has equation y = 3+2 a2 (x − a) + a , √ √ √ which intersects branch 4 at (( 2 − 1)a, −( 2 + 1)/a), implying that ab ≥ 2 − 1. Similarly we can √ √ 2 +b2 show that ab ≥ 2 − 1. Therefore, we have a ab = ab + ab ∈ [2, 2 2]. It is obvious that the maximal triangle when points A and B are fixed has the third vertex C being the intersection of the line tangent to branch 2 through A and the line tangent to branch 3 through B. (If we place C to the right of AB where AC and BC are tangent to branch 1 and branch 4 respectively, then we may extend rays CA and CB to intersect branch 2 and branch 3 at A0 and B 0 respectively √ 3−2 2 and get a larger area.) Since the equations of the two tangent lines are y = a2 (x − a) + a1 and √ 2 (x − b) − 1b , we get that the intersection is y = −3+2 b2 √ ab(a + b) √ b−a C = (−(2 + 2 2) 2 , (2 − 2 2) 2 ). 2 a +b a + b2 And the area is equal to √ 1 1 1 a2 + b2 8ab 1 ((b − xC )( − yC ) − (a − xC )(− − yC )) = ( + 2 2). + 4 2 a b 2 ab a + b2 Due to the result we established in the previous paragraph, it is not difficult to see that√the right-hand √ 2 +b2 side is maximized when a ab = 2, or when a = b, and the maximum is 21 (2 + 82 + 4 2) = 3 + 2 2. This maximum √ can be achieved√with the triangle whose vertices are at A = (1, 1), B = (1, −1), and C = (−2 − 2 2, 0). Since 3 + 2 2 ≈ 5.8284, the final answer is 5828. 9

OMO Spring 2017 Official Solutions 23. Determine the number of ordered quintuples (a, b, c, d, e) of integers with 0 ≤ a < b < c < d < e ≤ 30 for which there exist polynomials Q(x) and R(x) with integer coefficients such that xa + xb + xc + xd + xe = Q(x)(x5 + x4 + x2 + x + 1) + 2R(x). Proposed by Michael Ren. Answer. 5208 . Solution. Work in F2 . First, we claim that x5 + x4 + x2 + x + 1 is irreducible. If it were reducible, it would have to be divisible by an irreducible polynomial of degree 1 or 2. Thus, we only have to consider divisibility by x, x + 1, and x2 + x + 1. But x5 + x4 + x2 + x + 1 = x(x + 1)2 (x2 + x + 1) + 1, so it is not divisible by any of those, as desired. Now consider a root z of x5 + x4 + x2 + x + 1. Since x5 + x4 + x2 + x + 1 is irreducible, z is an element of F32 . Note that the order of a nonzero element of F32 divides 31, so it is either 1 or 31. Since the only element with order 1 is 1, z must have order 31, which means that it is a primitive root in F32 . Hence, 1, z, z 2 , . . . , z 30 are the nonzero elements of F32 . Furthermore, x5 +x4 +x2 +x+1 | xa +xb +xc +xd +xe if and only if z a + z b + z c + z d + z e = 0. Hence, we just want to find the number of ways 5 distinct elements of F32 can add to 0. We will first suppose that they are ordered and divide by 5! at the end. Note that we can just choose 4 random distinct elements and the fifth will be uniquely determined (it is actually their sum). This results in 31 · 30 · 29 · 28 ways. The only catch is that the fifth element might be the same as one of the first four or 0. To resolve this, we first count the number of ways 3 distinct elements of F32 can add to 0. By choosing 2 random distinct elements and taking their sum as the third, we have that there are 31 · 30 ways. It is not possible for their sum to be equal to one of them, because that implies that the other is 0. Now, the number of overcounted quintuples is simply 31 · 30 · 4 · 28, since there are 4 ways to choose three of the first four entries to sum to 0 and 28 ways to choose the element for the remaining entry and the last entry. Also, note that the number of ways for four elements to sum to 0 is 31 · 30 · 29 − 31 · 30 by a similar argument to what we had before. Hence, our answer is 31·30·29·28−31·30·4·28−31·30·29+31·30 = 31·30·24·28 = 5208. 5! 120 24. For any positive integer n, let Sn denote the set of positive integers which cannot be written in the form an + 2017b for nonnegative integers a and b. Let An denote the average of the elements of Sn if the cardinality of Sn is positive and finite, and 0 otherwise. Compute $∞ % X An . 2n n=1 Proposed by Tristan Shin. Answer. 840 . Solution. Let m = 2017. It is clear that An > 0 if and only if (m, n) = 1 and n ≥ 2. Now, fix n that works. I first claim that an integer k is not in Sn if and only if we can express k = xm + yn with x, y ∈ N0 and x ≤ n − 1. The if direction  is trivial. Assume that the only if direction is false. Take k = x0 m + y0 n with x0 ≥ n and let z = xn0 . We then have that k = x0 m + y0 n = (x0 − nz) m + (y0 + mz) n. It is obvious that x0 − nz ∈ N0 , so this is a contradiction (take x = x0 − nz and y = y0 + mz). Thus, the claim is true. Now, what does this mean? This means that in the expression    1 − xmn 1 1 + xm + x2m + . . . + x(n−1)m 1 + xn + x2n + . . . = · , 1 − xm 1 − xn 10

OMO Spring 2017 Official Solutions the generating function for the set of k with k = xm + yn for x, y ∈ N0 and x ≤ n − 1, is also the generating function for the integers that are in Sn . Thus, 1 1 − xmn − 1 − x (1 − xm ) (1 − xn ) is the generating function for the integers that are in Sn . (Side note: combining these terms into one fraction and comparing the degrees of the numerator and denominator gives us the so-called Chicken McNugget Theorem.) Thus, if F (x) =

1 − xmn 1 − , 1 − x (1 − xm ) (1 − xn )

then |Sn | = lim F (x) and the sum of the elements of Sn is lim F 0 (x). x→1

x→1

We have that

n−1 X

xmi

n−1 X

xmi +

n−1 X

xmi+1 1 i=0 i=0 − i=0 n = . F (x) = 1−x 1−x 1 − x − xn + xn+1 To find the limit of F as x → 1, we apply L’Hopital’s rule twice: −n (n − 1) xn−2 −

n−1 X

mi (mi − 1) xmi−2 +

n−1 X

mi (mi + 1) xmi−1

i=1

i=1

lim F (x) = lim

x→1

1 − xn −

−n (n − 1) xn−2 + (n + 1) nxn−1 ! n−1 X 1 −n (n − 1) + 2m i = (−n (n − 1) + mn (n − 1)) 2n i=1

x→1

=

1 2n

=

(m − 1) (n − 1) . 2

Therefore, the size of Sn is |Sn | =

(m−1)(n−1) . 2

Now, rewrite F as n−1 X

xmi 1 F (x) = + i=0 . 1−x xn − 1 Then n−1 X

F 0 (x) =

1 (x − 1)

2

(x − 1) − n

n−1 X

! x

mi

n−1 X

− 1)

2

! mixmi−1

2

(xn − 1) (x − 1) − n

i=1

= !2 xi

+

i=0

i=0

!2 x

+

xmi

xn−1 (x − 1)

2

i=1

i

!

(x − 1) (xn − 1) ! ! n−1 n−1 X X mixmi−1 (xn − 1) − n xmi xn−1 i=0

(xn − 1) n−1 X

n−1 X i=0

2

n−1 X

xn−1

i=0

(xn

(xn − 1) +

=

mix

n

i=1

+ 2

=

! mi−1

n−1 X

2

(mi − n) xmi+n−1 −

i=1

n−1 X i=1

x2n − 2xn + 1 11

mixmi−1 − nxn−1 .

2

OMO Spring 2017 Official Solutions It follows from applying L’Hopital’s rule twice that !2 ! n−1 ! n−1 n−1 n−1 X X X X i−1 i i−2 ix +2 x i (i − 1) x + (mi − n) (mi + n − 1) (mi + n − 2) xmi+n−3 2 i=1

i=0



i=2

i=1

mi (mi − 1) (mi − 2) xmi−3 − n (n − 1) (n − 2) xn−3

i=1

lim F 0 (x) = lim

x→1

n−1 X

2n (2n − 1) x2n−2 − 2n (n − 1) xn−2

x→1 2

 n2 (n − 1) n2 (n − 1) (2n − 1) 2 + − n (n − 1) − n (n − 1) (n − 2)  2 3 1    = 2  n−1 X 2n   + (mi − n) (mi + n − 1) (mi + n − 2) − mi (mi − 1) (mi − 2) 

i=1 n−1 (n − 1) (n − 1) (2n − 1) n − 1 (n − 1) (n − 2) 1 X 2 2 + − − + 2 m ni − mn2 i − n (n − 1) (n − 2) 4 6 2 2n 2n i=1 2

=

2

(n − 1) (2n − 1) n − 1 (n − 1) (n − 2) m2 (n − 1) (2n − 1) (n − 1) + − − + 4 6 2 2n 12 = 2 mn (n − 1) (n − 1) (n − 2) − − 4 2n (m − 1) (n − 1) (2mn − m − n − 1) = 12 after mass simplification. Thus, the sum of the elements of Sn is . is 2mn−m−n−1 6

(m−1)(n−1)(2mn−m−n−1) , 12

so the average of the elements of Sn

Thus, if y = 12 , ∞ ∞ ∞ X X X An (2m − 1) n − (m + 1) n m − 2 (2m − 1) mk − (m + 1) mk = y − y − y n 2 6 6 6 n=1 n=1 k=1

∞ ∞ ∞ ∞ m − 2 2m − 1 X n m + 1 X n m (2m − 1) X m+1 X m k k + ny − y − k (y m ) + (y ) =− 12 6 6 n=1 6 6 n=1 k=1

k=1

m − 2 (2m − 1) y (m + 1) y m (2m − 1) y m (m + 1) y m =− + − − + 2 2 12 6 (1 − y) 6 (1 − y m ) 6 (1 − y) 6 (1 − y m ) m m − 2 2m − 1 m + 1 m (2m − 1) 2 m+1 =− + − − + . 2 m 12 3 6 6 (2m − 1) 6 (2 − 1) As −

m − 2 2m − 1 m + 1 5m − 4 1 + − = = 840 + 12 3 6 12 12

and −

1 2017 · 4033 · 22017 2018 11 <− + < 2 2017 2017 12 6 (2 − 1) 12 6 (2 − 1)

is clear, we have that ∞ X An 2n n=1

$

% = 840.

Note: Along the way, we divided out by certain terms at the right times to allow for easier applications of L’Hopital’s rule. We take advantage of the fact that the number of times that L’Hopital’s rule at a 12

OMO Spring 2017 Official Solutions constant must be applied is the multiplicity of that constant in both the numerator and denominators. Straight-out using L’Hopital’s rule would require 6 applications, but using the divisions shown in this solution only requires second derivatives. 25. A simple hyperplane in R4 has the form k1 x1 + k2 x2 + k3 x3 + k4 x4 = 0 for some integers k1 , k2 , k3 , k4 ∈ {−1, 0, 1} that are not all zero. Find the number of regions that the set of all simple hyperplanes divide the unit ball x21 + x22 + x23 + x24 ≤ 1 into. Proposed by Yannick Yao. Answer. 5376 . Solution. Note that it does not matter that we are looking at a unit ball since all simple hyperplane spass through the origin. We can replace it with [−1, 1]4 or simply its surface and still have the same answer. This hypercube has 8 3-dimensional faces (that are separated by simple hyperplanes of the form xi − xj = 0 or xi + xj = 0 where i 6= j, and it suffices to consider one of the faces, say x4 = 1. Within this face, the simple hyperplanes x1 = 0, x2 = 0, x3 = 0 separate the face into 23 = 8 identical unit cubes, and it suffices to consider one of them, say 0 ≤ x1 , x2 , x3 ≤ 1. The simple hyperplanes that cut through this cube are: x1 = x2 , x2 = x3 , x3 = x1 , x1 + x2 = 1, x1 + x3 = 1, x2 + x3 = 1, x1 + x2 + x3 = 1, x1 +x2 −x3 = 0, x1 +x2 −x3 = 1, x1 −x2 +x3 = 0, x1 −x2 +x3 = 1, −x1 +x2 +x3 = 0, −x1 +x2 +x3 = 1. (Note that the constant 1 is allowed since x4 = 1 and one can set k4 = −1.) In order to visualize the arrangement of these cuts, one can consider their intersections with x3 = t for different values of t and draw them inside the unit square 0 ≤ x1 , x2 ≤ 1 as moving/stationary lines parametrized by t. The following six diagrams show the situation when 0 < t < 41 , 14 < t < 13 , 13 < t < 1 1 2 2 3 3 2 , 2 < t < 3 , 3 < t < 4 , 4 < t < 1 respectively:

13

OMO Spring 2017 Official Solutions (Note that the asymmetry on the top-right corner comes from the absence of the plane x1 +x2 +x3 = 2.) Whenever three (or more) lines pass through a common point or when two parallel line coincide, a new region is created after they separate. These regions, along with the original ones, are shaded in gray in the above diagrams. One can count that there are 42 + 4 + 8 + 22 + 6 + 2 = 84 regions in total in this unit cube. Therefore in total there are 8 · 8 · 84 = 5376 regions in the original unit ball. 26. Let ABC be a triangle with AB = 13, BC = 15, AC = 14, circumcenter O, and orthocenter H, and let M, N be the midpoints of minor and major arcs BC on the circumcircle of ABC. Suppose P ∈ AB, Q ∈ AC satisfy that P, O, Q are collinear and P Q||AN , and point I satisfies IP ⊥ AB, IQ ⊥ AC. T Let H 0 be the reflection of H over line P Q, and suppose H 0 I meets P Q at a point T . If M N T can be √ m written in the form n for positive integers m, n where m is not divisible by the square of any prime, then find 100m + n. Proposed by Vincent Huang. Answer. 31418 . Solution. Let S = P Q ∩ BC and S 0 ∈ BC with BQ, CP, AS 0 concurrent. Let X = (AP Q) ∩ (ABC), X 0 = (SS 0 X) ∩ (ABC), and A0 be the antipode of A on (ABC). It’s clear that X is the center of a spiral similarity sending P Q to BC. By Ceva’s Theorem on XP BS 0 0 BQ, CP, AS 0 and AP = AQ we know that r = XQ = BP CQ = CS 0 , so that XS bisects ∠BXC, hence 0 X ∈ S M . Similarly, by Menelaus, SB : SC = −r, implying X ∈ SN . Since X = (AI) ∩ (AA0 ) we deduce that X ∈ IA0 . Now let T 0 = XI ∩ P Q so that ∠P XQ is bisected by XT , implying that PT 0 0 0 0 T Q = r. Then the spiral similarity sending P Q to BC sends T to S , so we deduce XSS T is cyclic. 0 0 0 But M X ⊥ N X =⇒ SX ⊥ S X, so that T is the projection of S onto P Q. Now I claim that T = T 0 . Since (S, S 0 ; B, C) is harmonic and S 0 T ⊥ ST we deduce S 0 T, ST bisect ∠BT C. It suffices to show that T 0 H, T 0 I, or equivalently T 0 H, T 0 A0 , are isogonal in ∠BT 0 C, as this would imply that H 0 , T 0 , I are collinear. To do this we note that BP T 0 ∼ CQT 0 by AA similarity, so that ∠T 0 BA = ∠T 0 CA. Then ∠HBA = ∠HCA implies ∠HBT 0 = ∠HCT 0 . If we let BH ∩ CT 0 = B 0 , CH ∩ BT 0 = C 0 then BCB 0 C 0 is cyclic, hence T 0 B 0 : T 0 C 0 = T B : T C. Remark that ∠BT 0 C and ∠BAC have parallel angle bisectors. Then since B 0 H 0 belongs to the direction ⊥AC , which is isogonal in ∠BT C to the direction of BA0 , which is ⊥AB , and similarly for C 0 H 0 , CA0 , we can deduce that figures T 0 B 0 HC 0 , T 0 BA0 C are inversely similar in ∠BT 0 C, hence T 0 H, T 0 A0 are isogonal as desired. (This paragraph can also be phrased in terms of hyperbolas, but I don’t think it’s necessary.) Now we have established that T = T 0 . Note that (SS 0 ) must be an Apollonius circle in 4XBC, hence XBX 0 C is harmonic so X 0 B : X 0 C = r, so the Angle Bisector Theorem yields that X 0 ∈ SM, S 0 N . Since (S, S 0 ; B, C) is harmonic, we know (SS 0 ), (ABC) are orthogonal. Let the S-Apollonius circle of SM N meet (SS 0 ) at a point T 00 6= S. Since (SS 0 ) and the S-Apollonius circle of SM N are both orthogonal to (ABC) we know the inversion about (ABC) swaps S, T 00 , so it follows that T 00 = T . SM sin SN M XM Then TT M N = SN = sin SM N = X 0 N . N B2 N S0 M B2 N S 0 so the ratio becomes S 0 M N B 2 . 5 Now we perform computations. cos A = 13 by Law of Cosines, sin 0.5A = √213 , cos 0.5A = √313 by halfabc 65 √ angle, [ABC] = 84 by Heron’s Formula, R = 65 8 by [ABC] = 4R , BM = 2R sin 0.5A = 2 13 , BN = 65·3 2R cos 0.5A = 4√13 by Law of Sines. √ Next we can compute AM = 2117 by Ptolemy on ABM C. Then since AP M Q is a rhombus we know 13 1 39 17 13 AP = 0.5AM cos 0.5A = 4 , so that BP = 13 4 , CQ = 4 , r = 17 . 2 Next, by this ratio we know BS 0 = 13 , CS 0 = 17 2 . By Stewart’s√Theorem on BM C we know BM = √ 2 157·13 02 0 0 0 0 M S + BS · CS =⇒ M S = 26. Similarly, we find N S = . 4

We can verify that XM =

M B2 0 S0 M , N X

=

14

OMO Spring 2017 Official Solutions Then

N S0 M B2 S0 M N B2



=

314 18 ,

so the answer is 31418.

27. Let N be the number of functions f : Z/16Z → Z/16Z such that for all a, b ∈ Z/16Z: f (a)2 + f (b)2 + f (a + b)2 ≡ 1 + 2f (a)f (b)f (a + b)

(mod 16).

Find the remainder when N is divided by 2017. Proposed by Zack Chroman. Answer. 793 . Solution. First, note that if we send f (x) → f (x) + 8, the equation will still be true. Then WLOG assume that the image of f is contained within {0, . . . , 7}, and we’ll multiply by 216 at the end to compensate. Let P (x, y) denote the statement f (x)2 + f (y)2 + f (x + y)2 ≡ 1 + 2f (x)f (y)f (x + y) (mod 16). Note that P (x, x) =⇒ 2f (x)2 + f (2x)2 ≡ 1 + 2f (x)2 f (x + y) (mod 16) =⇒ f (2x) ≡ 1 (mod 2). So f maps evens to odds. Furthermore, for x,y odd, P (x, y) (mod 4) =⇒ (f (x) − f (y))2 ≡ 0 (mod 4)

=⇒

f (x)2 + f (y)2 ≡ 2f (x)f (y)

So either f sends odds to odds or odds to evens. Case 1: f sends odds to evens Then for x, y odd, P (x, y) =⇒ f (x)2 + f (y)2 ≡ 0 (mod 8). Then f (x) ≡ f (y) (mod 4). Subcase 1: f (odd) ≡ 0 (mod 4) Then P (x, y) for x, y odd gives f (x + y)2 ≡ 1 (mod 16), so f (even) ∈ {1, 5}. Now, P (a, b) for a, b even gives f (a)f (b)f (a + b) ≡ 1 (mod 8). That is, an even number of f (a), f (b), f (a + b) are 5. In particular, f (2a) = 1. If a, b ≡ 2 (mod 4), P (a, b) =⇒ f (a) = f (b). This value can be either 1 or 5, and by the above all equations will work out (checking P(odd,even) is straightforward). Then there are 2 · 28 possibilities in this case; 2 for all the 2 mod 4 numbers, and 2 for each odd, which can be 0 or 4. Subcase 2: f (odd) ≡ 2 (mod 4) Take x, y odd. Note that f (x)2 ≡ 4 (mod 16). P (x, y) =⇒ 8 + f (x + y)2 ≡ f (x)2 + f (y)2 + f (x + y)2 ≡ 1 + 2f (x)f (y)f (x + y) ≡ 9 (mod 16). Then f (even) ∈ {1, 7}. Now for a, b even, 3 ≡ f (a)2 + f (b)2 + f (a + b)2 ≡ 1 + 2f (a)f (b)f (a + b). Thus f (a)f (b)f (a + b) ≡ 1 (mod 8). We finish as in subcase 1, and get that there are 28 · 2 possibilities in this subcase; 2 for assigning the evens, and 2 for each odd, which can be any of {2, 6}. Case 2: f sends odds to odds Note that P (x, y) ⇐⇒ 3 ≡ 1 + 2f (x)f (y)f (x + y) (mod 8). Thus f (x)f (y)f (x + y) ≡ 1 (mod 4). In particular, f (2x) ≡ 1 (mod 4). Going back to the equation, if x, y are of the same parity, f (x) ≡ f (y) (mod 4). Now, let f (1) = a. Then for any n, m, P (n, m) ⇐⇒ f (n)2 + f (m)2 + f (n + m)2 ≡ 1 + 2f (n)f (m)f (n + m) 2

2

(mod 16)

2

⇐⇒ f (n) + f (m) + f (n + m) + 8 ≡ 1 + 2f (n)f (m)f (n + m) + 8 2

2

2

⇐⇒ f (n) + (f (m) + 4) + f (n + m) ≡ 1 + 2f (n)(f (m) + 4)f (n + m)

(mod 16) (mod 16)

This tells us that increasing or decreasing one of the values of f by 4 will not make a difference. We can then assume that f (odd) = a, and multiply by 27 at the end. Furthermore, since f (2x) ≡ 1 (mod 4), assume f (even) = 1, and multiply by 28 at the end. It’s easy to verify that any solution of this form works. There are 217 solutions in this case; 28 for the even numbers and 4 · 27 for the odds. The answer is 216 · (29 + 29 + 217 ) = 8657043456 ≡ 793 (mod 2017) 15

OMO Spring 2017 Official Solutions m 28. Let S denote the set of fractions for relatively prime positive integers m and n with m + n ≤ 10000. n The least fraction in S that is strictly greater than  ∞  Y 1 1 − 2i+1 10 i=0 p , where p and q are relatively prime positive integers. Find 1000p + q. q

can be expressed in the form Proposed by James Lin. Answer. 3862291 .

Solution. It’s well known that

1 ∞ Y

=

1 − x2i+1



∞ Y

∞  Y (1 + xi ). Note that for k ≥ 1, xk (1 + xi ) is

i=1

i=1

i=0

the number of partitions of k into distinct positive integers. By splitting into the number of parts in each partition, one may compute the that ∞ Y

(1 + xi ) = 1 +

i=1

∞ X i=1

xi(i+1)/2 . (1 − x)(1 − x2 ) · · · (1 − xi )

1 , this means 10      ∞  Y 1 1 100 1 1 1 + + + ··· = 1 + + , 1+ i =1+ + 10 9 9 · 99 9 · 99 · 999 9 · 99 · 999 · 9999 891 i=1

In our scenario, for x =

1 1 1 where <  < 890109 < . 1 890109 890019 1− 9999 Now, let Fn be the set of positive irreducible fractions less than 1 with denominator less than or equal 100 100 m of N = +  satisfying m + 2n ≤ 10000 and m ≥ n, so to n. We need to find a lower bound n 891 891 we need to approximate N by a fraction that certainly is in F4735 . By the theory of Farey Sequences, a 100 the smallest element in F891 that is larger than must satisfy 891a − 100b = 1 and b ≤ 891. We b 891 11 100 1 1 can solve this to get a = 11 and b = 98, and then note that − = = > . Then, 98 891 98 · 891 87318 100 11 by the theory of Farey Sequences, the fraction with the smallest denominator between and is 891 98 111 111 100 1 1 111 , and − = = > . The largest fraction in F4734 that is less than 989 989 891 989 · 891 881199 989 100 + 3 · 111 433 433 100 1 is = . Note that − = < . Hence, the desired fraction in S is 891 + 3 · 989 3858 3858 891 1145826 3858 3858 = . Hence, our answer is 3862291. 433 + 3858 4291 3858 989 Note: Our given expression is about 0.89909092, while ≈ 0.89909112 and ≈ 0.89909091. 4291 1100 √ √ 29. Let ABC be a triangle with AB = 2 6, BC = 5, CA = 26, midpoint M of BC, circumcircle Ω, and orthocenter H. Let BH intersect AC at E and CH intersect AB at F . Let R be the midpoint of EF and let N be the midpoint of AH. Let AR intersect the circumcircle of AHM again at L. Let the 16

OMO Spring 2017 Official Solutions circumcircle of AN L intersect Ω and the circumcircle of BN C at J and O, respectively. Let circles AHM and JM O intersect again at U , and let AU intersect the circumcircle of AHC again at V 6= A. m The square of the length of CV can be expressed in the form for relatively prime positive integers n m and n. Find 100m + n. Proposed by Michael Ren. Answer. 1376029 . Solution. Consider Ψ, the inversion at A with power AH ∗ AD. I claim that Ψ(G) = S, Ψ(M ) = Q. This is pretty straightforward to verify, in particular noting that Ψ(BC) = (AH). Then Ψ(L) = AR ∩ Ψ(H)Ψ(M ) = AR ∩ DQ. Call this point La . Then since Ψ(N ) is the reflection of A over BC, call it Na , Ψ(J) = Na La ∩ EF . lemma : Ψ(J) lies on AM . This would imply that J = AM ∩ Ω. proof : First, note that B, H, Q, C, Na are cyclic on the reflection γ of Ω over BC. Then, −1 = H (D, S; B, C) = (Na , Q; B, C)γ = (A, Q∗; B, C)Ω . Here Q∗ is the reflection of Q over BC, which by the above lies on the A−symmedian. In particular, A, R, Q0 collinear. Let I = AR ∩ BC ∩ Na Q. Then, working over RP2 , N

L

Q

M

(A, Q; Ψ(J), M ) =a (D, I; Na La ∩BC, M ) =a (D, A; Na , M La ∩AD) = (I, A; Q0 , La ) = (Na , A; ∞AD , D) = −1. Therefore, Ψ(J) lies on the polar of M with respect to circle (AEHF ), which is just line EF , as desired. This completes that lemma. As a corollary, note that J is the reflection of Q over M . Lemma : O is the reflection of R over M . Proof : By repeated power of a point, M N ∗ M O = AM ∗ M J = M B ∗ M C = M E 2 = M R ∗ M N. Lemma : J, M, O, S 0 are cyclic on the circle of diameter M S 0 proof : By the previous two lemmas, it suffices to show that S, R, Q, M, G are cyclic on the circle of diameter (SM ). This follows from inversion with respect to the circle of diameter (BC), which sends S → D, R → N, Q → A, G → H. Lemma : AG, AU are isogonal in ∠BAC Proof : Let AU intersect (JM O) again at U1 , and let M1 be the antipode of M on (AHM ). Note that M 0 , U, S 0 collinear. Then ∠S 0 M U1 = ∠S 0 U U1 = ∠AU M 0 = ∠AM M 0 = ∠DM H = ∠SM G Therefore, since G lies on (SM ), we have U1 = G0 , the reflection of G over the perpendicular bisector of BC. Since GG0 k BC, and G, G0 ∈ Ω, it follows that lines AG, AG0 = AU are isogonal in ∠BAC, and in particular BG = CG0 . Lemma : BG = CV Proof : Consider the circle at C with radius BG, call it ω. By the previous lemma U1 = G0 lies on this circle. Clearly so does the reflection G00 of G0 over AC. G00 lies on (AHC) since G0 lies on (ABC). Let P be the second intersection of ω, (AHC). By construction ∠P AC = ∠CAG000 = ∠CAG0 , so P ∈ AG0 . Therefore, P = V , and V ∈ ω, as desired. Since SBG and SAC are similar by antiparallels, BG = will find BS, AC, and AS in terms of x, y, and z. Note that DM · DS = DB · DC, so DS = x2 +

4y 2 z 2 (y−z)2

=

2

2

2 2

x (y−z) +4y z (y−z)2 2

2

2

2yz z−y .

BS·AC AS .

Let AD = x, BD = y, CD = z. We

Then BS = DS − y =

y 2 +yz z−y ,

and AS 2 = DS 2 + AD2 =

. We also clearly have AC 2 = x2 + z 2 .

2

+yz) (x +z ) 2 2 Thus, BG2 = (y x2 (y−z)2 +4y 2 z 2 . Now it suffices to compute x, y, z. We have y+z = 5 and y −z = −2, so 2 23 27 529 2 y−z = − 5 . This means that y = 10 and z = 10 . The Pythagorean Theorem gives x = 24− 100 = 1871 100 .

17

OMO Spring 2017 Official Solutions Now, we just have to plug everything in for the answer, which is 232 ·252 ·26 393125

=

232 ·26 629

=

13754 629 .

232 ·502 ·26 1871·42 +4·232 ·272

=

232 ·252 ·26 1871·4+232 ·272

=

Therefore the answer is 1376029.

30. Let p = 2017 be a prime. Given a positive integer n, let T be the set of all n × n matrices with entries in Z/pZ. A function f : T → Z/pZ is called an n-determinant if for every pair 1 ≤ i, j ≤ n with i 6= j, f (A) = f (A0 ), where A0 is the matrix obtained by adding the jth row to the ith row. Let an be the number of n-determinants. Over all n ≥ 1, how many distinct remainders of an are (pp − 1)(pp−1 − 1) possible when divided by ? p−1 Proposed by Ashwin Sah. Answer. 12106 . Solution. Notice that prime.

(pp −1)(pp−1 −1) p−1

= (pp−1 − 1)



pp −1 p−1



, and that those two terms are relatively

Let B, C be two rows of the matrix. Then an n-determinant remains constant when we transform them to (B + C, C) and (B + 2C, C), and so on. Thus (B + (p − 1)C, C) is equivalent, so (B − C, C) is as well and then (B − C, B) is equivalent so (−C, B) is as well after adding p − 1 times. Thus we can ”swap rows,” to some extent. Now if xy ≡ 1 (mod p) then we can send (B, C) to (B + xC, C) to (B + xC, C − y(B + xC)) = (B + xC, −yB) to (B + xC + x(−yB), −yB) = (xC, −yB) to (yB, xC). Thus we can ”scale rows,” to some extent. Thus, we can easily perform steps equivalent to row reduction and reduce any matrix to a near-reduced row echelon form with the exact same n-determinant value. If the rows are linearly dependent, we will obtain an all zero row and using it to scale other rows, we can reduce fully to reduced row echelon form. Otherwise, we can reduce the matrix to the identity matrix, except the upper left element is the nonzero determinant of the original matrix, since the operations we perform preserve the determinant. Furthermore, since the reduced row echelon form is unique, we can easily show that any matrix reduces to precisely one of these end matrices. Thus the number of functions as desired is simply pSn , where Sn is the number of such final matrices. k Pn−1 Simple counting shows that Sn = (p − 1) + k=0 p−(2) sk , counting the nonzero determinant matrices P with p−1 and counting the other rref forms with the latter sum, where sk = a1 ,...,ak ∈{0,1,...,n−1} pa1 +···+ak where we sum over distinct ai . (s0 = 1 since we must count the all zero matrix.) n

Then pSn (mod pp−1 − 1) reduces to p2 (mod

−1

(mod pp−1 − 1) while pSn (mod

p

pp −1 p−1 )

reduces to pn−1

p −1 p−1 ).

Now the value of n (mod p) determines the latter value - and all p possibilities are distinct -, while the value of 2n (mod p − 1) determines the former. There are p possibilities for the first. For the second, let v = v2 (p − 1) and d = ord p−1 (2). Then n = 1, . . . , v − 1 give v − 1 distinct values while 2v n = v, v + 1, . . . , v + d − 1 give d values which repeat forever. This gives a total of pd + (v − 1) residues for the answer by the Chinese Remainder Theorem a bunch of times, since gcd(d, p) = 1. Now for p = 2017 we have v = 5, d = 6. Thus we find 2017 · 6 + 4 = 12106.

18

Online Math Open (OMO) 2012-2017 Fall, EN with solutions.pdf ...

and graphing calculators, computer programs and applications such as Mathematica, and online databases. is prohibited. All problems on the Online Math Open ...

5MB Sizes 4 Downloads 310 Views

Recommend Documents

MATH 241 Fall 2014 Course Syllabus - GitHub
Sep 10, 2014 - Students taking this course may not receive credit for MATH 114, except ... Computer Software: We will also be using R which is a free, open source ... producing PDF's, I recommend TEXworks which can be downloaded here.

After the communism fall, the subventions destinated ... - symposium EN
(dairy, meat, bred and bakery products, mineral water), textile industry, printing industry, and also wood and furniture industries. .... sustains the implementation of heating systems based on renewable energy. The Green House ... 2010 there were 12

Achebe, Chinua ''Things Fall Apart''-Xx-En-Sp.pdf
El Gato porque nunca daba con las espal- das en tierra. ... Toda su vida ... veces se echaba a andar a ver si veía un mi- lano planeando calmadamente en el cielo ... trae la vida. .... Displaying Achebe, Chinua ''Things Fall Apart''-Xx-En-Sp.pdf.

Computer Science 75 Fall 2009 Scribe Notes ... - The Open Academy
One disadvan- tage of the JavaScript is that you have no way of logging how users are interacting with your search box because no information is being sent to your server. • Which approach might we want to take if we were developing for a mobile de

2015-Fall-EBook-Open Network Learning Environments & Personal ...
2015-Fall-EBook-Open Network Learning Environments ... Environments-An Interactive Guide for Educators.pdf. 2015-Fall-EBook-Open Network Learning ...

Open Seat Flyer Fall 2016.pdf
Sign in. Page. 1. /. 1. Loading… Page 1 of 1. Page 1 of 1. Open Seat Flyer Fall 2016.pdf. Open Seat Flyer Fall 2016.pdf. Open. Extract. Open with. Sign In.

MATH 621 Fall 2017 (3 credits) Course Syllabus - GitHub
The exam schedule is given on page 6. Reschedule of Two Lectures ... scanning them in as a PDF (sub 2MB) and sending them to me. You will be rewarded in.

Washington Math 134 Syllabus Fall 07.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Washington ...

MATH 241 Fall 2017 (3 credits) Course Syllabus - GitHub
Sep 27, 2017 - scanning them in as a PDF (sub 2MB) and sending them to me. You will be rewarded in two ways: (1) if you do this for half the .... For editing and producing PDF's,. I recommend TEXworks which can be downloaded here. .... (a) Watch the

Important Information for all Math 122L Students Fall ...
Math 122L is designed for first year students who have had AP Calculus credit for Calculus I but are not yet ready for Calculus III. In addition to Calculus II material, it covers topics that are typ- ically omitted or poorly explored in high school

Motie D66 Participatie 2.0 en Open Data.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Motie D66 ...

Syllabus Math 355 Fall 2009 Modified.pdf
... Euclidean Geometry. Chapter 8 Hyperbolic Geometry. Time permitting, selected topics from: Chapter 9 Area. Chapter 10 Circles. Chapter 12 Transformational Geometry. Chapter 13 Construction of Models. Chapter 14 The Geometry of Space. Have a great

Syllabus Math 355 Fall 2009 Modified.pdf
learn fundamental principles, generalizations, and theories of geometry. • learn to use mathematical software such as Geometer's Sketchpad. • develop an ability to communicate mathematics in writing. Nature of the Class: This course emphasizes ax

call4job-math-edu-EN-2015.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item.

Math 495 Syllabus Fall 8 27 07.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Math 495 ...

Math 495 Syllabus Fall 8 28 06.pdf
supplemented with other materials from books, journals, and the internet. Prerequisite: Math 222, at least one computer programming class, and senior standing.

Math 0980 Midterm 1 Review Workshops - FALL 2017.pdf ...
Thursday 21-Sep-2017 7:00-8:00 PM WVC WVC 124. Friday 22-Sep-2017 12:00-1:00 PM Redwood Dumke STEM SI 101B. Tuesday 26-Sep-2017 6:00-7:00 ...

Washington Math 020 Syllabus Fall 2014.pdf
Page 1 of 2. MATH 020: Fall 2014 Page 1 of 2. Professor: Dr. Talitha M. Washington. Contact: Office: 221 Academic Support Building B; Office hours: M 12:10-1 pm, F 10:10-11 am & 12:10 pm-1 pm, and. by appointment. Phone: (202) 806-6833; E-mail: talit

Math 495 Syllabus Fall 8 27 07.pdf
supplemented with other materials from books, journals, and the internet. Prerequisite: Math 222, at least one computer programming class, and senior standing.

MATH 241 Fall 2016 (3 credits) Course Syllabus - GitHub
Dec 5, 2016 - Thus, I will need the email address that you reliably check. The ... scanning them in as a PDF (sub 2MB) and sending them to me. .... good boost to your grade; I once had a student go from a B to and A- based on these.