OFFSET
1,2
COMMENTS
The last two digits of a(n) must be in ascending order (thus no term of the sequence ends in 0).
LINKS
Dominic McCarty, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2) = 2 and 2 is the sum of 1 + 1 (closest digits to 2);
a(3) = 12 and 2 is the sum of 1 + 1 (closest digits to 2);
a(4) = 13 and 3 is the sum of 1 + 2 (closest digits to 3);
a(5) = 23 and 3 is the sum of 2 + 1 (closest digits to 3); etc.
PROG
(Python)
a = [1, 2, 12]
while len(a) < 72:
l = int(str(a[-1])[-1])-int(str(a[-1])[-2])
k = 10 * l
while k in a or k % 10 == 0 or int(str(k)[-1]) <= int(str(k)[-2]): k = k+1 if int(str(k+1)[0]) == l else l * (10 ** (len(str(k-1))))
a.append(k)
print(a) # Dominic McCarty, Jun 14 2025
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Nov 25 2020
STATUS
approved
