1998 AIME Problem 5

Attempt Problem 5 of the 1998 AIME 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 1998 AIME solutions, or check the answer key.

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

5.

Given that Ak=k(k−1)2cos⁡k(k−1)π2,A_k = \frac{k(k - 1)}{2}\cos\frac{k(k - 1)\pi}{2}, find ∣A19+A20+⋯+A98∣.|A_{19} + A_{20} + \cdots + A_{98}|.
Answer: 40
Concepts:triangular numberparitysummationpairing and grouping
Small hint:
k(k−1)2\frac{k(k-1)}{2} is an integer, so each cosine is ±1,\pm 1, with sign depending only on k mod 4k \bmod 4
Big hint:
Group the 8080 terms into consecutive blocks of four starting at k=19;k = 19; consecutive triangular numbers differ by k,k, so each block collapses
Solution:
Since k(k−1)k(k-1) is even, nk=k(k−1)2n_k = \frac{k(k-1)}{2} is an integer and cos⁡k(k−1)π2\cos\frac{k(k-1)\pi}{2} =cos⁡(nkπ)= \cos(n_k \pi) =(−1)nk.= (-1)^{n_k}. The parity of the triangular number nkn_k depends only on k mod 4:k \bmod 4: it is even for k≡0,1(mod4)k \equiv 0, 1 \pmod 4 and odd for k≡2,3(mod4).k \equiv 2, 3 \pmod 4. So Ak=nkA_k = n_k when k≡0,1(mod4)k \equiv 0, 1 \pmod 4 and Ak=−nkA_k = -n_k when k≡2,3(mod4).k \equiv 2, 3 \pmod 4.
Group the 8080 terms into 2020 consecutive blocks of four starting at k=19≡3(mod4).k = 19 \equiv 3 \pmod 4. Using nj+1−nj=j,n_{j+1} - n_j = j, each block with k≡3(mod4)k \equiv 3 \pmod 4 collapses: Ak+Ak+1+Ak+2+Ak+3=(nk+1−nk)−(nk+3−nk+2)=k−(k+2)=−2. \begin{aligned} &A_k + A_{k+1} \\ &\quad {}+ A_{k+2} + A_{k+3} \\ &= (n_{k+1} - n_k) \\ &\quad {}- (n_{k+3} - n_{k+2}) \\ &= k - (k + 2) \\ &= -2. \end{aligned}
The total is 20⋅(−2)=−40,20 \cdot (-2) = -40, so the requested absolute value is 40.40.
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.