A368181 a(1) = 1; for n > 1, a(n) is the smallest positive integer that has not yet appeared which shares no digit with the sum of all previous terms a(1)..a(n-1).
1, 2, 4, 3, 5, 6, 7, 9, 8, 10, 11, 12, 13, 20, 22, 24, 23, 25, 14, 30, 15, 17, 33, 26, 16, 18, 19, 21, 27, 28, 31, 29, 34, 40, 41, 32, 35, 36, 38, 39, 37, 42, 44, 50, 43, 52, 45, 46, 47, 48, 49, 54, 55, 57, 56, 60, 53, 58, 59, 62, 63, 65, 70, 51, 61, 64, 66, 67, 69, 68, 71, 73, 74, 81, 90, 91, 77
Offset: 1
Examples
a(14) = 20 as the sum of all terms a(1)..a(13) = 91, and 20 is the smallest unused number that does not contain the digits 1 or 9.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..14594
Programs
-
Python
from itertools import islice def agen(): s, aset, mink = 0, {0}, 1 while True: k, dset = mink, set(str(s)) if dset >= set("123456789"): break while k in aset or set(str(k)) & dset: k += 1 an = k; aset.add(an); s += an; yield an while mink in aset: mink += 1 print(list(islice(agen(), 80))) # Michael S. Branicky, Dec 21 2023
Comments