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.

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

This page as a plain text file.
%I A348300 #80 Feb 03 2025 00:13:21
%S A348300 13,31,46,63,81,97,112,130,148,162,180,193,211,229,244,262,277,297,
%T A348300 310,331,343,360,378,396
%N A348300 a(n) is the largest number that is the digit sum of the square of an n-digit number.
%C A348300 18*n-a(n) appears to be nondecreasing. - _Chai Wah Wu_, Nov 18 2021
%C A348300 According to new data 18*n-a(n) sometimes decreases. - _David A. Corneth_, Feb 21 2024
%C A348300 a(n) is the digit sum of the square of the last n-digit integer in A067179. - _Zhao Hui Du_, Mar 04 2024
%C A348300 a(n) appears to be approximately equal to 16.5*n. - _Zhining Yang_, Mar 12 2024
%C A348300 a(n) modulo 9 is either 0, 1, 4 or 7. - _Chai Wah Wu_, Apr 04 2024
%F A348300 a(n) = Max_{k=10^(n-1)..10^n-1} A004159(k).
%e A348300 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.
%t A348300 Array[Max@ Map[Total@ IntegerDigits[#^2] &, Range[10^(# - 1), 10^# - 1]] &, 8] (* _Michael De Vlieger_, Oct 12 2021 *)
%o A348300 (Sage)
%o A348300 def A348300(n):
%o A348300     return max(sum((k^2).digits()) for k in (10^(n-1)..10^n-1))
%o A348300 (Python)
%o A348300 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
%Y A348300 Cf. A004159, A348303, A370522.
%Y A348300 Cf. A371728.
%K A348300 nonn,base,more
%O A348300 1,1
%A A348300 _Bernardo Recamán_ and _Freddy Barrera_, Oct 10 2021
%E A348300 a(11) from _Chai Wah Wu_, Nov 18 2021
%E A348300 a(12)-a(13) from _Martin Ehrenstein_, Nov 20 2021
%E A348300 a(14)-a(24) from _Zhao Hui Du_, Feb 23 2024
%E A348300 Name edited by _Jon E. Schoenfield_, Mar 10 2024