Library · Between the Challenge and the Olympiad · Chapter 8

Counting and Arrangements

Revised Report an error
On this page
  1. Problems
  2. Solutions
  3. Solution: PRMO 2013, Q4
  4. Solution: PRMO 2015 Part A, Q5
  5. Solution: IOQM 2024, Q2
  6. Solution: PRMO 2012, Q6
  7. Solution: PRMO 2013, Q5
  8. Solution: PRMO 2017, Q21
  9. Solution: PRMO 2019, Q5
  10. Solution: IOQM 2021 Part A, Q7
  11. Solution: IOQM 2025 Part SEP, Q7
  12. Solution: PRMO 2012, Q15
  13. Solution: PRMO 2017, Q9
  14. Solution: PRMO 2017, Q10
  15. Solution: PRMO 2017, Q20
  16. Solution: PRMO 2018, Q11
  17. Solution: PRMO 2018, Q12
  18. Solution: PRMO 2019, Q15
  19. Solution: PRMO 2019, Q17
  20. Solution: IOQM 2023, Q17
  21. Solution: IOQM 2024, Q14
  22. Solution: IOQM 2026, Q23
  23. Solution: PRMO 2018, Q24
  24. Solution: PRMO 2018, Q27
  25. Solution: PRMO 2018, Q28
  26. Solution: IOQM 2023, Q20
  27. Solution: IOQM 2023, Q21
  28. Solution: IOQM 2023, Q24
  29. Solution: IOQM 2026, Q22
  30. Solution: IOQM 2022, Q24
  31. Solution: IOQM 2023, Q22
  32. Solution: IOQM 2025 Part SEP, Q28

Problems

Problem 1

Three points X,Y,ZX, Y, Z are on a straight line such that XY=10XY = 10 and XZ=3XZ = 3. What is the product of all possible values of YZYZ?

Problem 2

How many line segments have both their endpoints located at the vertices of a given cube?

Problem 3

The number of four-digit odd numbers having digits 1,2,3,41, 2, 3, 4, each occurring exactly once, is:

Problem 4

A postman has to deliver five letters to five different houses. Mischievously, he posts one letter through each door without looking to see if it is the correct address. In how many different ways could he do this so that exactly two of the five houses receive the correct letters?

Problem 5

There are n−1n - 1 red balls, nn green balls and n+1n + 1 blue balls in a bag. The number of ways of choosing two balls from the bag that have different colours is 299299. What is the value of nn?

Problem 6

Find the number of ordered triples (a,b,c)(a, b, c) of positive integers such that abc=108abc = 108.

Problem 7

Five persons wearing badges with numbers 1,2,3,4,51, 2, 3, 4, 5 are seated on 55 chairs around a circular table. In how many ways can they be seated so that no two persons whose badges have consecutive numbers are seated next to each other? (Two arrangements obtained by rotation around the table are considered different.)

Problem 8

Find the number of maps f:{1,2,3}⟶{1,2,3,4,5}f : \{1, 2, 3\} \longrightarrow \{1, 2, 3, 4, 5\} such that f(i)≤f(j)f(i) \leq f(j) whenever i<ji < j.

Problem 9

How many isosceles integer-sided triangles are there with perimeter 2323?

Problem 10

How many non-negative integral values of xx satisfy the equation [x5]=[x7]\left[\dfrac{x}{5}\right] = \left[\dfrac{x}{7}\right]? (Here [x][x] denotes the greatest integer less than or equal to xx. For example [3.4]=3[3.4] = 3 and [−2.3]=−3[-2.3] = -3.)

Problem 11

There are five cities A,B,C,D,EA, B, C, D, E on a certain island. Each city is connected to every other city by road. In how many ways can a person starting from city AA come back to AA after visiting some cities without visiting a city more than once and without taking the same road more than once? (The order in which he visits the cities also matters: e.g., the routes A→B→C→AA \to B \to C \to A and A→C→B→AA \to C \to B \to A are different.)

Problem 12

There are eight rooms on the first floor of a hotel, with four rooms on each side of the corridor, symmetrically situated (that is each room is exactly opposite to one other room). Four guests have to be accommodated in four of the eight rooms (that is, one in each) such that no two guests are in adjacent rooms or in opposite rooms. In how many ways can the guests be accommodated?

Problem 13

What is the number of triples (a,b,c)(a, b, c) of positive integers such that (i) a<b<c<10a < b < c < 10 and (ii) a,b,c,10a, b, c, 10 form the sides of a quadrilateral?

Problem 14

There are several tea cups in the kitchen, some with handles and the others without handles. The number of ways of selecting two cups without a handle and three with a handle is exactly 1200. What is the maximum possible number of cups in the kitchen?

Problem 15

Determine the number of 88-tuples (ϵ1,ϵ2,⋯ ,ϵ8)(\epsilon_1, \epsilon_2, \cdots, \epsilon_8) such that ϵ1,ϵ2,⋯ϵ8∈{1,−1}\epsilon_1, \epsilon_2, \cdots \epsilon_8 \in \{1, -1\} and ϵ1+2ϵ2+3ϵ3+⋯+8ϵ8\epsilon_1 + 2\epsilon_2 + 3\epsilon_3 + \cdots + 8\epsilon_8 is a multiple of 33.

Problem 16

In how many ways can a pair of parallel diagonals of a regular polygon of 1010 sides be selected?

image

Problem 17

Find the number of ordered triples (a,b,c)(a, b, c) of positive integers such that 30a+50b+70c≤34330a + 50b + 70c \leq 343.

Problem 18

Consider the set S={(a,b,c,d,e):0<a<b<c<d<e<100}\mathcal{S} = \{(a,b,c,d,e) : 0 < a < b < c < d < e < 100\} where a,b,c,d,ea, b, c, d, e are integers. If DD is the average value of the fourth element of such a tuple in the set, taken over all the elements of S\mathcal{S}, find the largest integer less than or equal to DD.

Problem 19

Initially, there are 3803^{80} particles at the origin (0,0)(0,0). At each step the particles are moved to points above the xx-axis as follows: if there are nn particles at any point (x,y)(x,y), then ⌊n3⌋\left\lfloor \dfrac{n}{3} \right\rfloor of them are moved to (x+1,y+1)(x+1, y+1), ⌊n3⌋\left\lfloor \dfrac{n}{3} \right\rfloor are moved to (x,y+1)(x, y+1) and the remaining to (x−1,y+1)(x-1, y+1). For example, after the first step, there are 3793^{79} particles each at (1,1)(1,1), (0,1)(0,1) and (−1,1)(-1,1). After the second step, there are 3783^{78} particles each at (−2,2)(-2,2) and (2,2)(2,2), 2×3782 \times 3^{78} particles each at (−1,2)(-1,2) and (1,2)(1,2), and 3793^{79} particles at (0,2)(0,2). After 8080 steps, the number of particles at (79,80)(79, 80) is:

the first two steps
the first two steps

Problem 20

A 1×51 \times 5 rectangle is divided into five 1×11 \times 1 squares by drawing four line segments parallel to the shorter side of the rectangle. Each of the resulting sixteen unit-length line segments is coloured red, blue or green. A 1×11 \times 1 square is called colourful if all the three colours are used in colouring its sides. If NN is the number of ways of colouring such that all the five 1×11 \times 1 squares are colourful, find the remainder when NN is divided by 100100.

image

Problem 21

If NN is the number of triangles of different shapes (i.e., not similar) whose angles are all integers (in degrees), what is N/100N/100?

Problem 22

What is the number of ways in which one can colour the squares of a 4×44 \times 4 chessboard with colours red and blue such that each row as well as each column has exactly two red squares and two blue squares?

Problem 23

Let NN be the number of ways of distributing 8 chocolates of different brands among 3 children such that each child gets at least one chocolate, and no two children get the same number of chocolates. Find the sum of the digits of NN.

Problem 24

For any finite non empty set XX of integers, let max⁡(X)\max(X) denote the largest element of XX and ∣X∣|X| denote the number of elements in XX. If NN is the number of ordered pairs (A,B)(A, B) of finite non-empty sets of positive integers, such that max⁡(A)×∣B∣=12; and\max(A) \times |B| = 12; \text{ and} ∣A∣×max⁡(B)=11|A| \times \max(B) = 11 and NN can be written as 100a+b100a + b where a,ba, b are positive integers less than 100, find a+ba + b.

Problem 25

For n∈Nn \in \mathbb{N}, consider non-negative integer-valued functions ff on {1,2,…,n}\{1, 2, \ldots, n\} satisfying f(i)≥f(j)f(i) \geq f(j) for i>ji > j and ∑i=1n(i+f(i))=2023\sum_{i=1}^{n}(i + f(i)) = 2023. Choose nn such that ∑i=1nf(i)\sum_{i=1}^{n} f(i) is the least. How many such functions exist in that case?

Problem 26

A trapezium in the plane is a quadrilateral in which a pair of opposite sides are parallel. A trapezium is said to be non-degenerate if it has positive area. Find the number of mutually non-congruent, non-degenerate trapeziums whose sides are four distinct integers from the set {5,6,7,8,9,10}\{5, 6, 7, 8, 9, 10\}.

Problem 27

Let NN be the number of distinct 88-digit numbers obtained by arranging the six numbers 0,1,2,3,10,230, 1, 2, 3, 10, 23, where the first digit of the 88 digit number is not zero. Find the sum of the digits of NN.

Problem 28

Let NN be the number of ways of distributing 52 identical balls into 4 distinguishable boxes such that no box is empty and the difference between the number of balls in any two of the boxes is not a multiple of 6. If N=100a+bN = 100a + b, where a,ba, b are positive integers less than 100, find a+ba + b.

Problem 29

In an equilateral triangle of side length 6, pegs are placed at the vertices and also evenly along each side at a distance of 1 from each other. Four distinct pegs are chosen from the 15 interior pegs on the sides (that is, the chosen ones are not vertices of the triangle) and each peg is joined to the respective opposite vertex by a line segment. If NN denotes the number of ways we can choose the pegs such that the drawn line segments divide the interior of the triangle into exactly nine regions, find the sum of the squares of the digits of NN.

image

Problem 30

There are 10 members in a delegation. No two of them have the same height. Let NN be the number of ways in which they can stand in a line for a photograph such that

  • the leftmost person is the shortest,

  • the rightmost person is the tallest, and

  • in the line between the shortest and tallest person, there is exactly one person who is shorter than both of his immediate neighbours.

If NN can be written as 100a+b100a + b where aa and bb are positive integers less than 100, find a+ba + b.

Solutions

Solution: PRMO 2013, Q4

Key idea

ZZ may sit on either side of XX, giving YZ=10−3YZ = 10 - 3 or 10+310 + 3.

The two positions allowed for Z .
The two positions allowed for ZZ.

Put XX at the origin of a number line and YY at 1010. The point ZZ is at distance 33 from XX, so it is at 33 or at −3-3, and correspondingly YZ=10−3=7orYZ=10+3=13.YZ = 10 - 3 = 7 \qquad \text{or} \qquad YZ = 10 + 3 = 13. Both are genuinely possible, since nothing in the question orders the three points. The product is 7×13=91.7 \times 13 = 91.

Answer 91

Solution: PRMO 2015 Part A, Q5

Key idea

A segment is decided entirely by its two endpoints, so the count is a choice of two vertices from eight and nothing more.

A cube has 88 vertices, and a line segment with both endpoints at vertices is determined by which pair of vertices it joins. Different pairs give different segments, and every pair gives one. So the number of segments is (82)=8×72=28.\binom{8}{2} = \frac{8 \times 7}{2} = 28.

Students sometimes hesitate here, wondering whether the twelve edges, the face diagonals and the space diagonals should be counted separately and added. They can be, and it is a useful check: 1212 edges, 22 diagonals on each of 66 faces giving 1212, and 44 space diagonals, for a total of 12+12+4=2812 + 12 + 4 = 28. The two routes agree, which is what one wants from a counting problem.

Answer 28

Solution: IOQM 2024, Q2

Key idea

The last digit has to be odd, and once it is chosen the remaining three digits may be arranged freely.

The number uses each of 1,2,3,41, 2, 3, 4 exactly once, and it is odd precisely when its last digit is 11 or 33. That is 22 choices. The other three digits then occupy the first three places in any order, which can be done in 3!=63! = 6 ways.

So the count is 2⋅6=122 \cdot 6 = 12.

Answer 12

Solution: PRMO 2012, Q6

Key idea

Choose which two houses are right, then send the other three letters all to wrong houses.

Choosing the two correctly delivered letters can be done in (52)=10\binom52 = 10 ways. The remaining three letters must go to the remaining three houses with none of them correct, and there are exactly two ways to do that. Label those houses A,B,CA,B,C, with each letter named for its proper house. If letter AA goes to BB, letter BB must go to CC and letter CC to AA. If letter AA goes to CC, the other direction is forced: A→B→C→AorA→C→B→A.A\to B\to C\to A \qquad\text{or}\qquad A\to C\to B\to A.

So the number of ways is 10×2=20.10 \times 2 = 20.

Note that “exactly two” is what makes this finite and small: had the question said “at least two”, the count would run over the other cases too.

Answer 20

Solution: PRMO 2013, Q5

Key idea

The three cross terms add to 3n2−13n^2 - 1, so the equation is 3n2=3003n^2 = 300.

A pair of different colours is one red and one green, or one green and one blue, or one blue and one red. With n−1n-1 red, nn green and n+1n+1 blue balls, (n−1)n+n(n+1)+(n+1)(n−1)=(n2−n)+(n2+n)+(n2−1),(n-1)n + n(n+1) + (n+1)(n-1) = \left(n^2 - n\right) + \left(n^2 + n\right) + \left(n^2 - 1\right), which is 3n2−13n^2 - 1. The two linear terms cancel, which is the tidy part of the arrangement.

Setting 3n2−1=2993n^2 - 1 = 299 gives n2=100n^2 = 100 and n=10.n = 10.

Answer 10

Solution: PRMO 2017, Q21

Key idea

Each prime is distributed independently, so the count is a product of stars-and-bars factors, one for the two 22s and one for the three 33s.

Since 108=22⋅33108 = 2^2 \cdot 3^3, giving an ordered triple (a,b,c)(a,b,c) with abc=108abc = 108 means deciding how many of the two factors of 22 go to each of aa, bb, cc, and likewise for the three factors of 33. The two decisions are independent.

For example, allocating the two factors of 22 as one to aa, one to bb and none to cc can be shown by two stars separated into three groups: ⋆⏟a∣⋆⏟b∣⋆⏟c.\underbrace{\star}_{a}\mid\underbrace{\star}_{b}\mid\underbrace{\phantom{\star}}_{c}. Placing the two bars among the four star-or-bar positions gives the six possible allocations, including empty groups. Distributing 22 identical items into 33 labelled boxes can be done in (2+22)=6\binom{2+2}{2} = 6 ways, and 33 identical items in (3+22)=10\binom{3+2}{2} = 10 ways. Hence 6×10=60.6 \times 10 = 60.

Answer 60

Solution: PRMO 2019, Q5

Key idea

Three of the five people have only two possible neighbours each, so their edges are forced, and the forced edges already close up into a single cycle.

The permitted neighbour relations force this cycle.
The permitted neighbour relations force this cycle.

Think of the seating as a cycle on the five badges, where two badges are joined when they sit next to each other. The rule forbids joining 11 to 22, 22 to 33, 33 to 44 and 44 to 55, so the permitted neighbours are 1:{3,4,5},2:{4,5},3:{1,5},4:{1,2},5:{1,2,3}.1: \{3,4,5\}, \quad 2: \{4,5\}, \quad 3: \{1,5\}, \quad 4: \{1,2\}, \quad 5: \{1,2,3\}.

Badges 22, 33 and 44 have exactly two permitted neighbours each, and in the seating every person has exactly two neighbours. So all of those pairings are forced: 22 must sit between 44 and 55, badge 33 between 11 and 55, and badge 44 between 11 and 22. Collecting them, the five adjacencies must be 1 ⁣− ⁣3,3 ⁣− ⁣5,5 ⁣− ⁣2,2 ⁣− ⁣4,4 ⁣− ⁣1,1\!-\!3, \quad 3\!-\!5, \quad 5\!-\!2, \quad 2\!-\!4, \quad 4\!-\!1, which is precisely the single cycle 1,3,5,2,41, 3, 5, 2, 4. There is exactly one admissible cyclic order.

Now count seatings. Rotations are counted as different, so the cycle can be placed on the five chairs in 55 rotations, and it can be traversed in either of 22 directions, giving 5×2=105 \times 2 = 10 seatings in all.

Answer 10

Solution: IOQM 2021 Part A, Q7

Key idea

A non-decreasing map is determined by which three values it takes, repeats allowed and order irrelevant, so this is a question about choosing with repetition rather than about functions at all.

The condition f(i)≤f(j)f(i) \leq f(j) whenever i<ji < j says that f(1)≤f(2)≤f(3)f(1) \leq f(2) \leq f(3). Once we know which three values are used, and with what multiplicity, the map is completely determined, because the values must be written in increasing order. So counting maps is the same as counting the ways of choosing three values from five with repeats allowed and order ignored.

The standard count for that is (n+k−1k)\binom{n + k - 1}{k} with n=5n = 5 and k=3k = 3, which comes from the stars-and-bars correspondence: lay out three stars and four bars, and read off how many of each value to take. For example, ∣⋆⋆∣∣⋆∣⟷(f(1),f(2),f(3))=(2,2,4).\mid\star\star\mid\mid\star\mid \quad\longleftrightarrow\quad (f(1),f(2),f(3))=(2,2,4). The five groups contain 0,2,0,1,00,2,0,1,0 stars: those are the numbers of copies of the values 1,2,3,4,51,2,3,4,5. Here (5+3−13)=(73)=35.\binom{5 + 3 - 1}{3} = \binom{7}{3} = 35.

Answer 35

Solution: IOQM 2025 Part SEP, Q7

Key idea

Write the triangle as a,a,ba, a, b with 2a+b=232a + b = 23; the triangle inequality traps aa between two bounds and every value in between works.

Let the equal sides be aa and the third side bb, so 2a+b=232a + b = 23 with a,ba, b positive integers. The only triangle inequality that can fail is a+a>ba + a > b, that is 2a>23−2a,4a>23,a≥6.2a > 23 - 2a, \qquad 4a > 23, \qquad a \ge 6. At the other end, b≥1b \ge 1 forces 2a≤222a \le 22, so a≤11a \le 11.

Every aa from 66 to 1111 gives a genuine triangle, and different values of aa give non-congruent triangles, so there are 66 of them. (No equilateral triangle appears, since 2323 is not divisible by 33, so nothing is counted twice.)

Answer 6

Solution: PRMO 2012, Q15

Key idea

If both floors equal kk then xx lies in [5k,5k+4][5k, 5k+4] and in [7k,7k+6][7k, 7k+6], and those overlap only for k≤2k \le 2.

For a common floor of 1 , the overlap contains 7,8,9 .
For a common floor of 11, the overlap contains 7,8,97,8,9.

Let kk be the common value of the two floors. Then 5k≤x≤5k+4and7k≤x≤7k+6.5k \le x \le 5k + 4 \qquad \text{and} \qquad 7k \le x \le 7k + 6. For an overlap we need 7k≤5k+47k \le 5k + 4, that is k≤2k \le 2, so only three values of kk are possible.

Taking them in turn:

  • k=0k = 0: x∈{0,1,2,3,4}x \in \{0,1,2,3,4\}, five values.

  • k=1k = 1: [5,9]∩[7,13]={7,8,9}[5,9] \cap [7,13] = \{7,8,9\}, three values.

  • k=2k = 2: [10,14]∩[14,20]={14}[10,14] \cap [14,20] = \{14\}, one value.

So there are 5+3+1=95 + 3 + 1 = 9 non-negative integers in all.

Answer 9

Solution: PRMO 2017, Q9

Key idea

A route is a cycle through AA, so it is decided by which other cities are used and in what order, giving (4k)k!\binom{4}{k}k! for each length.

A route leaves AA, passes through some of the other four cities without repetition, and returns. Since every pair of cities is joined, the only decisions are which cities to use and in what order. A route through kk other cities is therefore determined by an ordered selection of kk cities out of four, and each such selection gives exactly one route.

How small can kk be? Not 00, and not 11: going A→B→AA \to B \to A would use the road ABAB twice. So kk runs from 22 to 44, and ∑k=24(4k)k!=(42)2!+(43)3!+(44)4!=12+24+24=60.\sum_{k=2}^{4}\binom{4}{k}k! = \binom42 2! + \binom43 3! + \binom44 4! = 12 + 24 + 24 = 60.

The problem’s remark that the two directions count separately is exactly what makes this an ordered count, and it is why each cycle contributes k!k! rather than k!/2k!/2.

Answer 60

Solution: PRMO 2017, Q10

Key idea

Each opposite pair may hold at most one guest, so with four guests every pair holds exactly one, and the side must alternate along the corridor.

image

Number the rooms 1,2,3,41, 2, 3, 4 on one side and 1′,2′,3′,4′1', 2', 3', 4' on the other, with ii opposite i′i'. Forbidden pairs are ii with i′i', and consecutive rooms on the same side.

Each of the four opposite pairs {i,i′}\{i, i'\} can hold at most one guest, and there are four guests, so every pair holds exactly one. Reading along the corridor, that means a choice for each ii of which side its guest is on.

Now the adjacency rule bites. If the guests in positions ii and i+1i+1 were on the same side they would be in adjacent rooms, so consecutive choices must alternate. There are exactly two alternating patterns for four positions, namely 1,2′,3,4′and1′,2,3′,4.1, 2', 3, 4' \qquad\text{and}\qquad 1', 2, 3', 4.

Finally the guests are four different people, so each set of rooms can be filled in 4!4! ways: 2×24=48.2 \times 24 = 48.

Answer 48

Solution: PRMO 2017, Q20

Key idea

Four lengths form a quadrilateral exactly when the longest is less than the sum of the other three, and here the longest is 1010, so the count is of triples with a+b+c>10a+b+c > 10.

Four positive lengths are the sides of a quadrilateral exactly when each is less than the sum of the other three. Here is the needed converse in this case. Draw a diagonal of length tt, and build triangles with sides (a,b,t)(a,b,t) and (c,10,t)(c,10,t) on its opposite sides. Both are non-degenerate precisely when b−a<t<a+band10−c<t<10+c.b-a<t<a+b \qquad\text{and}\qquad 10-c<t<10+c. These intervals overlap exactly when 10−c<a+b10-c<a+b: the other lower bound b−ab-a is already below a+ba+b, and 10+c10+c exceeds both lower bounds and a+ba+b. Joining the two triangles then gives a quadrilateral with the required sides. Since a<b<c<10a < b < c < 10, the side of length 1010 is the longest, so the only condition that can fail is a+b+c>10.a + b + c > 10.

There are (93)=84\binom93 = 84 triples with 1≤a<b<c≤91 \le a < b < c \le 9, so count instead the failures, those with a+b+c≤10a + b + c \le 10: a=1,b=2:c=3,4,5,6,7(5)a=1,b=3:c=4,5,6(3)a=1,b=4:c=5(1)a=2,b=3:c=4,5(2)\begin{array}{ll} a = 1, b = 2: & c = 3,4,5,6,7 \quad (5) \\ a = 1, b = 3: & c = 4,5,6 \quad (3) \\ a = 1, b = 4: & c = 5 \quad (1) \\ a = 2, b = 3: & c = 4,5 \quad (2) \end{array} and nothing else, since a=2,b=4a = 2, b = 4 already needs c≥5c \ge 5 and gives 1111. That is 1111 failures, so the count is 84−11=73.84 - 11 = 73.

Answer 73

Solution: PRMO 2018, Q11

Key idea

The equation is (n2)(h3)=1200\binom{n}{2}\binom{h}{3} = 1200, and running through the few values of (h3)\binom{h}{3} that divide 12001200 leaves three solutions, of which the largest total is 2929.

Let nn be the number of cups without handles and hh the number with. The selections are independent, so (n2)(h3)=1200.\binom{n}{2}\binom{h}{3} = 1200.

Go through the values of (h3)\binom{h}{3} in turn, keeping only those that divide 12001200 and leave a quotient of the form (n2)=12n(n−1)\binom{n}{2} = \tfrac12 n(n-1): h(h3)quotient (n2)311200, needs n(n−1)=2400: no44300, so n(n−1)=600=25×24, n=25510120, so n(n−1)=240=16×15, n=1662060, needs n(n−1)=120: no1012010, so n(n−1)=20=5×4, n=5\begin{array}{r|r|l} h & \binom{h}{3} & \text{quotient } \binom{n}{2} \\ \hline 3 & 1 & 1200 \text{, needs } n(n-1) = 2400 \text{: no} \\ 4 & 4 & 300 \text{, so } n(n-1) = 600 = 25 \times 24, \ n = 25 \\ 5 & 10 & 120 \text{, so } n(n-1) = 240 = 16 \times 15, \ n = 16 \\ 6 & 20 & 60 \text{, needs } n(n-1) = 120 \text{: no} \\ 10 & 120 & 10 \text{, so } n(n-1) = 20 = 5 \times 4, \ n = 5 \end{array} The values (h3)\binom{h}{3} for h=7,8,9h = 7, 8, 9 are 3535, 5656 and 8484, none of which divides 12001200; and for h≥11h \ge 11 we have (h3)≥165\binom{h}{3} \ge 165, which would force (n2)≤7\binom{n}{2} \le 7, that is (n2)∈{1,3,6}\binom{n}{2} \in \{1, 3, 6\}, which would need (h3)\binom{h}{3} to be 12001200, 400400 or 200200. None of the three is a binomial coefficient of that shape, as the neighbouring values show: (203)=1140<1200<1330=(213),\binom{20}{3} = 1140 < 1200 < 1330 = \binom{21}{3}, (143)=364<400<455=(153),\binom{14}{3} = 364 < 400 < 455 = \binom{15}{3}, (113)=165<200<220=(123).\binom{11}{3} = 165 < 200 < 220 = \binom{12}{3}.

So the kitchen holds 25+4=2925 + 4 = 29, or 16+5=2116 + 5 = 21, or 5+10=155 + 10 = 15 cups, and the maximum is 29.29.

A word about the key. The official answer cell for this question reads “15,21,2915, 21, 29”, because the phrase maximum possible was dropped in translation and all three totals were given full credit. The English paper does ask for the maximum, and its answer is 2929.

Answer 29

Solution: PRMO 2018, Q12

Key idea

Modulo 33 the coefficients repeat as 1,2,01, 2, 0, so the two multiples of 33 are free and what remains is a comparison of two sums of three signs.

Reduce the coefficients modulo 33. The terms with k=3k = 3 and k=6k = 6 vanish, whatever their signs, so ϵ3\epsilon_3 and ϵ6\epsilon_6 are free: 44 choices. What is left is ϵ1+4ϵ4+7ϵ7+2ϵ2+5ϵ5+8ϵ8≡(ϵ1+ϵ4+ϵ7)−(ϵ2+ϵ5+ϵ8),\epsilon_1 + 4\epsilon_4 + 7\epsilon_7 + 2\epsilon_2 + 5\epsilon_5 + 8\epsilon_8 \equiv (\epsilon_1 + \epsilon_4 + \epsilon_7) - (\epsilon_2 + \epsilon_5 + \epsilon_8), all of it modulo 33, since 1,4,7≡11, 4, 7 \equiv 1 and 2,5,8≡−12, 5, 8 \equiv -1.

Write AA for the first bracket and BB for the second. Each is a sum of three signs, so it takes the values 3,1,−1,−33, 1, -1, -3 in 1,3,3,11, 3, 3, 1 ways respectively. Modulo 33 those values are 0,1,2,00, 1, 2, 0, so A≡0 (2 ways),A≡1 (3 ways),A≡2 (3 ways),A \equiv 0 \ (2 \text{ ways}), \qquad A \equiv 1 \ (3 \text{ ways}), \qquad A \equiv 2 \ (3 \text{ ways}), and the same for BB. The condition is A≡BA \equiv B, so the number of choices for the six constrained signs is 22+32+32=4+9+9=22.2^2 + 3^2 + 3^2 = 4 + 9 + 9 = 22.

Multiplying by the 44 free choices, 22×4=88.22 \times 4 = 88.

Answer 88

Solution: PRMO 2019, Q15

Key idea

Two chords of a regular 1010-gon are parallel exactly when the sum of their endpoint labels is the same modulo 1010, which sorts all 3535 diagonals into ten families and turns the count into two binomial coefficients.

Both chords have endpoint-label sum 4 , so they are parallel.
Both chords have endpoint-label sum 44, so they are parallel.

Label the vertices P0,P1,…,P9P_0, P_1, \ldots, P_9 around the circle, with PkP_k at angle 36k∘36k^{\circ}. The chord PiPjP_iP_j is perpendicular to the radius bisecting its arc, so its direction, taken modulo 180∘180^{\circ}, is 36i+36j2+90∘=18(i+j)+90∘(mod180∘).\frac{36i + 36j}{2} + 90^{\circ} = 18(i+j) + 90^{\circ} \pmod{180^{\circ}}. Two chords are therefore parallel exactly when 18(i+j)≡18(i′+j′)(mod180)18(i+j) \equiv 18(i'+j') \pmod{180}, that is when i+j≡i′+j′(mod10).i + j \equiv i' + j' \pmod{10}.

So sort the (102)=45\binom{10}{2} = 45 chords by the value of i+ji + j modulo 1010, giving ten families of mutually parallel chords. How big is each family? Fix a remainder cc and count the pairs {i,j}\{i,j\} with i≠ji \ne j and i+j≡ci + j \equiv c. There are ten ordered pairs (i,j)(i,j) with i+j≡ci + j \equiv c, one for each ii. If cc is even, two of them have i=ji = j, namely i≡c/2i \equiv c/2 and i≡c/2+5i \equiv c/2 + 5, leaving 88 ordered pairs and hence 44 chords. If cc is odd, none has i=ji = j, leaving 55 chords. The tally checks out: 5×4+5×5=455 \times 4 + 5 \times 5 = 45.

Sides must now be removed, since the question asks about diagonals. The side PiPi+1P_iP_{i+1} has i+j=2i+1i + j = 2i + 1, always odd, so every side lies in an odd family. How many in each? Fixing an odd cc and asking for 2i+1≡c2i + 1 \equiv c means 2i≡c−12i \equiv c - 1, and since c−1c-1 is even this has exactly two solutions modulo 1010, namely i≡c−12i \equiv \tfrac{c-1}{2} and i≡c−12+5i \equiv \tfrac{c-1}{2} + 5. So each odd family contains exactly two sides, accounting for all ten, and the even families contain none. Hence

  • each of the five odd families has 5−2=35 - 2 = 3 diagonals,

  • each of the five even families has 44 diagonals,

for a total of 15+20=3515 + 20 = 35 diagonals, as it should be.

A pair of parallel diagonals is a pair chosen from one family, so the answer is 5(32)+5(42)=5×3+5×6=15+30=45.5\binom{3}{2} + 5\binom{4}{2} = 5 \times 3 + 5 \times 6 = 15 + 30 = 45.

The even families are the larger ones because a chord in an even family never touches the two vertices Pc/2P_{c/2} and Pc/2+5P_{c/2+5} that anchor it, while an odd family gets to use all ten vertices. It is the same parity distinction that makes a regular polygon with an even number of sides have diameters at all.

Answer 45

Solution: PRMO 2019, Q17

Key idea

Dividing by 1010 makes the bound 3a+5b+7c≤343a + 5b + 7c \le 34, and subtracting the compulsory 11 from each variable turns it into a small non-negative count that a three-line case split finishes.

Every term on the left of 30a+50b+70c≤34330a + 50b + 70c \le 343 is a multiple of 1010, so the left-hand side is a multiple of 1010 and the bound may be sharpened to 30a+50b+70c≤34030a + 50b + 70c \le 340, that is 3a+5b+7c≤34.3a + 5b + 7c \le 34. Since a,b,c≥1a, b, c \ge 1, write a=1+αa = 1 + \alpha, b=1+βb = 1 + \beta, c=1+γc = 1 + \gamma with α,β,γ≥0\alpha, \beta, \gamma \ge 0. The condition becomes 3α+5β+7γ≤34−15=19.3\alpha + 5\beta + 7\gamma \le 34 - 15 = 19.

Now count, splitting on γ\gamma, which can only be 00, 11 or 22 since 3×7=21>193 \times 7 = 21 > 19.

  • γ=0\gamma = 0 leaves 3α+5β≤193\alpha + 5\beta \le 19, and β=0,1,2,3\beta = 0, 1, 2, 3 allow α≤6,4,3,1\alpha \le 6, 4, 3, 1 respectively: 7+5+4+2=187 + 5 + 4 + 2 = 18.

  • γ=1\gamma = 1 leaves 3α+5β≤123\alpha + 5\beta \le 12, and β=0,1,2\beta = 0, 1, 2 allow α≤4,2,0\alpha \le 4, 2, 0: 5+3+1=95 + 3 + 1 = 9.

  • γ=2\gamma = 2 leaves 3α+5β≤53\alpha + 5\beta \le 5, and β=0,1\beta = 0, 1 allow α≤1,0\alpha \le 1, 0: 2+1=32 + 1 = 3.

Adding, 18+9+3=3018 + 9 + 3 = 30 ordered triples.

Answer 30

Solution: IOQM 2023, Q17

Key idea

Describe a tuple by the six gaps it leaves in {1,…,99}\{1, \ldots, 99\}; the six gaps are interchangeable, so each has the same average, and dd is four gaps plus four.

An element of S\mathcal S is just a choice of five numbers from {1,2,…,99}\{1, 2, \ldots, 99\}, written in increasing order. For a smaller example, choose 1,4,6,9,121,4,6,9,12 from 11 through 1313. The unchosen numbers before, between and after the chosen ones form six gaps of sizes 0,2,1,2,2,10,2,1,2,2,1:

Five chosen numbers leave six gaps, including the two end gaps.
Five chosen numbers leave six gaps, including the two end gaps.

Record the actual choice from 11 through 9999 by its gaps: g0=a−1,g1=b−a−1,g2=c−b−1,g_0 = a - 1, \quad g_1 = b-a-1, \quad g_2 = c-b-1, g3=d−c−1,g4=e−d−1,g5=99−e.g_3 = d-c-1, \quad g_4 = e-d-1, \quad g_5 = 99 - e. These six numbers are non-negative and g0+g1+g2+g3+g4+g5=99−5=94.g_0 + g_1 + g_2 + g_3 + g_4 + g_5 = 99 - 5 = 94. Conversely every such six-tuple of non-negative integers summing to 9494 comes from exactly one element of S\mathcal S, so the correspondence pairs the two collections off exactly.

Here is the point of setting it up this way. The description is completely symmetric in the six gaps: permuting them gives another valid six-tuple. So when we average over all of S\mathcal S, the six gaps have the same average value, and since they sum to 9494 that common average is 946\tfrac{94}{6}.

Now express the fourth element in terms of gaps. Unwinding the definitions, d=g0+g1+g2+g3+4.d = g_0 + g_1 + g_2 + g_3 + 4. Taking averages and using the common value, D=4⋅946+4=1883+4=2003=66.66…D = 4 \cdot \frac{94}{6} + 4 = \frac{188}{3} + 4 = \frac{200}{3} = 66.66\ldots The largest integer not exceeding DD is therefore 6666.

Nothing in the argument used the number 44 except at the last step, so the same reasoning gives the average of the jjth element as j⋅1006j \cdot \tfrac{100}{6}, which is the familiar rule that the chosen points sit, on average, evenly spread.

Answer 66

Solution: IOQM 2024, Q14

Key idea

Reaching x=79x = 79 in 8080 steps leaves almost no freedom: 7979 of the steps must go right and only one can stand still, so the count is the number of ways to choose which step that is.

At every step a particle moves one unit up, and its xx-coordinate changes by +1+1, 00 or −1-1. Suppose a particle takes uu steps to the right, vv straight up and ww to the left. After 8080 steps at the point (79,80)(79, 80), u+v+w=80,u−w=79.u + v + w = 80, \qquad u - w = 79. Subtracting the second equation from the first leaves (u+v+w)−(u−w)=v+2w=1,(u+v+w) - (u-w) = v + 2w = 1, and since vv and ww are non-negative integers the only possibility is w=0w = 0 and v=1v = 1, so u=79u = 79. Exactly one of the eighty steps is a straight-up step and the rest go right, and there are 8080 ways to choose which step that is.

Now count particles rather than paths. The claim is that after kk steps the pile at any point holds exactly 380−k3^{80-k} particles for each path of length kk reaching that point, and it follows by induction on kk.

At k=0k = 0 there is one path, the empty one, and 3803^{80} particles. Suppose the claim holds at step k<80k < 80. Every pile then has size 380−k3^{80-k} times a whole number, so it is divisible by 33, and the rule splits it into three exactly equal parts with the floors rounding nothing away. Each part is 379−k3^{79-k} times the number of paths that reached the old point, and a point at step k+1k+1 collects one such part from each of its predecessors. Adding them gives 379−k3^{79-k} times the total number of paths reaching it, which is the claim at k+1k+1.

After 8080 steps a pile is therefore 30=13^0 = 1 particle per path, and there are 8080 paths to (79,80)(79,80). The answer is 8080.

Answer 80

Solution: IOQM 2026, Q23

Key idea

Whatever colour a square’s left side has, the square can be finished in exactly 1212 ways, so the count is three choices for the first vertical segment and a factor of 1212 for each of the five squares.

Colour from left to right: the leftmost vertical segment first, then for each square in turn its right side, its top and its bottom. When a square is reached its left side is already coloured, say LL.

  • Right side also LL: the top and bottom must be the other two colours, in either order, which is 22 ways.

  • Right side one of the 22 other colours: the third colour must appear on the top or the bottom. Of the 99 choices for that pair, 44 avoid it, so 55 do not, giving 2×5=102 \times 5 = 10 ways.

That is 1212 ways whatever LL is, so N=3×125=3×248832=746496,N = 3 \times 12^5 = 3 \times 248832 = 746496, and the remainder on division by 100100 is 9696.

Answer 96

Solution: PRMO 2018, Q24

Key idea

Ordered triples of positive integers summing to 180180 are counted by a stars-and-bars binomial, and the ordered count becomes an unordered one once the triples with a repeat are pulled out and counted separately.

A triangle up to similarity is an unordered triple of positive integers {A,B,C}\{A, B, C\} with A+B+C=180A + B + C = 180.

Count the ordered triples first. A smaller example is 8=2+3+38=2+3+3, drawn as a row of units with its two dividers: ⋆⋆∣⋆⋆⋆∣⋆⋆⋆.\star\star\mid\star\star\star\mid\star\star\star. The dividers occupy two of the seven gaps between units, ensuring that every part is positive. Writing 180180 as an ordered sum of three positive integers is a choice of two dividers among the 179179 gaps in a row of 180180 units, so there are (1792)=179×1782=15931\binom{179}{2} = \frac{179 \times 178}{2} = 15931 of them.

Now pass to unordered triples. An ordered triple has 66 arrangements if its three entries are distinct, 33 if exactly two agree and 11 if all three do, so the triples with a repeat have to be removed before dividing.

All three equal means A=B=C=60A = B = C = 60: one shape, one ordered triple.

Exactly two equal means A=AA = A and C=180−2AC = 180 - 2A with AA running from 11 to 8989, which keeps CC positive, and excluding A=60A = 60, which is the all-equal case. That is 8888 shapes, each appearing as 33 ordered triples, so 264264 ordered triples.

The rest have three distinct entries: 15931−264−1=1566615931 - 264 - 1 = 15666 ordered triples, which is 15666/6=261115666 / 6 = 2611 shapes. Altogether N=2611+88+1=2700,N = 2611 + 88 + 1 = 2700, and N/100=27N/100 = 27.

Answer 27

Solution: PRMO 2018, Q27

Key idea

Each row picks a pair of columns, and the four pairs must cover every column twice, so the four pairs are either two complementary pairs each used twice, or four different pairs with the two left out forming a complementary couple.

Record each row by the pair of columns it colours red. The column condition says the four pairs, counted with multiplicity, cover each of the four columns exactly twice.

For example, these two boards satisfy the conditions; RR marks a red square and BB a blue one: RRBBRRBBBBRRBBRRRRBBRBRBBRBRBBRR\begin{array}{cccc} R&R&B&B\\R&R&B&B\\B&B&R&R\\B&B&R&R \end{array}\qquad \begin{array}{cccc} R&R&B&B\\R&B&R&B\\B&R&B&R\\B&B&R&R \end{array} The first uses row-pairs 12,12,34,3412,12,34,34 and the second uses 12,13,24,3412,13,24,34. There are six pairs in all, and they fall into three complementary couples: {12,34}\{12, 34\}, {13,24}\{13, 24\}, {14,23}\{14, 23\}, where the two pairs of a couple are disjoint.

Case 1: a repeated pair

Suppose some pair AA is used twice. It covers its two columns twice already, so the other two rows must cover only the complementary pair BB, hence both are BB. The four pairs are A,A,B,BA, A, B, B for one of the three couples, and the four rows can be arranged in 4!2! 2!=6\tfrac{4!}{2!\,2!} = 6 orders. That is 3×6=183 \times 6 = 18 colourings.

Case 2: four distinct pairs

Now the four pairs are distinct, so exactly two of the six are unused. Each column lies in three of the six pairs and must be covered twice, so each column lies in exactly one unused pair. That makes the two unused pairs disjoint, that is a complementary couple: 33 choices. The four remaining pairs can be assigned to rows in 4!=244! = 24 ways, giving 3×24=723 \times 24 = 72 colourings.

Total

No other shape is possible: three copies of one pair would cover its columns three times. So 18+72=90.18 + 72 = 90.

Answer 90

Solution: PRMO 2018, Q28

Key idea

Only two ways to write 88 as three different positive numbers, and for each the chocolates are shared out by a factorial ratio and the sizes assigned to children in 3!3! ways.

The three children get distinct positive numbers of chocolates summing to 88. Listing the ways of writing 88 as a sum of three different positive numbers: 8=1+2+5=1+3+4,8 = 1 + 2 + 5 = 1 + 3 + 4, and nothing else. If the smallest share were 22 or more, the three shares would total at least 2+3+4=92 + 3 + 4 = 9; so the smallest is 11, and the other two are different numbers above 11 adding to 77, which leaves only 2+52 + 5 and 3+43 + 4.

For each such split, the chocolates are distinguishable, so the number of ways to put them into labelled groups of sizes aa, bb and cc is 8!/(a! b! c!)8!/(a!\,b!\,c!), and the three sizes can be attached to the three children in 3!=63! = 6 ways because they are all different: 8!1! 2! 5!×6=168×6=1008,8!1! 3! 4!×6=280×6=1680.\frac{8!}{1!\,2!\,5!} \times 6 = 168 \times 6 = 1008, \qquad \frac{8!}{1!\,3!\,4!} \times 6 = 280 \times 6 = 1680.

Hence N=1008+1680=2688N = 1008 + 1680 = 2688, and its digits sum to 2+6+8+8=24.2 + 6 + 8 + 8 = 24.

Answer 24

Solution: IOQM 2023, Q20

Key idea

The second equation involves the prime 1111, so ∣A∣|A| and max⁡(B)\max(B) are 11 and 1111 in one order, and each of the two cases reduces to counting subsets of a fixed size containing a fixed largest element.

Since 1111 is prime and ∣A∣|A|, max⁡(B)\max(B) are positive integers, either ∣A∣=1|A| = 1 and max⁡(B)=11\max(B) = 11, or ∣A∣=11|A| = 11 and max⁡(B)=1\max(B) = 1. Take them in turn.

Case ∣A∣=1|A| = 1, max⁡(B)=11\max(B) = 11. Write A={m}A = \{m\}, so max⁡(A)=m\max(A) = m and the first equation reads m⋅∣B∣=12m \cdot |B| = 12. Thus mm is a divisor of 1212 and ∣B∣=12/m|B| = 12/m. The set BB consists of positive integers with largest element 1111, so BB contains 1111 together with ∣B∣−1|B| - 1 of the ten numbers 1,…,101, \ldots, 10, which can be done in (10∣B∣−1)\binom{10}{|B|-1} ways. Running through the divisors: m∣B∣count112(1011)=026(105)=25234(103)=12043(102)=4562(101)=10121(100)=1\begin{array}{c|c|c} m & |B| & \text{count} \\ \hline 1 & 12 & \binom{10}{11} = 0 \\ 2 & 6 & \binom{10}{5} = 252 \\ 3 & 4 & \binom{10}{3} = 120 \\ 4 & 3 & \binom{10}{2} = 45 \\ 6 & 2 & \binom{10}{1} = 10 \\ 12 & 1 & \binom{10}{0} = 1 \end{array} The case m=1m=1 contributes nothing, since BB would need twelve elements from a pool of eleven. The total here is 252+120+45+10+1=428252 + 120 + 45 + 10 + 1 = 428.

Case ∣A∣=11|A| = 11, max⁡(B)=1\max(B) = 1. Then B={1}B = \{1\} and ∣B∣=1|B| = 1, so the first equation gives max⁡(A)=12\max(A) = 12. So AA contains 1212 together with ten of the eleven numbers 1,…,111, \ldots, 11, which can be done in (1110)=11\binom{11}{10} = 11 ways.

Hence N=428+11=439N = 428 + 11 = 439. Writing N=100a+bN = 100a + b with a,ba, b below 100100 gives a=4a = 4 and b=39b = 39, so a+b=43a + b = 43.

Answer 43

Solution: IOQM 2023, Q21

Key idea

Since ∑f(i)=2023−n(n+1)2\sum f(i) = 2023 - \tfrac{n(n+1)}2, making the sum least means making nn as large as the constraint allows, and then the functions to be counted are just the ways of writing what is left over as a sum.

The condition f(i)≥f(j)f(i) \ge f(j) for i>ji > j says that ff is non-decreasing. Summing the given equation, ∑i=1nf(i)=2023−∑i=1ni=2023−n(n+1)2,\sum_{i=1}^{n} f(i) = 2023 - \sum_{i=1}^n i = 2023 - \frac{n(n+1)}{2}, which must be non-negative since the values of ff are non-negative. So the sum to be minimised decreases as nn grows, and we want the largest nn with n(n+1)2≤2023\tfrac{n(n+1)}2 \le 2023. Since 63⋅642=2016≤2023<2080=64⋅652,\frac{63 \cdot 64}{2} = 2016 \le 2023 < 2080 = \frac{64 \cdot 65}{2}, the choice is n=63n = 63, and then ∑f(i)=2023−2016=7\sum f(i) = 2023 - 2016 = 7.

What remains is to count the non-decreasing sequences 0≤f(1)≤f(2)≤⋯≤f(63)0 \le f(1) \le f(2) \le \cdots \le f(63) of integers with total 77. Reading such a sequence from the right and discarding the zeros gives a way of writing 77 as a sum of at most 6363 positive integers in non-increasing order, and the correspondence goes both ways because 6363 is more than 77, so no such sum is too long to fit. Those sums are 7, 6+1, 5+2, 5+1+1, 4+3, 4+2+1, 4+1+1+1, 3+3+1, 3+2+2,7,\ 6{+}1,\ 5{+}2,\ 5{+}1{+}1,\ 4{+}3,\ 4{+}2{+}1,\ 4{+}1{+}1{+}1,\ 3{+}3{+}1,\ 3{+}2{+}2, 3+2+1+1, 3+14, 2+2+2+1, 2+2+1+1+1, 2+15, 17,3{+}2{+}1{+}1,\ 3{+}1^4,\ 2{+}2{+}2{+}1,\ 2{+}2{+}1{+}1{+}1,\ 2{+}1^5,\ 1^7, fifteen in all. So there are 1515 such functions.

Answer 15

Solution: IOQM 2023, Q24

Key idea

A trapezium with parallel sides p>qp > q and legs m,nm, n exists exactly when the triangle with sides p−qp-q, mm, nn does, and since all four lengths lie between 55 and 1010 this reduces to the single condition ∣p−q∣>∣m−n∣|p - q| > |m - n|.

image

Slide one leg along the parallel sides: cutting off a parallelogram from the trapezium leaves a triangle with sides p−qp - q, mm and nn. So a non-degenerate trapezium with parallel sides p>qp > q and legs m,nm, n exists precisely when ∣m−n∣<p−q<m+n,|m - n| < p - q < m + n, and it is then determined up to congruence. The reason is that the construction reverses: the triangle on sides p−qp-q, mm, nn is fixed up to congruence by its three sides, and gluing a parallelogram with sides qq and mm onto it along the side of length mm rebuilds the trapezium, with no freedom left. Swapping the two legs merely produces the mirror image.

The right-hand inequality never fails here. All four lengths lie in {5,…,10}\{5, \ldots, 10\}, so p−q≤5p - q \le 5 while m+n≥11m + n \ge 11. The condition is therefore just ∣p−q∣>∣m−n∣.|p - q| > |m - n|.

Now count. Choose four distinct lengths from the six available, in (64)=15\binom64 = 15 ways, and split them into two pairs, which can be done in 33 ways. For each such split, one pair must be the parallel sides and the other the legs, and the condition says the parallel pair is the one with the larger difference. So each split contributes exactly one trapezium, unless the two pairs have equal differences, in which case it contributes none.

That leaves us counting the splits with equal differences. A split into two disjoint pairs with a common difference dd is a choice of two disjoint pairs from {5,…,10}\{5,\ldots,10\} each with difference dd: dpairs availabledisjoint choices1(5,6),(6,7),(7,8),(8,9),(9,10)(52)−4=62(5,7),(6,8),(7,9),(8,10)(42)−2=43(5,8),(6,9),(7,10)(32)=34(5,9),(6,10)15(5,10)0\begin{array}{c|c|c} d & \text{pairs available} & \text{disjoint choices} \\ \hline 1 & (5,6),(6,7),(7,8),(8,9),(9,10) & \binom52 - 4 = 6 \\ 2 & (5,7),(6,8),(7,9),(8,10) & \binom42 - 2 = 4 \\ 3 & (5,8),(6,9),(7,10) & \binom32 = 3 \\ 4 & (5,9),(6,10) & 1 \\ 5 & (5,10) & 0 \end{array} In the first two rows the subtracted terms are the choices sharing an endpoint. The total is 6+4+3+1=146 + 4 + 3 + 1 = 14.

Hence the number of trapeziums is 15⋅3−14=45−14=31.15 \cdot 3 - 14 = 45 - 14 = 31.

Answer 31

Solution: IOQM 2026, Q22

Key idea

Count the arrangements of the six blocks and then correct for repeats. A string arises twice only when the single 11 sits just before the single 00, or the single 22 just before the single 33, because then the pair can swap roles with the block.

One string can come from different block orders. For example, all four rows below produce 1010232310102323, with brackets showing the original six blocks: [10][1][0][23][2][3][1][0][10][23][2][3][10][1][0][2][3][23][1][0][10][2][3][23]\begin{array}{llllll} {}[10]&[1]&[0]&[23]&[2]&[3]\\ {}[1]&[0]&[10]&[23]&[2]&[3]\\ {}[10]&[1]&[0]&[2]&[3]&[23]\\ {}[1]&[0]&[10]&[2]&[3]&[23] \end{array} The six blocks can be arranged in 6!=7206! = 720 ways, each giving an eight-digit string. Two arrangements give the same string only through a repeated pattern. A 00 directly after a 11 is either the second digit of the block 1010 or the single 00 placed right after the single 11, and in the second case the glued pair and the block can exchange roles without changing the string. The same is true of 2323. So a string is made by one arrangement, or two, or four when both repeats happen.

Gluing the single 11 to a single 00 after it leaves five units, 5!=1205! = 120 arrangements, and the same for 22 before 33; both at once is 4!=244! = 24. Sorting the 720720 arrangements:

  • neither repeat: 720−120−120+24=504720 - 120 - 120 + 24 = 504 arrangements, 504504 strings;

  • only the 1010 repeat: 120−24=96120 - 24 = 96 arrangements, each string twice, 4848 strings;

  • only the 2323 repeat: likewise 4848 strings;

  • both: 2424 arrangements, each string four times, 66 strings.

That is 504+48+48+6=606504 + 48 + 48 + 6 = 606 different strings.

A string starts with 00 exactly when the single 00 comes first. The other five blocks then follow in 5!=1205! = 120 orders, and only the 2323 repeat can occur: 2424 arrangements give 1212 strings and the other 9696 give 9696, so 108108 strings start with 00. Hence N=606−108=498,N = 606 - 108 = 498, and the sum of its digits is 4+9+8=214 + 9 + 8 = 21.

Answer 21

Solution: IOQM 2022, Q24

Key idea

Differences avoid multiples of six exactly when the four counts occupy four different remainders modulo six. The total 5252 then decides which two remainders are left out, and only three pairs qualify.

Two counts differ by a multiple of 66 precisely when they agree modulo 66, so the condition says the four box-counts lie in four distinct remainder classes modulo 66. Since there are six classes, exactly two are unused, and the sum decides which.

All six remainders together sum to 0+1+2+3+4+5=15≡3(mod6)0+1+2+3+4+5 = 15 \equiv 3 \pmod 6, while our four counts must total 52≡4(mod6)52 \equiv 4 \pmod 6. So the two omitted remainders sum to 3−4≡5(mod6)3 - 4 \equiv 5 \pmod 6, and the unordered pairs of distinct remainders summing to 55 are {0,5},{1,4},{2,3}.\{0,5\}, \qquad \{1,4\}, \qquad \{2,3\}. Three cases, and in each the set of four remainders is determined.

Within a case, assign the four remainders to the four distinguishable boxes in 4!=244! = 24 ways, then count the balls. If a box must hold a count congruent to rr modulo 66 and at least 11, write that count as r′+6kr' + 6k where r′r' is the least positive representative, so r′=6r' = 6 when r=0r = 0 and r′=rr' = r otherwise, and k≥0k \geq 0. Summing, ∑r′+6∑k=52\sum r' + 6\sum k = 52.

For the omitted pair {0,5}\{0,5\} the remainders are {1,2,3,4}\{1,2,3,4\} with ∑r′=10\sum r' = 10, so ∑k=7\sum k = 7 and the number of non-negative solutions is (103)=120\binom{10}{3} = 120. For {1,4}\{1,4\} the remainders are {0,2,3,5}\{0,2,3,5\} with ∑r′=6+2+3+5=16\sum r' = 6+2+3+5 = 16, so ∑k=6\sum k = 6 and the count is (93)=84\binom{9}{3} = 84. For {2,3}\{2,3\} the remainders are {0,1,4,5}\{0,1,4,5\}, again with ∑r′=16\sum r' = 16 and count 8484.

Multiplying by the 2424 assignments, N=24 (120+84+84)=24⋅288=6912.N = 24\,(120 + 84 + 84) = 24 \cdot 288 = 6912. Writing 6912=100⋅69+126912 = 100 \cdot 69 + 12 gives a=69a = 69 and b=12b = 12, both below 100100, so a+b=81a + b = 81.

Answer 81

Solution: IOQM 2023, Q22

Key idea

Four cevians cut the triangle into 55 regions plus one extra for each interior crossing, so nine regions means exactly four crossings, and that happens either when the pegs split two and two between two sides, or when three cevians happen to be concurrent.

Three cevians meeting at P , with the side points used in the area argument.
Three cevians meeting at PP, with the side points used in the area argument.

Cevians from the same vertex meet only at that vertex, which is on the boundary; cevians from different vertices always cross inside. A family of chords cuts a convex region into 1+(number of chords)+∑p(mp−1)1 + (\text{number of chords}) + \sum_{p} \bigl(m_p - 1\bigr) pieces, the sum being over interior intersection points and mpm_p being the number of chords through pp. To see why, draw the chords one at a time: a new chord is cut by the points where it meets earlier chords into pieces, and each piece splits one region in two, so it adds one region more than the number of new crossing points on it. A point where mpm_p chords meet is met mp−1m_p - 1 times in this way, by every chord through it except the first. With four cevians this reads 5+∑p(mp−1)5 + \sum_p (m_p - 1), so nine regions means ∑p(mp−1)=4.\sum_p (m_p - 1) = 4. A simple crossing contributes 11 and a point where three cevians meet contributes 22.

Suppose the four chosen pegs lie nAn_A, nBn_B, nCn_C to a side, with nA+nB+nC=4n_A + n_B + n_C = 4. The number of crossing pairs, before worrying about concurrency, is (42)−(nA2)−(nB2)−(nC2)=6−(nA2)−(nB2)−(nC2).\binom42 - \binom{n_A}2 - \binom{n_B}2 - \binom{n_C}2 = 6 - \binom{n_A}2 - \binom{n_B}2 - \binom{n_C}2.

Distribution (2,2,0)(2,2,0). The subtracted terms give 1+1=21 + 1 = 2, leaving 44 crossing pairs. Three concurrent cevians would have to come from three different vertices, which is impossible here, so the count of 44 is exact and every such choice gives nine regions. There are (32)=3\binom32 = 3 ways to choose the two sides and (52)=10\binom52 = 10 ways to choose two pegs on each, so this contributes 3⋅10⋅10=3003 \cdot 10 \cdot 10 = 300.

Distribution (2,1,1)(2,1,1). The subtracted term is 11, leaving 55 crossing pairs, which gives ten regions unless three cevians are concurrent. Concurrency makes three of those pairs meet at a single point, which contributes 22 to the sum in place of 33, so the sum drops from 55 to 44, and that is exactly what we want. So we need choices in which three cevians, one from each vertex, are concurrent.

When three cevians pass through one point

What decides concurrency is the three ratios in which the cevians cut the opposite sides, and the relation between them can be got with nothing but areas. Suppose cevians ADAD, BEBE, CFCF meet at an interior point PP. Triangles ABDABD and ACDACD share the apex AA and have bases BDBD and DCDC on one line, so their areas are in the ratio BD:DCBD : DC; the same is true of PBDPBD and PCDPCD. Subtracting, BDDC=[ABD]−[PBD][ACD]−[PCD]=[ABP][ACP],\frac{BD}{DC} = \frac{[ABD] - [PBD]}{[ACD] - [PCD]} = \frac{[ABP]}{[ACP]}, and the two companion statements are obtained by relabelling. Multiplying all three, every area appears once above and once below, so BDDC⋅CEEA⋅AFFB=1.\frac{BD}{DC} \cdot \frac{CE}{EA} \cdot \frac{AF}{FB} = 1. The converse follows at once: if the product is 11 and the first two cevians meet at PP, then the line from the third vertex through PP cuts its side in a ratio forced to equal the third factor, so it is the third cevian. This relation, in both directions, is Ceva’s theorem.

Counting the concurrent triples

Let the cevian from AA meet BCBC at distance xx from BB, the cevian from BB meet CACA at distance yy from CC, and the cevian from CC meet ABAB at distance zz from AA, with x,y,z∈{1,2,3,4,5}x, y, z \in \{1,2,3,4,5\}. They are concurrent exactly when x6−x⋅y6−y⋅z6−z=1.\frac{x}{6-x} \cdot \frac{y}{6-y} \cdot \frac{z}{6-z} = 1. The five available ratios are 15,12,1,2,5\tfrac15, \tfrac12, 1, 2, 5 for x=1,2,3,4,5x = 1,2,3,4,5. A product of three of them, with repetition allowed, equals 11 only as 1⋅1⋅1,15⋅5⋅1,12⋅2⋅1,1 \cdot 1 \cdot 1, \qquad \tfrac15 \cdot 5 \cdot 1, \qquad \tfrac12 \cdot 2 \cdot 1, giving 1+3!+3!=131 + 3! + 3! = 13 concurrent triples.

Each such triple is completed to a set of four pegs by adding one more peg, which may be any of the four unused pegs on any of the three sides, so 1212 ways. No set of four is counted twice, because two concurrent triples inside one such set would share the two single cevians and use the two cevians from the doubled vertex, forcing those two to meet at an interior point, which they do not. This contributes 13⋅12=15613 \cdot 12 = 156.

The other distributions. (3,1,0)(3,1,0) leaves 33 crossings and (4,0,0)(4,0,0) leaves none, and in neither can three cevians be concurrent, so both give fewer than nine regions.

Hence N=300+156=456N = 300 + 156 = 456, and the sum of the squares of the digits is 16+25+36=7716 + 25 + 36 = 77.

Answer 77

Solution: IOQM 2025 Part SEP, Q28

Key idea

With the shortest at one end and the tallest at the other, exactly one dip means the line rises to a peak, falls to a valley and rises again; choosing the valley’s height and then which taller people sit before it counts everything.

Number the heights 11 through 1010, so the line begins with 11 and ends with 1010. Between consecutive people the height either rises or falls, and the first and last comparisons are both rises. Along such a word, peaks and valleys alternate and there are as many of each, so exactly one valley means exactly one peak. The line therefore rises to a peak, falls to a valley, and rises to the end.

Here is one such line, with the three runs marked: 1, 3, 7, 9⏟up to the peak ∣ 9, 2⏟down to the valley ∣ 2, 4, 5, 6, 8, 10⏟up to the end\underbrace{1,\ 3,\ 7,\ 9}_{\text{up to the peak}}\ \big|\ \underbrace{9,\ 2}_{\text{down to the valley}}\ \big|\ \underbrace{2,\ 4,\ 5,\ 6,\ 8,\ 10}_{\text{up to the end}} The peak is 99, the valley is 22, and every line being counted has this shape. Keep it in view while the general count is set up.

Now count. Let vv be the height at the valley. It cannot be 11 or 1010, since those two stand at the ends, so v∈{2,3,…,9}.v \in \{2, 3, \ldots, 9\}. Everyone shorter than vv must stand in the first rising run, since the falling run bottoms out at vv and the final run starts at vv. Everyone taller than vv is in one of three places, and the tallest person is fixed at the very end, so the free ones are the heights v+1,…,9v+1, \ldots, 9, of which there are 9−v9-v.

Let UU be the set of those free heights that go into the first two runs, so the rest join the final run. The set UU cannot be empty, since the peak lies in it, and the peak is forced to be max⁡U\max U. Every other member of UU may be placed either in the rising run or in the falling run, freely, and once the sets are known the order within each run is forced. So a set UU of size uu contributes 2u−12^{u-1} lines, and N=∑v=29 ∑u≥1(9−vu)2u−1=∑v=2939−v−12,N = \sum_{v=2}^{9}\ \sum_{u \ge 1} \binom{9-v}{u} 2^{u-1} = \sum_{v=2}^{9} \frac{3^{9-v} - 1}{2}, using ∑u(mu)2u=3m\sum_u \binom mu 2^u = 3^m with the u=0u = 0 term removed. Writing k=9−vk = 9-v, which runs from 00 to 77, N=12(∑k=073k−8)=12(38−12−8)=3280−82=1636.N = \frac12\left(\sum_{k=0}^{7}3^k - 8\right) = \frac12\left(\frac{3^8-1}{2} - 8\right) = \frac{3280 - 8}{2} = 1636.

So N=1636=100⋅16+36N = 1636 = 100 \cdot 16 + 36, giving a=16a = 16, b=36b = 36 and a+b=52a + b = 52.

Answer 52

Report an error on this page

Reports are stored by Netlify. See the privacy note.