OFFSET
1,2
COMMENTS
The sequence is a permutation of the positive integers.
LINKS
Carole Dubois, Table of n, a(n) for n = 1..400
Michael De Vlieger, Log-log scatterplot of a(n), n = 1..2^14.
EXAMPLE
a(3) = 3 as 3 is the smallest unused integer whose first digit divides 12;
a(4) = 10 as 10 is the smallest unused integer whose first digit divides 23;
a(5) = 5 as 5 is the smallest unused integer whose first digit divides 310;
a(6) = 7 as 7 is the smallest unused integer whose first digit divides 105; etc.
MATHEMATICA
c[_] = 0; u = 1; a[1] = c[1] = 1; a[2] = c[2] = 2; nn = 72; Do[While[c[u] > 0, u++]; k = u; m = a[n - 2]*10^IntegerLength[a[n - 1]] + a[n - 1]; While[Nand[Mod[m, First@ IntegerDigits[k]] == 0, c[k] == 0], k++]; a[n] = k; c[k] = n, {n, 3, nn}]; Array[a[#] &, nn] (* Michael De Vlieger, Feb 20 2022 *)
PROG
(Python)
from sympy import divisors
def aupton(terms):
alst, aset, minunused = [1, 2], {1, 2}, 3
while len(alst) < terms:
concat = int(str(alst[-2])+str(alst[-1]))
k = minunused
while k in aset or concat%int(str(k)[0]): k += 1
an = k; alst.append(an); aset.add(an)
while minunused in aset: minunused += 1
return alst
print(aupton(72)) # Michael S. Branicky, Feb 20 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 20 2022
STATUS
approved