The number associated with my diurnal age today,
- 2 * 7779 = 15558
- 27 * 779 = 21033
- 277 * 79 = 21883
- 2777 * 9 = 24993
We see that 24993 is the maximum product and we repeat the process using this number as our starting point:
- 2 * 4993 = 9986
- 24 * 993 = 23832
- 249 * 93 = 23157
- 2499 * 3 = 7497
The maximum product is 23832 and so this becomes the new number and the process continues until we reach 0 after 22 steps. The progression is as follows (permalink):
27779, 24993, 23832, 19136, 11478, 9176, 6916, 5496, 5184, 4284, 3528, 2816, 1686, 1376, 988, 792, 644, 264, 128, 96, 54, 20, 0
27779 is a member of OEIS A035932: smallest number that takes
0, 1, 11, 26, 39, 77, 117, 139, 449, 529, 777, 1117, 2229, 2982, 4267, 4779, 5319, 5919, 8693, 12699, 14119, 17907, 27779, 47877, 80299, 103199, 135199, 274834, 293938, 312794, 606963, 653993, 773989, 1160892, 1296741, 1616696, 1986576
This permalink will check for the smallest number once the number of steps is specified. When writing the code the convention is that you add a condition to handle single-digit numbers. A common rule for sequences like this that aim to reach 0 is that single-digit numbers (other than 0) map to 0 in the next step. So looking at the above sequence we see following progressions to 0 beginning with 0 that requires zero steps (permalink):
- 0
- 1, 0
- 11, 1, 0
- 26, 12, 2, 0
- 39, 27, 14, 4, 0
- 77, 49, 36, 18, 8, 0
- 117, 77, 49, 36, 18, 8, 0
- 139, 117, 77, 49, 36, 18, 8, 0
- 449, 396, 288, 224, 88, 64, 24, 8, 0
- 529, 468, 368, 288, 224, 88, 64, 24, 8, 0
- 777, 539, 477, 329, 288, 224, 88, 64, 24, 8, 0
- 1117, 777, 539, 477, 329, 288, 224, 88, 64, 24, 8, 0
- 2229, 1998, 1862, 1116, 666, 396, 288, 224, 88, 64, 24, 8, 0
- 2982, 2378, 1896, 1728, 1376, 988, 792, 644, 264, 128, 96, 54, 20, 0
No comments:
Post a Comment