2026 AIME II Problem 14

Below is the professionally curated solution for Problem 14 of the 2026 AIME II, from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2026 AIME II solutions, or check the answer key.

All of the real AMC 8, AMC 10, AMC 12, and AIME problems in our complete solution collection are used with official legal permission of the Mathematical Association of America (MAA).

Concepts:custom operationpartitions and compositionsparitycasework

Difficulty rating: 3370

14.

For integers aa and b,b, let ab=aba \circ b = a - b if aa is odd and bb is even, and ab=a+ba \circ b = a + b otherwise. Find the number of sequences a1,a2,a3,,ana_1, a_2, a_3, \ldots, a_n of positive integers such that a1+a2+a3++an=12anda1a2a3an=0,a_1 + a_2 + a_3 + \cdots + a_n = 12 \quad \text{and} \quad a_1 \circ a_2 \circ a_3 \circ \cdots \circ a_n = 0, where the operations are performed from left to right; that is, a1a2a3a_1 \circ a_2 \circ a_3 means (a1a2)a3.(a_1 \circ a_2) \circ a_3.

Solution:

Since aba+b(mod2),a - b \equiv a + b \pmod 2, the running value after kk steps has the same parity as a1++ak.a_1 + \cdots + a_k. So term aka_k is subtracted exactly when aka_k is even and the prefix sum a1++ak1a_1 + \cdots + a_{k-1} is odd, and the final value is 1212 minus twice the total of the subtracted terms. We must count compositions of 1212 in which the even terms sitting where the prefix sum is odd total exactly 6.6. The prefix parity flips exactly at odd terms, so the odd terms come in 2m2m (the total is even), and the subtracted terms are precisely the even terms lying between the (2i1)(2i-1)st and 2i2ith odd terms; these mm "odd stretches" must hold even terms totaling 6,6, while the other m+1m + 1 stretches hold even terms totaling 6A,6 - A, where AA is the sum of the odd terms.

Let fr(t)f_r(t) be the number of ways to fill rr ordered stretches with sequences of even terms totaling 2t.2t. One stretch is a composition of 2t2t into even parts, i.e. of t:t: f1(t)=2t1f_1(t) = 2^{t-1} for t1t \ge 1 and f1(0)=1;f_1(0) = 1; convolving gives the values needed below: fr(0)=1,f_r(0) = 1, fr(1)=r,f_r(1) = r, f2(2)=5,f_2(2) = 5, and f1(3),f2(3),f3(3)=4,12,25.f_1(3), f_2(3), f_3(3) = 4, 12, 25. Compositions of AA into 2m2m odd parts number ((A2m)/2+2m12m1).\binom{(A - 2m)/2 + 2m - 1}{2m - 1}.

Casework on mm and A:A: for m=1:m = 1: A=2,4,6A = 2, 4, 6 give 14f2(2)=20,1 \cdot 4 \cdot f_2(2) = 20, 24f2(1)=16,2 \cdot 4 \cdot f_2(1) = 16, and 341=12.3 \cdot 4 \cdot 1 = 12. For m=2:m = 2: A=4,6A = 4, 6 give 112f3(1)=361 \cdot 12 \cdot f_3(1) = 36 and 4121=48.4 \cdot 12 \cdot 1 = 48. For m=3:m = 3: A=6A = 6 gives 1251=25.1 \cdot 25 \cdot 1 = 25. The total is 20+16+12+36+48+25=157.20 + 16 + 12 + 36 + 48 + 25 = 157.

← Problem 13Full ExamProblem 15

Problem 14 in Other Years