login
A360947
a(n), read backwards, is present as a substring in a(n) + a(n+1). This is the lexicographically earliest sequence of distinct terms > 0 with this property.
0
1, 9, 10, 91, 28, 54, 191, 1000, 9001, 1089, 8712, 3466, 3177, 4536, 1818, 6363, 7273, 6454, 8092, 4816, 1368, 7263, 6364, 8272, 4456, 2088, 6714, 7462, 5185, 630, 406, 198, 693, 703, 604, 802, 1278, 7443, 6004, 8002, 4006, 1998, 6993, 7003, 16004, 24057, 50985, 7920, 2377, 5355, 180
OFFSET
1,2
EXAMPLE
a(1), read backwards, is 1, which is present in a(1) + a(2) = 1+ 9 = 10;
a(2), read backwards, is 9, which is present in a(2) + a(3) = 9+10 = 19;
a(3), read backwards, is 01, which is present in a(3) + a(4) = 10+91 = 101;
a(4), read backwards, is 19, which is present in a(4) + a(5) = 91+28 = 119; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=(k=1; While[MemberQ[Array[a, n-1], k]|| !StringContainsQ[ToString[a[n-1]+k], StringReverse@ToString@a[n-1]], k++]; k); Array[a, 51]
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
an, aset, mink = 1, set(), 2
while True:
yield an; aset.add(an); t = str(an)[::-1]; mink = max(int(t)-an, 2)
an = next(k for k in count(mink) if k not in aset and t in str(an+k))
print(list(islice(agen(), 51))) # Michael S. Branicky, Oct 15 2023
CROSSREFS
Cf. A004086.
Sequence in context: A136874 A136881 A333402 * A248306 A336690 A375790
KEYWORD
base,nonn
AUTHOR
STATUS
approved