Math (Algebra)
posted by Arnau .
Given a positive integer n, let S(n) denote the digit sum of n. Consider the sequence of numbers given by
n₁ = S(n)
nk = S(nk−1)k≥2
For how many positive integers n ≤ 2013 does the sequence {nk} contain the number 9?

Given a positive integer n, let S(n) denote the digit sum of n. Consider the sequence of numbers given by
n₁ = S(n)
nk = S(nk−1)k≥2
For how many positive integers n ≤ 2013 does the sequence {nk} contain the number 9?