MathDB
A hard function/sequence

Source: AIME 2004 #15

November 27, 2005
AMCAIMEfunction

Problem Statement

For all positive integers x x, let f(x) \equal{} \begin{cases}1 & \text{if }x \equal{} 1 \\ \frac x{10} & \text{if }x\text{ is divisible by 10} \\ x \plus{} 1 & \text{otherwise}\end{cases}and define a sequence as follows: x_1 \equal{} x and x_{n \plus{} 1} \equal{} f(x_n) for all positive integers n n. Let d(x) d(x) be the smallest n n such that x_n \equal{} 1. (For example, d(100) \equal{} 3 and d(87) \equal{} 7.) Let m m be the number of positive integers x x such that d(x) \equal{} 20. Find the sum of the distinct prime factors of m m.