第 908 题:(2015 AMC 10a, 18)
Hexadecimal (base-16) numbers are written using numeric digits $0$ through $9$ as well as the letters $A$ through $F$ to represent $10$ through $15$. Among the first $1000$ positive integers, there are $n$ whose hexadecimal representation contains only numeric digits. What is the sum of the digits of $n$?
$\textbf{(A)}\ 17\qquad\textbf{(B)}\ 18\qquad\textbf{(C)}\ 19\qquad\textbf{(D)}\ 20\qquad\textbf{(E)}\ 21$
- $1000=3\cdot256+14\cdot16+8$, so $1000=3E8_{16}$, and all numbers from $1$ to $1000$ have at most three hexadecimal digits.
- A number with only numeric digits has the form $\underline{a}\,\underline{b}\,\underline{c}_{\,16}$ with $a,b,c\in\{0,\dots,9\}$. It is at most $1000$ exactly when $a\le3$: if $a\le3$, the number is at most $399_{16}=921$; if $a\ge4$, it is at least $400_{16}=1024$.
- So there are $4\cdot10\cdot10-1=399$ such numbers (we remove $000$). Hence $n=399$ and its digit sum is $21$.
- The answer is (E).
In base $12$, the digits are $0$ through $9$ together with two letters for $10$ and $11$. Among the first $1000$ positive integers, how many have a base-$12$ representation that uses only the digits $0$ through $9$?