OFFSET
1,2
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..5000
EXAMPLE
a(4) = 41 is the smallest unused integer that divides 123;
a(5) = 2341 is the smallest unused integer that divides 2341;
a(6) = 9 is the smallest unused integer that divides 3412341;
a(7) = 1374473 is the smallest unused integer that divides 4123419; etc.
MATHEMATICA
nn = 46; s = Range[3]; c[_] = 0; Array[Set[{a[#1], c[#2]}, {#2, #1}] & @@ {#, s[[#1]]} &, Length[s]]; Do[(Set[{a[n], c[#]}, {#, n}] &@ SelectFirst[Divisors[FromDigits@ Flatten@ Map[IntegerDigits, Reverse@ Array[a[n - #] &, 3]]], c[#] == 0 &]), {n, 1 + Length[s], nn}]; Array[a[#] &, nn] (* Michael De Vlieger, Feb 20 2022 *)
PROG
(Python)
from sympy import divisors
def aupton(terms):
alst, aset = [1, 2, 3], {1, 2, 3}
while len(alst) < terms:
concat = int("".join(map(str, alst[-3:])))
an = min(d for d in divisors(concat) if d not in aset)
alst.append(an); aset.add(an)
return alst
print(aupton(46)) # Michael S. Branicky, Feb 20 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Carole Dubois and Eric Angelini, Feb 20 2022
EXTENSIONS
a(26) and beyond from Michael S. Branicky, Feb 20 2022
STATUS
approved