Input a positive multiple of 3 (trick: the sum of the digits of that integer should be a multiple of 3). Example: 24. The program calculates the sum of the cubes of the digits: 23 + 43 = 8 + 64 = 72. This procedure is repeated using the new number: 73 + 23 = 343 + 8 = 351. Again: 33 + 53 + 13 = 27 + 125 + 1 = 153. Again: 13 + 53 + 33 = 1 + 125 + 27 =153. The sequence is then: 24, 72, 351, 153, 153. Curiosity: for any multiple of 3 the sequence always falls into the cycle 153, 153. You can verify it below.
Input positive integer (multiple of 3):