Skip to main content

2026 AIME II Problem 13

Problem 13 of 15HarderNumber TheoryCombinatoricsProblem-Solving Techniques

Call finite sets of integers SS and TT cousins if • SS and TT have the same number of elements, • SS and TT are disjoint, and • the elements of SS can be paired with the elements of TT so that the elements in each pair differ by exactly 1.1. For example, {1,2,5}\{1, 2, 5\} and {0,3,4}\{0, 3, 4\} are cousins. Suppose that the set SS has exactly 40404040 cousins. Find the least number of elements the set SS can have.

Your answer

Integer from 0 to 999
Show solution

Solution

A cousin TT is the image of an injection sending each x∈Sx \in S to x−1x - 1 or x+1,x + 1, landing outside S.S. If x−1,x,x+1∈Sx - 1, x, x + 1 \in S then xx has nowhere to go, so every maximal block of consecutive elements of SS has size 11 or 2.2. A double block {a,a+1}\{a, a+1\} is forced to map to {a−1,a+2},\{a - 1, a + 2\}, while a singleton {a}\{a\} chooses a−1a - 1 or a+1.a + 1. Two blocks can fight over a value only when exactly one integer separates them, so group blocks into chains: consecutive blocks with gaps of exactly one. Within a chain the only consistent patterns are “the first ii blocks shift left and the rest shift right,” since a block choosing right and its successor choosing left would collide; a double block acts as both left and right, forcing the switch to happen exactly at it. Hence a chain of kk singletons produces k+1k + 1 distinct images, a chain containing one double produces exactly 1,1, and a chain with two doubles produces 0.0. Distinct patterns give distinct sets T,T, and choices in different chains are independent, so the number of cousins is the product of (ki+1)(k_i + 1) over the all-singleton chains. We need ∏(ki+1)=4040=23⋅5⋅101\prod (k_i + 1) = 4040 = 2^3 \cdot 5 \cdot 101 while minimizing the element count ∑ki\sum k_i (chains with doubles only waste elements). Replacing a composite factor f=ghf = gh with the two factors g,h≥2g, h \ge 2 strictly lowers the cost, because (g−1)+(h−1)<gh−1.(g - 1) + (h - 1) \lt gh - 1. So the optimum uses the prime factorization: ∑(f−1)=1+1+1+4+100=107, \begin{aligned} &\sum (f - 1) \\ &= 1 + 1 + 1 + 4 + 100 \\ &= 107, \end{aligned} realized by five chains of 1,1,1,4,1001, 1, 1, 4, 100 singletons — runs of every-other integer — placed far apart. The least possible number of elements is 107.107.
AoPS wiki

Tagged: bijection · prime factorization · optimization

More practice