A380052 a(n) is the largest number whose cube is an n-digit cube which has the maximum sum of digits (A373727(n)).
2, 4, 9, 19, 46, 92, 208, 453, 942, 1966, 4289, 9949, 12599, 43795, 99829, 215083, 446423, 989353, 2131842, 4081435, 9850783, 20714797, 43967926, 92827483, 190349299, 464110759, 989554129, 2132590453, 4559677342, 9654499999, 21253161559, 31037622999, 99594689449, 181610950229
Offset: 1
Examples
For n=7, among cubes which are 7 digits long the maximum sum of digits is A373727(7) = 46 and this is attained by 3 cubes, the largest of which is 208^3 = 8998912 so that a(7) = 208.
Programs
-
C
/* See A373727. */
-
Mathematica
Table[SortBy[Map[{#, Total@IntegerDigits[#^3]} &, Range[Ceiling@CubeRoot[10^(n - 1)], CubeRoot[10^n - 1]]], Last][[-1]][[1]], {n, 18}]