%I #23 Jan 06 2023 14:12:00
%S 0,1,10,12,179,132,1048,416,135,126,125,1025,136,15,146,82,31,302,53,
%T 128,183,130,14,157,1254,139,304,73,41,403,74,208,103,152,1028,91,21,
%U 201,32,159,506,160,17,124,1036,104,51,504,95,16,204,62,129,203,52,503
%N a(n-1) + a(n) has only digits also in a(n); lexicographically earliest such sequence of distinct nonnegative integers.
%C Conjectured to be a permutation of the nonnegative integers.
%H Alois P. Heinz, <a href="/A359356/b359356.txt">Table of n, a(n) for n = 0..20000</a>
%H Eric Angelini, <a href="https://mailman.xmission.com/hyperkitty/list/math-fun@mailman.xmission.com/thread/ZUE3KBEIWDDDDNU2JJXLGWTEEONKLPYT/">A last pair sum linked to an alphabet</a>, [math-fun] list, Dec. 26, 2022.
%e The sequence of pairwise sums a(n-1) + a(n), n > 0, is (1, 11, 22, 191, 311, 1180, 1464, 551, 261, 251, 1150, 1161, 151, 161, 228, 113, 333, 355, 181, 311, ...)
%e After the smallest possible choice a(0) = 0, a(1) = 1 has the same digits as a(0) + a(1).
%e Then, a(2) = 10 is the smallest yet unused nonnegative integer such that a(1) + a(2) = 11 has all its digits also occurring in a(2). (The number 0 is excluded since it appeared earlier as a(0).)
%e Then, a(3) = 12 is the smallest yet unused nonnegative integer such that a(2) + a(3) = 22 has all its digits also occurring in a(3). (The smaller solutions 0 and 1 are again excluded since they appeared earlier.)
%p b:= proc() false end:
%p d:= proc(n) option remember; {convert(n, base, 10)[]} end:
%p a:= proc(n) option remember; local k; for k
%p while b(k) or d(a(n-1)+k) minus d(k)<>{} do od:
%p b(k):= true; k
%p end: a(0):=0:
%p seq(a(n), n=0..55); # _Alois P. Heinz_, Jan 03 2023
%o (Python)
%o def A359356(n, A=[0]):
%o while len(A) <= n:
%o t = 0
%o while t in A or any(d not in str(t) for d in str(t+A[-1])):
%o t += 1
%o A.append(t)
%o return A[n]
%Y Cf. A359517 (conjectured inverse permutation).
%K nonn,base
%O 0,3
%A _M. F. Hasler_ and _Eric Angelini_, Dec 27 2022