OFFSET
1,2
COMMENTS
a(3) = 11 has two digits "1"; they must both be visible in a(3) * a(4) and this is the case as a(3) * a(4) = 11 * 91 = 1001.
Is this a permutation of the positive integers? - Pontus von Brömssen, Aug 23 2021
LINKS
Pontus von Brömssen, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) * a(2) = 1 * 10 = 10;
a(2) * a(3) = 10 * 11 = 110;
a(3) * a(4) = 11 * 91 = 1001;
a(4) * a(5) = 91 * 9 = 819;
a(5) * a(6) = 9 * 21 = 189; etc.
PROG
(Python)
from collections import Counter
def A347182_list(n):
a = [1]
m = 2 # Smallest number not yet in a.
M = 1 # Largest number in a so far.
used = [] # Indicator for what numbers m..M that are in a so far.
for i in range(n - 1):
c0 = Counter(str(a[-1]))
x = m
while 1:
if x > M or not used[x - m]:
c = Counter(str(a[-1] * x))
if all(c[d] >= c0[d] for d in "0123456789"):
break
x += 1
if x > M:
used.extend([0] * (x - M - 1) + [1])
M = x
else:
used[x - m] = 1
if x == m:
j = next((j for j in range(len(used)) if not used[j]), len(used))
m += j
del used[:j]
a.append(x)
return a # Pontus von Brömssen, Aug 24 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Aug 22 2021
STATUS
approved