OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers.
First differs from A323821 at a(32).
LINKS
EXAMPLE
a(1) + a(2) = 1 + 10 = 11 which is divisible by 1 (the first digit of 10);
a(2) + a(3) = 10 + 2 = 12 which is divisible by 2 (the first digit of 2);
a(3) + a(4) = 2 + 11 = 13 which is divisible by 1 (the first digit of 11);
a(4) + a(5) = 11 + 12 = 23 which is divisible by 1 (the first digit of 12);
a(5) + a(6) = 12 + 3 = 15 which is divisible by 3 (the first digit of 3); etc.
MATHEMATICA
nn = 78; c[_] = 0; a[1] = c[1] = u = 1; Do[While[c[u] != 0, u++]; k = u; While[Nand[c[k] == 0, Mod[a[n - 1] + k, First@ IntegerDigits[k]] == 0], k++]; Set[{a[n], c[k]}, {k, n}], {n, 2, nn}]; Array[a[#] &, nn] (* Michael De Vlieger, Feb 21 2022 *)
PROG
(Python)
def aupton(terms):
alst, aset, minunused = [1], {1}, 2
while len(alst) < terms:
an = minunused
while an in aset or (alst[-1]+an)%int(str(an)[0]): an += 1
alst.append(an); aset.add(an)
while minunused in aset: minunused += 1
return alst
print(aupton(100)) # Michael S. Branicky, Feb 21 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 21 2022
STATUS
approved