Question:medium

We define a function \(f\) on the integers: \(f(x) = \dfrac{x}{10}\) if \(x\) is divisible by 10, and \(f(x) = x+1\) if \(x\) is not divisible by 10.
If \(A_0 = 1994\) and \(A_{n+1} = f(A_n)\), what is the smallest \(n\) such that \(A_n = 2\)?

Show Hint

Split the journey into an 'add 1 until a multiple of 10' phase and a 'divide by 10' phase.
Updated On: Jul 13, 2026
  • 9
  • 18
  • 128
  • 1993
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Split the journey into two phases.
Phase 1: keep adding 1 until we reach a multiple of 10, since only a multiple of 10 can be divided.
Phase 2: keep dividing by 10 until we reach the target value 2.

Step 2: Count the steps in Phase 1 using the last digit.
\(A_0 = 1994\) ends in 4, so we are \(10 - 4 = 6\) steps away, in units of add 1, from the next multiple of 10.
Adding 1 six times: \(1994 \to 1995 \to 1996 \to 1997 \to 1998 \to 1999 \to 2000\). This uses steps \(n=1\) through \(n=6\), landing on \(A_6 = 2000\).

Step 3: Count the steps in Phase 2 by counting trailing zeros.
\(2000 = 2 \times 10^3\), so it takes exactly 3 divisions by 10 to strip away the three zeros and reach 2:
\(2000 \to 200 \to 20 \to 2\).
This uses 3 more steps, taking us from \(n=6\) to \(n=9\).

Step 4: Add the two phases.
Total steps \(= 6 + 3 = 9\). Since every intermediate value in both phases is different from 2, and only the last division reaches it, n = 9 is indeed the smallest such index.
\[ \boxed{n = 9} \]
Was this answer helpful?
0


Questions Asked in XAT exam