OFFSET
1,1
FORMULA
Conjecture: a(2*n) = A348303(n).
EXAMPLE
a(6) = 937 because among all 6-digit squares, 698896 = 836^2, 779689 = 883^2, 877969 = 937^2 have the maximum sum of digits 46 = A371728(6), and 937 is the largest.
MATHEMATICA
a[n_] := Module[{s = Floor[Sqrt[(10^n - 1)]], max = 0},
For[k = s, k >= Ceiling[Sqrt[10^(n - 1)]], k--, t = DigitSum[k^2];
If[t > max, s = k; max = t]]; s];
Table[a[n], {n, 30}]
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Zhining Yang, Feb 05 2025
STATUS
approved
