#t20. 寻找自然数的数字陷阱过程
寻找自然数的数字陷阱过程
The Number Trap
Problem Description
For any natural number , first add up its digits to get a sum, then multiply that sum by and add to obtain a new natural number ; repeating this operation produces . After enough steps the result stops changing and falls into a numerical "trap". This problem asks you to output the whole process of the input number falling into the trap.
(Terminology: adding up the digits means summing every digit in the decimal representation of the number — for example, the digit sum of is .)
Input Format
One line containing a natural number ().
Output Format
Output the steps of falling into the trap, one step per line. The -th line has the format i:N_i (). Stop outputting as soon as some step equals the previous step .
Sample Input
5
Sample Output
1:16
2:22
3:13
4:13