Tuesday, July 17, 2012

Problem #27

[This problem is worth 7 points.]

Define the function f(x) as follows:

(A) If x = 1, f(x) = 1
(B) If x is divisible by 10, f(x) = x/10
(C) Otherwise, f(x) = x+1

We can then use repeated application of f to generate a sequence from any starting number. So, for example, f(5) = 6, f(6) = 7, f(7) = 8, f(8) = 9, f(9) = 10, f(10) = 1, and f(1) = 1. This produces the sequence 5, 6, 7, 8, 9, 10, 1, 1, 1, ...

We then use this sequence to define a new function d(x). For any x, d(x) is the number of terms in the f-generated sequence until the first occurrence of 1 in the sequence. So from the previous example, we see that d(5) = 7, since the 7th term of the sequence 5, 6, 7, 8, 9, 10, 1, 1, ... is the first 1.

For how many values of x does d(x) = 20?