A370522 a(n) is the least n-digit number whose square has the maximum sum of digits (A348300(n)).
7, 83, 836, 8937, 94863, 987917, 9893887, 99477133, 994927133, 9380293167, 99497231067, 926174913167, 9892825177313, 89324067192437, 943291047332683, 9949874270443813, 83066231922477313, 707106074079263583, 9429681807356492126, 94180040294109027313, 888142995231510436417, 8882505274864168010583
Offset: 1
Examples
a(3) = 836 because among all 3-digit numbers, 836 is the smallest whose square 698896 has the maximum sum of digits, 46 = A348300(3).
Links
- Zhining Yang, Table of n, a(n) for n = 1..24 (terms 11..24 from Zhao Hui Du)
Programs
-
Mathematica
A348300={13,31,46,63,81,97,112,130,148,162,180}; A370522[n_]:=Do[If[Total@IntegerDigits[k^2]==A348300[[n]],Return[k];],{k,10^(n-1),10^n-1}]; Table[A370522[n],{n,8}]
-
Python
def A370522(n): A348300=[0,13,31,46,63,81,97,112,130,148,162,180] for k in range(10**(n-1), 10**n): if sum(int(d) for d in str(k**2))==A348300[n]: return(k) print([A370522(n) for n in range(1,9)])
Extensions
a(11)-a(24) from Zhao Hui Du, Feb 23 2024
Comments