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.

A342260 a(n)^2 is the least square that, when written in base n, has exactly n digits n-1.

Original entry on oeis.org

3, 31, 217, 268, 8399, 29110, 711243, 4676815, 31622764, 376863606, 12638826343, 38121744938, 1511790122972, 8648472039419, 243625577528103
Offset: 2

Views

Author

Hugo Pfoertner, Apr 04 2021

Keywords

Comments

17^(25/2) < a(17) <= 4159201115231103. - Martin Ehrenstein, Jul 10 2021

Examples

			a(2) = 3: 3^2 = 9 is the least square with 2 binary ones: 1001;
a(3) = 31: 31^2 = 961 is the least square with 3 ternary digits 2: 1022121;
a(4) = 217: 217^2 = 47089 = 23133301_4;
a(5) = 268: 268^2 = 71824 = 4244244_5.
		

Crossrefs

Programs

  • PARI
    isok(k, n) = #select(x->(x==n-1), digits(k^2, n)) == n;
    a(n) = my(k=1); while (!isok(k, n), k++); k; \\ Michel Marcus, Apr 05 2021
    
  • Python
    from sympy.ntheory.factor_ import digits
    def A342260(n):
        k = 1
        while digits(k**2,n).count(n-1) != n:
            k += 1
        return k # Chai Wah Wu, Apr 05 2021

Formula

a(n) <= n^(n+1) - 1. - Bert Dobbelaere, Apr 20 2021

Extensions

a(14) from Martin Ehrenstein, Apr 17 2021
a(15) from Bert Dobbelaere, Apr 20 2021
a(16) from Martin Ehrenstein, Apr 21 2021

A342546 a(n)^2 is the least square with exactly n 1's in base n.

Original entry on oeis.org

3, 7, 73, 141, 1417, 17130, 11677, 187955, 10252371, 20440221, 1550384575, 10645648530, 80224807014, 829050923579, 17071371319785, 599574561430568
Offset: 2

Views

Author

Hugo Pfoertner, Apr 07 2021

Keywords

Examples

			   n     a(n)          a(n)^2    in base n
   2        3               9    1001
   3        7              49    1211
   4       73            5329    1103101
   5      141           19881    1114011
   6     1417         2007889    111011441
   7    17130       293436900    10162113111
   8    11677       136352329    1010111111
   9   187955     35327082025    111160121111
  10 10252371 105111111121641    105111111121641
		

Crossrefs

Programs

  • PARI
    for(b=2,10,for(k=1,oo,my(s=k^2,d=digits(s,b));if(sum(k=1,#d,d[k]==1)==b,print1(k,", ");break)))
    
  • Python
    from sympy import integer_nthroot
    from numba import njit
    @njit # works with 64 bits through a(12)
    def digits1(n, b):
      count1 = 0
      while n >= b:
        n, r = divmod(n, b)
        count1 += (r==1)
      return count1 + (n==1)
    def a(n):
      an = integer_nthroot(n**(n-1), 2)[0] + 1
      while digits1(an*an, n) != n: an += 1
      return an
    print([a(n) for n in range(2, 10)]) # Michael S. Branicky, Apr 07 2021

Extensions

a(14) from Chai Wah Wu, Apr 14 2021
a(15)-a(16) from Giovanni Resta, Apr 17 2021
a(17) from Martin Ehrenstein, May 29 2021
Showing 1-2 of 2 results.