Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
login
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.
3
1, 48, 50, 333, 438, 448, 734217, 6561081
OFFSET
1,2
EXAMPLE
In base 3, 48 is 1210 and its first divisors are 1, 2 and 3, that is, 1, 2 and 10.
PROG
(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
CROSSREFS
Cf. A175252 (base 10), A357428 (base 2).
Sequence in context: A332242 A296872 A364702 * A258694 A328738 A067191
KEYWORD
nonn,base,more
AUTHOR
Michel Marcus, Sep 28 2022
STATUS
approved