cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A342441 a(1) = 1; for n > 1, a(n) is the least positive integer not occurring earlier such that a(n-1)+a(n) shares no digit with either a(n-1) or a(n).

This page as a plain text file.
%I A342441 #21 Mar 24 2021 23:05:20
%S A342441 1,2,3,4,5,6,7,8,9,11,13,14,15,17,16,18,12,21,19,25,22,23,26,24,27,28,
%T A342441 29,31,33,32,34,35,36,38,39,41,42,43,37,44,45,46,47,48,51,149,53,49,
%U A342441 52,54,55,56,57,59,58,63,64,65,66,67,68,62,69,72,73,75,85,77,74,76,78,82,79
%N A342441 a(1) = 1; for n > 1, a(n) is the least positive integer not occurring earlier such that a(n-1)+a(n) shares no digit with either a(n-1) or a(n).
%C A342441 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).
%H A342441 Scott R. Shannon, <a href="/A342441/a342441.png">Image of the first 100000 terms</a>. The green line is a(n) = n.
%e A342441 a(2) = 2 as a(1)+2 = 1+2 = 3 which shares no digit with a(1) = 1 or 2.
%e A342441 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.
%e A342441 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.
%t A342441 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 *)
%o A342441 (Python)
%o A342441 def aupton(terms):
%o A342441   alst, aset = [1], {1}
%o A342441   while len(alst) < terms:
%o A342441     an, anm1_digs = 2, set(str(alst[-1]))
%o A342441     while True:
%o A342441       while an in aset: an += 1
%o A342441       if (set(str(an)) | anm1_digs) & set(str(an+alst[-1])) == set():
%o A342441         alst.append(an); aset.add(an); break
%o A342441       an += 1
%o A342441   return alst
%o A342441 print(aupton(73)) # _Michael S. Branicky_, Mar 20 2021
%Y A342441 Cf. A342442 (multiplication), A276633, A010784, A043537, A043096, A338466, A336285.
%K A342441 nonn,base
%O A342441 1,2
%A A342441 _Scott R. Shannon_, Mar 12 2021