cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A379298 Largest number k for which k^2 is n digits long and has the maximum sum of digits possible for such a square (A371728(n)).

Original entry on oeis.org

3, 7, 28, 83, 313, 937, 3114, 9417, 29614, 94863, 298327, 987917, 3162083, 9893887, 29983327, 99483667, 315432874, 994927133, 2999833327, 9486778167, 31464263856, 99497231067, 299998333327, 999949483667, 3160522105583, 9892825177313, 29999983333327
Offset: 1

Views

Author

Zhining Yang, Feb 05 2025

Keywords

Examples

			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.
		

Crossrefs

Other powers: A380052, A380797, A380566, A380193.

Programs

  • 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}]

Formula

Conjecture: a(2*n) = A348303(n).