A357429 Numbers whose digit representation in base 3 is equal to the digit representation in base 3 of the initial terms of their sets of divisors in increasing order.
1, 48, 50, 333, 438, 448, 734217, 6561081
Offset: 1
Examples
In base 3, 48 is 1210 and its first divisors are 1, 2 and 3, that is, 1, 2 and 10.
Programs
-
PARI
isok(k) = my(s=[]); fordiv(k, d, s=concat(s, digits(d, 3)); if (fromdigits(s, 3)==k, return(1)); if (fromdigits(s, 3)> k, return(0)));
-
Python
from sympy import divisors from sympy.ntheory import digits def ok(n): target, s = "".join(map(str, digits(n, 3)[1:])), "" if target[0] != "1": return False for d in divisors(n): s += "".join(map(str, digits(d, 3)[1:])) if len(s) >= len(target): return s == target elif not target.startswith(s): return False print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Oct 01 2022
Comments