Problem:
A function f from the integers to the integers is defined as follows:
f(n)={n+3n/2​ if n is odd if n is even ​
Suppose k is odd and f(f(f(k)))=27. What is the sum of the digits of k?
Answer Choices:
A. 3
B. 6
C. 9
D. 12
E. 15
Solution:
Since k is odd, f(k)=k+3. Since k+3 is even,
f(f(k))=f(k+3)=(k+3)/2
If (k+3)/2 is odd, then
27=f(f(f(k)))=f((k+3)/2)=(k+3)/2+3
which implies that k=45. This is not possible because f(f(f(45)))= f(f(48))=f(24)=12. Hence (k+3)/2 must be even, and
27=f(f(f(k)))=f((k+3)/2)=(k+3)/4
which implies that k=105. Checking, we find that
f(f(f(105)))=f(f(108))=f(54)=27
Hence the sum of the digits of k is 1+0+5=6.