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

A382946 a(n) is the least positive integer k having a proper divisor d such that the base n expansions of k and d, without leading zeros, have, up to order, the same digits, or a(n) = -1 if no such k exists.

Original entry on oeis.org

-1, 64, 36, 16, 700, 36, 42, 64, 3105, 45, 594, 105, 130, 168, 945, 120, 1666, 96, 266, 275, 2457, 231, 460, 351, 450, 273, 7938, 175, 7714, 280, 682, 1024, 308, 459, 7525, 741, 962, 665, 27300, 288, 17097, 560, 1290, 1265, 18540, 1035, 1974, 540, 952, 715
Offset: 2

Views

Author

Rémy Sigrist, Apr 09 2025

Keywords

Comments

Conjecture: a(n) > 0 for any n > 2.

Examples

			The first terms, alongside an appropriate divisor d, in bases 10 and n, are:
  n   a(n)  d     n in base n  d in base n
  --  ----  ----  -----------  -----------
   2    -1  N/A   N/A          N/A
   3    64    32  2,1,0,1      1,0,1,2
   4    36    18  2,1,0        1,0,2
   5    16     8  3,1          1,3
   6   700   350  3,1,2,4      1,3,4,2
   7    36    12  5,1          1,5
   8    42    21  5,2          2,5
   9    64    16  7,1          1,7
  10  3105  1035  3,1,0,5      1,0,3,5
  11    45    15  4,1          1,4
  12   594   198  4,1,6        1,4,6
  13   105    21  8,1          1,8
  14   130    65  9,4          4,9
  15   168    56  11,3         3,11
  16   945   315  3,11,1       1,3,11
		

Crossrefs

Programs

  • PARI
    a(n) = {
        if (n==2, return (-1));
        for (k = 1, oo,
            my (t = vecsort(digits(k, n)));
            fordiv (k, d,
                if (d < k && vecsort(digits(d, n))==t,
                    return (k);););); }
    
  • Python
    from sympy import divisors
    from sympy.ntheory import digits
    from itertools import count
    def a(n):
        if n == 2:
            return -1
        for k in count(2*n):
            divs, kdigs = divisors(k), sorted(digits(k, n)[1:])
            for d in sorted(divs[:-1], reverse=True):
                ddigs = sorted(digits(d, n)[1:])
                if ddigs == kdigs:
                    return k
                if len(ddigs) < len(kdigs):
                    break
    print([a(n) for n in range(2, 52)]) # Michael S. Branicky, Apr 13 2025
Showing 1-1 of 1 results.