A351820 a(1) = 1, a(2) = 2, a(3) = 3 and a(n) is the smallest number not included earlier that divides the concatenation a(n-3), a(n-2), a(n-1).
1, 2, 3, 41, 2341, 9, 1374473, 7, 123, 13, 49, 53, 91, 689, 5391689, 167, 8429, 17, 11, 21, 211, 37, 89, 2113789, 47, 89211378947, 1336372981, 43, 169, 7213, 47966357, 121, 13681, 29863, 9848521381, 173, 23, 2997821, 29, 39, 19, 97973, 130665991, 727, 251, 817
Offset: 1
Examples
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.
Links
- Jon E. Schoenfield, Table of n, a(n) for n = 1..5000
Programs
-
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 *)
-
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
Extensions
a(26) and beyond from Michael S. Branicky, Feb 20 2022