OFFSET
2,1
LINKS
Rémy Sigrist, Table of n, a(n) for n = 2..148
FORMULA
a(2*n) = 2*n + 2 for any n > 1. - Rémy Sigrist, Sep 29 2022
PROG
(PARI) isok(k, b) = my(s=[]); fordiv(k, d, s=concat(s, digits(d, b)); if (fromdigits(s, b)==k, return(1)); if (fromdigits(s, b)> k, return(0)));
a(n) = my(k=2); while(! isok(k, n), k++); k;
(Python)
from sympy import divisors
from sympy.ntheory import digits
from itertools import count, islice
def ok(n, b):
target, s = digits(n, b)[1:], []
if target[0] != 1: return False
for d in divisors(n):
s += digits(d, b)[1:]
if len(s) >= len(target): return s == target
elif not target[:len(s)] == s: return False
def a(n):
return next(i for d in count(1) for i in range(n**d, 2*n**d) if ok(i, n))
print([a(n) for n in range(2, 41)]) # Michael S. Branicky, Oct 05 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Sep 28 2022
EXTENSIONS
More terms from Rémy Sigrist, Sep 29 2022
STATUS
approved