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.

Showing 1-4 of 4 results.

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).

A373914 a(n) is the largest digit sum of all n-digit fourth powers.

Original entry on oeis.org

1, 9, 13, 19, 25, 37, 43, 52, 55, 70, 76, 79, 85, 99, 103, 108, 118, 127, 135, 142, 144, 153, 171, 166, 178, 181, 189, 198, 205, 211, 220, 232, 234, 243, 252, 261, 265, 274, 279, 283, 297, 298, 313, 316, 325, 334, 337, 346, 358
Offset: 1

Views

Author

Zhining Yang, Jun 22 2024

Keywords

Examples

			a(3) = 13 because 13 is the largest digital sum encountered among all 3-digit fourth powers (attained at both fourth powers: 256, 625).
		

Crossrefs

Programs

  • C
    /* See links. */
  • Mathematica
    Table[Max@Map[Total@IntegerDigits[#^4] &, Range[Ceiling[10^((n - 1)/4)], Floor[(10^n-1)^(1/4)]]], {n, 32}]
  • PARI
    a(n) = my(m=ceil(10^((n-1)/4)), M=sqrtint(sqrtint(10^n))); vecmax(apply(sumdigits, vector(M-m+1, i, (i+m-1)^4))); \\ Michel Marcus, Jun 23 2024
    
  • Python
    from sympy import integer_nthroot
    def A373914(n): return max(sum(int(d) for d in str(m**4)) for m in range((lambda x:x[0]+(x[1]^1))(integer_nthroot(10**(n-1),4)),1+integer_nthroot(10**n-1,4)[0])) # Chai Wah Wu, Jun 26 2024
    

A348300 a(n) is the largest number that is the digit sum of the square of an n-digit number.

Original entry on oeis.org

13, 31, 46, 63, 81, 97, 112, 130, 148, 162, 180, 193, 211, 229, 244, 262, 277, 297, 310, 331, 343, 360, 378, 396
Offset: 1

Views

Author

Keywords

Comments

18*n-a(n) appears to be nondecreasing. - Chai Wah Wu, Nov 18 2021
According to new data 18*n-a(n) sometimes decreases. - David A. Corneth, Feb 21 2024
a(n) is the digit sum of the square of the last n-digit integer in A067179. - Zhao Hui Du, Mar 04 2024
a(n) appears to be approximately equal to 16.5*n. - Zhining Yang, Mar 12 2024
a(n) modulo 9 is either 0, 1, 4 or 7. - Chai Wah Wu, Apr 04 2024

Examples

			a(3) = 46 because 46 is the largest digital sum encountered among the squares (that of 937) of all 3-digit numbers. Such maximal digital sum can be achieved by more than one square (squares of 836 and 883 also have digital sum 46). Largest of these is A348303.
		

Crossrefs

Programs

  • Mathematica
    Array[Max@ Map[Total@ IntegerDigits[#^2] &, Range[10^(# - 1), 10^# - 1]] &, 8] (* Michael De Vlieger, Oct 12 2021 *)
  • Python
    def A348300(n): return max(sum(int(d) for d in str(m**2)) for m in range(10**(n-1),10**n)) # Chai Wah Wu, Jun 26 2024
  • Sage
    def A348300(n):
        return max(sum((k^2).digits()) for k in (10^(n-1)..10^n-1))
    

Formula

a(n) = Max_{k=10^(n-1)..10^n-1} A004159(k).

Extensions

a(11) from Chai Wah Wu, Nov 18 2021
a(12)-a(13) from Martin Ehrenstein, Nov 20 2021
a(14)-a(24) from Zhao Hui Du, Feb 23 2024
Name edited by Jon E. Schoenfield, Mar 10 2024

A373727 a(n) is the largest number that is the digit sum of an n-digit cube.

Original entry on oeis.org

8, 10, 18, 28, 28, 44, 46, 54, 63, 73, 80, 82, 98, 100, 109, 118, 125, 136, 144, 154, 154, 163, 172, 181, 190, 190, 199, 208, 217, 226, 235, 243, 253, 260, 262, 278
Offset: 1

Views

Author

Zhining Yang, Jun 15 2024

Keywords

Examples

			a(7) = 46 because 46 is the largest digital sum encountered among all 7-digit cubes (attained at 3 cubes: 3869893, 7880599, 8998912).
		

Crossrefs

Other powers: A371728, A373914, A374025, A373994.

Programs

  • C
    /* See links. */
  • Mathematica
    Table[Max@
      Map[Total@IntegerDigits[#^3] &,
       Range[Ceiling@CubeRoot[10^(n - 1)], CubeRoot[10^n - 1]]], {n, 15}]
  • Python
    from sympy import integer_nthroot
    def A373727(n): return max(sum(int(d) for d in str(m**3)) for m in range(1+integer_nthroot(10**(n-1)-1,3)[0],1+integer_nthroot(10**n-1,3)[0])) # Chai Wah Wu, Jun 26 2024
    
Showing 1-4 of 4 results.