1997 AMC 12 Problem 21

Attempt Problem 21 of the 1997 AMC 12 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 1997 AMC 12 solutions, or check the answer key.

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

21.

For any positive integer n,n, let f(n)={log⁡8n,log⁡8n∈Q,0,log⁡8n∉Q. f(n)= \begin{cases} \log_8n, & \log_8n\in\mathbb{Q},\\ 0, & \log_8n\notin\mathbb{Q}. \end{cases} What is ∑n=11997f(n)?\displaystyle\sum_{n=1}^{1997}f(n)?
log⁡82047\log_8 2047
66
553\frac{55}{3}
583\frac{58}{3}
585585
Answer: C
Concepts:logarithmsprime factorizationsums
Small hint:
Determine which integers can be rational powers of 8=238=2^3
Big hint:
List the powers of 22 not exceeding 19971997 and sum their base-88 logarithms
Solution:
For integer n,n, log⁡8n\log_8n is rational exactly when nn is a power of 2.2. The relevant values are n=2kn=2^k for 0≤k≤10,0\le k\le10, and f(2k)=k3.f(2^k)=\frac{k}{3}. Therefore the sum is 0+1+⋯+103=553,\frac{0+1+\cdots+10}{3}=\frac{55}{3}, so C is correct.
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.