OFFSET
1,2
COMMENTS
No term can end in 0 as that would result in the last digit of a(n-1) being the same as the last digit of a(n-1)+a(n).
LINKS
Scott R. Shannon, Image of the first 100000 terms. The green line is a(n) = n.
EXAMPLE
a(2) = 2 as a(1)+2 = 1+2 = 3 which shares no digit with a(1) = 1 or 2.
a(10) = 11 as a(9)+11 = 9+11 = 20 which shares no digit with a(9) = 9 or 11. Note that the first number skipped is 10 as 9+10 = 19 which shares a digit with 9.
a(11) = 13 as a(10)+13 = 11+13 = 24 which shares no digit with a(10) = 11 or 13. Note that the number 12 is skipped as 11+12 = 23 which shares a digit with 12.
MATHEMATICA
Block[{a = {1}, m = {1}, d, s, k}, Do[k = 2; While[Nand[FreeQ[a, k], ! IntersectingQ[Set[d, IntegerDigits[k]], Set[s, IntegerDigits[a[[-1]] + k]]], ! IntersectingQ[s, m]], k++]; AppendTo[a, k]; Set[m, d], 72]; a] (* Michael De Vlieger, Mar 20 2021 *)
PROG
(Python)
def aupton(terms):
alst, aset = [1], {1}
while len(alst) < terms:
an, anm1_digs = 2, set(str(alst[-1]))
while True:
while an in aset: an += 1
if (set(str(an)) | anm1_digs) & set(str(an+alst[-1])) == set():
alst.append(an); aset.add(an); break
an += 1
return alst
print(aupton(73)) # Michael S. Branicky, Mar 20 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Scott R. Shannon, Mar 12 2021
STATUS
approved