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

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

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

Original entry on oeis.org

1, 101, 11, 2, 149, 32, 4, 12, 3, 8, 106, 16, 7, 103, 13, 108, 24, 17, 1019, 124, 43, 1013, 113, 67, 114, 63, 10024, 1024, 133, 83, 1067, 167, 1044, 264, 314, 10087, 1303, 313, 10093, 1183, 707, 1374, 1333, 836, 10343, 1667, 100264, 10714, 2236, 10386, 3114
Offset: 0

Views

Author

Zhining Yang, Feb 06 2024

Keywords

Examples

			a(5)=32 because 32 is the least integer with 2 digits and 32^2=1024 and 1+0+2+4=2+5.
		

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Range@200000,Total[IntegerDigits[#^2]]==n+Length@IntegerDigits@#&],{n,0,50}]
Showing 1-2 of 2 results.