2022 AIME II Problem 5

Attempt Problem 5 of the 2022 AIME II below, then check your answer against the professionally curated solution from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2022 AIME II solutions, or check the answer key.

All problems are used with official legal permission of the Mathematical Association of America (MAA).

5.

Twenty distinct points are marked on a circle and labeled 11 through 2020 in clockwise order. A line segment is drawn between every pair of points whose labels differ by a prime number. Find the number of triangles formed whose vertices are among the original 2020 points.
Answer: 72
Concepts:primeparitycasework
Small hint:
For labels i<j<k,i \lt j \lt k, all three differences must be prime, and k−ik - i is the sum of the other two
Big hint:
Two odd primes sum to an even number, so one difference must be 2:2: the differences are 2,p,p+22, p, p + 2 with pp and p+2p + 2 both prime
Solution:
A triangle has vertices i<j<ki \lt j \lt k where j−i,j - i, k−j,k - j, and k−ik - i are all prime. Since k−i=(j−i)+(k−j)k - i = (j - i) + (k - j) is a prime that is a sum of two primes, and the sum of two odd primes is even, one of the two smaller differences must equal 2.2. So the differences are {2,p}\{2, p\} in some order with pp and p+2p + 2 both prime: the twin prime pairs with p+2≤19p + 2 \le 19 are (3,5),(3, 5), (5,7),(5, 7), (11,13),(11, 13), and (17,19).(17, 19).
For each pair, the middle vertex can be at distance 22 or at distance pp from the smallest, and the total span is p+2,p + 2, so there are 2(20−(p+2))2\bigl(20 - (p + 2)\bigr) triangles. This gives 2⋅15=30,2 \cdot 15 = 30, 2⋅13=26,2 \cdot 13 = 26, 2⋅7=14,2 \cdot 7 = 14, and 2⋅1=22 \cdot 1 = 2 for the four pairs.
The total is 30+26+14+2=72.30 + 26 + 14 + 2 = 72.
LIVE by Po-Shen Loh
Programs

LIVE Classes

Self-Paced Classes

Stars

Scholarship

About Us

Who Is Po-Shen Loh?

Email Contact

Newsletter

Jobs

Become a Star

For a more Thought Full world.

© 2026 Expii, Inc.