This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A374504 #13 Jul 19 2024 19:25:34 %S A374504 0,9,1,90,91,92,93,94,95,10,96,11,97,12,98,13,99,14,900,901,902,903, %T A374504 904,905,15,16,17,18,19,100,906,101,907,102,908,103,909,104,910,911, %U A374504 912,913,914,915,105,106,107,108,109,110,916,111,917,112,918,113,919,114,920,921,922,923,924,925,115,116,117,118,119 %N A374504 Lexicographically earliest sequence of distinct nonnegative terms such that the absolute difference between the rightmost digit of a(n) and the leftmost digit of a(n+1) is the largest possible one. %C A374504 Only numbers starting with 1 or 9 are in the sequence, except for a(1). %C A374504 The first 9 absolute differences are 9,8,8,9,8,7,6,5,4. The next 20 absolute differences form a pattern that repeats itself forever: 9,5,8,6,7,7,6,8,5,9,8,7,6,5,4,4,5,6,7,8. %H A374504 Michael S. Branicky, <a href="/A374504/b374504.txt">Table of n, a(n) for n = 1..10000</a> %e A374504 The digits touching the 1st comma (0 and 9) have an absolute difference of 9; %e A374504 The digits touching the 2nd comma (9 and 1) have an absolute difference of 8; %e A374504 The digits touching the 3rd comma (1 and 9) have an absolute difference of 8; %e A374504 The digits touching the 4th comma (0 and 9) have an absolute difference of 9; %e A374504 The digits touching the 5th comma (1 and 9) have an absolute difference of 8; %e A374504 The digits touching the 6th comma (2 and 9) have an absolute difference of 7; %e A374504 The digits touching the 7th comma (3 and 9) have an absolute difference of 6; %e A374504 The digits touching the 8th comma (4 and 9) have an absolute difference of 5; %e A374504 The digits touching the 9th comma (5 and 1) have an absolute difference of 4; from now on, the absolute differences enter into a loop. %o A374504 (Python) %o A374504 from itertools import islice %o A374504 def gen(d): # generator of terms that start with d %o A374504 pow10 = 1 %o A374504 while True: %o A374504 for i in range(d*pow10, (d+1)*pow10): %o A374504 yield i %o A374504 pow10 *= 10 %o A374504 def agen(): # generator of terms %o A374504 an, g1, g9 = 0, gen(1), gen(9) %o A374504 next1, next9 = next(g1), next(g9) %o A374504 while True: %o A374504 yield an %o A374504 rightmost = an%10 %o A374504 if rightmost > 5 or (rightmost == 5 and next1 < next9): %o A374504 an, next1 = next1, next(g1) %o A374504 else: %o A374504 an, next9 = next9, next(g9) %o A374504 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Jul 13 2024 %Y A374504 Cf. A098795, A102663. %K A374504 base,nonn %O A374504 1,2 %A A374504 _Eric Angelini_, Jul 09 2024