OFFSET
1,2
COMMENTS
Will every integer appear in the sequence?
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program
EXAMPLE
The first terms are:
n a(n)
-- ----
1 1
2 2
3 4
4 8
5 16
6 6 (6 appears in 16)
7 12
8 24
9 48
10 96
11 9 (9 appears in 96)
12 18
13 36
14 3 (3 appears in 36)
15 15
PROG
(PARI) \\ See Links section.
(Python)
from itertools import combinations, count, islice
def agen(): # generator of terms
an, aset = 1, {0, 1}
while True:
yield an
s = str(an)
subs = (int(s[i:j]) for i, j in combinations(range(len(s)+1), 2))
an1 = min((t for t in subs if t not in aset), default=-1)
if an1 == -1:
an = next(k*an for k in count(2) if k*an not in aset)
else:
an = an1
aset.add(an)
print(list(islice(agen(), 62))) # Michael S. Branicky, Nov 17 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Nov 16 2024
STATUS
approved