108. Self-numbers 2
time limit per test: 0.5 sec.
memory limit per test: 4096 KB
In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands fordigitadition, a term coined by Kaprekar.)
For example, d(75) = 75 + 7 + 5 = 87. Given any positive integer n as a starting point, you can construct the infinite increasing sequence of integers n, d(n), d(d(n))......
阅读全文