A359356 a(n-1) + a(n) has only digits also in a(n); lexicographically earliest such sequence of distinct nonnegative integers.
0, 1, 10, 12, 179, 132, 1048, 416, 135, 126, 125, 1025, 136, 15, 146, 82, 31, 302, 53, 128, 183, 130, 14, 157, 1254, 139, 304, 73, 41, 403, 74, 208, 103, 152, 1028, 91, 21, 201, 32, 159, 506, 160, 17, 124, 1036, 104, 51, 504, 95, 16, 204, 62, 129, 203, 52, 503
Offset: 0
Examples
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, ...) After the smallest possible choice a(0) = 0, a(1) = 1 has the same digits as a(0) + a(1). 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).) 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.)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..20000
- Eric Angelini, A last pair sum linked to an alphabet, [math-fun] list, Dec. 26, 2022.
Crossrefs
Cf. A359517 (conjectured inverse permutation).
Programs
-
Maple
b:= proc() false end: d:= proc(n) option remember; {convert(n, base, 10)[]} end: a:= proc(n) option remember; local k; for k while b(k) or d(a(n-1)+k) minus d(k)<>{} do od: b(k):= true; k end: a(0):=0: seq(a(n), n=0..55); # Alois P. Heinz, Jan 03 2023
-
Python
def A359356(n, A=[0]): while len(A) <= n: t = 0 while t in A or any(d not in str(t) for d in str(t+A[-1])): t += 1 A.append(t) return A[n]
Comments