A342755 a(1) = 2; for n > 1, a(n) is the least positive integer not occurring earlier such that a(n) shares no digit with a(n-1) and a(n-1)*a(n) shares no digit with either a(n-1) or a(n).
2, 3, 4, 5, 6, 7, 8, 9, 42, 15, 22, 14, 55, 12, 37, 16, 25, 36, 29, 47, 23, 46, 13, 44, 18, 32, 17, 38, 19, 33, 26, 35, 174, 53, 76, 59, 34, 27, 43, 67, 49, 62, 87, 106, 493, 57, 24, 75, 48, 65, 122, 39, 54, 72, 88, 45, 66, 73, 56, 77, 52, 79, 84, 63, 78, 123, 69, 58, 64, 92, 74, 68, 114, 85, 314
Offset: 1
Examples
a(2) = 3 as 3 shares no digit with a(1) = 2 and a(1)*3 = 2*3 = 6 shares no digit with a(1) = 2 or 3. a(9) = 42 as 42 shares no digit with a(8) = 9 and a(8)*42 = 9*42 = 378 shares no digit with a(8) = 9 or 42. a(10) = 15 as 15 shares no digit with a(9) = 42 and a(9)*15 = 42*15 = 630 shares no digit with a(9) = 42 or 15. This is the first term that differs from A342442. a(173) = 922989 as 922989 shares no digit with a(172) = 7154 and a(172)*922989 = 7154*922989 = 6603063306 shares no digit with a(172) = 7154 or 922989. This is currently the last known term.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..175
Programs
-
Python
def aupton(terms): alst, aset = [2], {2} while len(alst) < terms: an, anm1_digs = 2, set(str(alst[-1])) while True: while an in aset: an += 1 an_digs = set(str(an)) if (an_digs & anm1_digs) == set(): prod_digs = set(str(an*alst[-1])) if (anm1_digs | an_digs) & prod_digs == set(): alst.append(an); aset.add(an); break an += 1 return alst print(aupton(173)) # Michael S. Branicky, Mar 21 2021
Comments