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-6 of 6 results.

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

A067178 Smallest square whose sum of digits is A056991(n).

Original entry on oeis.org

1, 4, 16, 9, 64, 49, 169, 576, 289, 1849, 4489, 3969, 17956, 6889, 27889, 69696, 98596, 97969, 499849, 1887876, 698896, 2778889, 4999696, 9696996, 19998784, 46689889, 66699889, 79869969, 277788889, 478996996, 876988996, 3679999569, 1749999889
Offset: 1

Views

Author

Amarnath Murthy, Jan 09 2002

Keywords

Comments

The smallest square giving a possible digit sum.

Crossrefs

Extensions

Corrected and extended by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 24 2003
Offset corrected. - R. J. Mathar, Aug 26 2009

A369953 a(n) is the least integer k such that the sum of the digits of k^2 is 9*n.

Original entry on oeis.org

0, 3, 24, 63, 264, 1374, 3114, 8937, 60663, 94863, 545793, 1989417, 5477133, 20736417, 82395387, 260191833, 706399164, 2428989417, 9380293167, 28105157886, 99497231067, 538479339417, 1974763271886, 4472135831667, 14106593458167, 62441868958167, 244744764757083, 836594274358167
Offset: 0

Views

Author

Zhining Yang, Feb 06 2024

Keywords

Comments

3|a(n).

Examples

			a(3)=63 because k=63 is the least integer k such that the sum of the digits of k^2 = 3969 is 9*3 = 27 (3+9+6+9 = 27).
		

Crossrefs

Programs

  • Mathematica
    n=1;lst={};For[k=0,k<10^8,k+=3,If[Total[IntegerDigits[k^2]]==9*n,AppendTo[lst,k];n++]];lst
  • PARI
    a(n) = my(k=0); while(sumdigits(k^2) != 9*n, k+=3); k; \\ Michel Marcus, Feb 17 2024
  • Python
    n=1
    lst=[]
    for k in range(0,10**8,3):
        if sum(int(d) for d in str(k*k))==9*n:
            lst.append(k)
            n=n+1
    print(lst)
    

Formula

a(n) = A067179(4n).

Extensions

a(19)-a(27) from Zhao Hui Du, Feb 09 2024

A370522 a(n) is the least n-digit number whose square has the maximum sum of digits (A348300(n)).

Original entry on oeis.org

7, 83, 836, 8937, 94863, 987917, 9893887, 99477133, 994927133, 9380293167, 99497231067, 926174913167, 9892825177313, 89324067192437, 943291047332683, 9949874270443813, 83066231922477313, 707106074079263583, 9429681807356492126, 94180040294109027313, 888142995231510436417, 8882505274864168010583
Offset: 1

Views

Author

Zhining Yang, Feb 21 2024

Keywords

Comments

a(n) is the last n-digit term in A067179.
As the last two of the only nine known numbers whose square has a digit mean above 8.25 (see A164841), there is a high probability that a(30)=314610537013606681884298837387 and a(31)=9984988582817657883693383344833.

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

Crossrefs

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

A369955 a(n) is the least integer m such that the sum of the digits of m^2 is 9*(k+n) where k is the number of digits of m.

Original entry on oeis.org

3, 63, 3114, 8937, 94863, 5477133, 82395381, 706399164, 9380293167, 99497231067, 4472135831667, 62441868958167, 836594274358167, 9983486364492063, 435866837461509417, 707106074079263583, 77453069648658793167, 754718284918279954614, 8882505274864168010583
Offset: 0

Views

Author

Zhining Yang, Feb 06 2024

Keywords

Comments

3|a(n).

Examples

			a(2)=3114 because 3114 is the least 4-digit integer whose square has digit sum 9*(4+2) = 9*6 = 54: 3114^2 = 9696996 and 9+6+9+6+9+9+6 = 54.
		

Crossrefs

Programs

  • Mathematica
    n=0;For[k=0,k<10^8/3,k++,If[Total[IntegerDigits[9k^2]]==9*(n+Ceiling@Log10@(3k)),Print[{n,3k}];n++]]
  • PARI
    a(n) = my(m=1); while (sumdigits(m^2) != 9*(#Str(m)+n), m++); m; \\ Michel Marcus, Feb 10 2024
  • Python
    def sd(n):
        return sum(int(d) for d in str(n*n))
    n=0
    for k in range(0,10**8,3):
        if sd(k)==9*(len(str(k))+n):
            print([n,k])
            n+=1
    

Extensions

a(9)-a(18) from Zhao Hui Du, Feb 19 2024

A358702 a(n) is the least k > 0 such that the sum of the decimal digits of k^2 is n, or 0 if no such k exists.

Original entry on oeis.org

1, 0, 0, 2, 0, 0, 4, 0, 3, 8, 0, 0, 7, 0, 0, 13, 0, 24, 17, 0, 0, 43, 0, 0, 67, 0, 63, 134, 0, 0, 83, 0, 0, 167, 0, 264, 314, 0, 0, 313, 0, 0, 707, 0, 1374, 836, 0, 0, 1667, 0, 0, 2236, 0, 3114, 4472, 0, 0, 6833, 0, 0, 8167, 0, 8937, 16667, 0, 0, 21886, 0, 0, 29614
Offset: 1

Views

Author

Hugo Pfoertner, Dec 04 2022

Keywords

Crossrefs

The nonzero terms are A067179.
Cf. A056991, A231897 (similar for binary weight).
Showing 1-6 of 6 results.