Maths Olympiad Prep

Library / /537 of 740

Algebra Difficulty 5.2 AIME, harder Prove it United States

Problem:
Let ff be a function on nonnegative integers such that f(0)=0f(0)=0 and
f(3n+2)=f(3n+1)=f(3n)+1=3f(n)+1 f(3 n+2)=f(3 n+1)=f(3 n)+1=3 f(n)+1
for all integers n0n \geq 0. Compute the sum of all nonnegative integers mm such that f(m)=13f(m)=13.

Solution

Solution:
Let xk\underline{x}_{k} denote the number xx in base kk. Observe that if f(x3)=y3f\left(\underline{x}_{3}\right)=\underline{y}_{3}, then
f(x03)=f(3x)=3f(x)=y03 f\left(\underline{x 0}_{3}\right)=f(3 x)=3 f(x)=\underline{y 0}_{3}
and
f(x13)=f(x23)=3f(x)+1=y13. f\left(\underline{x 1}_{3}\right)=f\left(\underline{x 2}_{3}\right)=3 f(x)+1=\underline{y 1}_{3} .
Thus, f(n)3\underline{f(n)}_{3} is simply n3\underline{n}_{3} with all 2's replaced with 1's. We also see that 13=111313=111_{3}. Thus, f(m)=13f(m)=13 if and only if m=abc3m=\underline{a b c_{3}} for digits a,b,c{1,2}a, b, c \in\{1,2\}. Each of a,ba, b, and cc takes on each possible value exactly 4 times, so the sum is
(41+42)(32+31+30)=156 (4 \cdot 1+4 \cdot 2)\left(3^{2}+3^{1}+3^{0}\right)=156

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.