login
A339138
Lexicographically earliest sequence of distinct nonnegative terms such that the first digit d of a(n), for n > 1, is the sum of the two closest digits of d (they are the rightmost digit of a(n-1) and the next digit on the right of d).
2
0, 1, 10, 2, 20, 3, 30, 4, 40, 5, 50, 6, 60, 7, 70, 8, 80, 9, 90, 11, 21, 32, 31, 43, 41, 54, 51, 65, 61, 76, 71, 87, 81, 98, 91, 100, 22, 42, 53, 52, 64, 62, 75, 72, 86, 82, 97, 92, 200, 33, 63, 74, 73, 85, 83, 96, 93, 300, 44, 84, 95, 94, 400, 55, 500, 66
OFFSET
1,3
COMMENTS
The first two digits of a(n) cannot be in ascending order.
LINKS
EXAMPLE
a(2) = 1 and 1 is the sum of 0 + 1 (closest digits to 1);
a(3) = 10 and 1 is the sum of 1 + 0 (closest digits to 1);
a(4) = 2 and 2 is the sum of 0 + 2 (closest digits to 2);
a(5) = 20 and 2 is the sum of 2 + 0 (closest digits to 2); etc.
PROG
(Python)
a, d = [0], 1
while len(a) < 66:
if d < 10 and a[-1] % 10 == 0: a.append(d); d += 1
k = 10
while k in a or (a[-1]%10) + int(str(k)[1]) != int(str(k)[0]): k += 1
a.append(k)
print(a) # Dominic McCarty, Jun 15 2025
CROSSREFS
Cf. A339139 (where the last digit is involved, instead of the first digit).
Sequence in context: A330365 A173237 A319154 * A086068 A262557 A030595
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Nov 25 2020
EXTENSIONS
Corrected and extended by Dominic McCarty, Jun 15 2025
STATUS
approved