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 A374530 #12 Mar 26 2025 21:46:13 %S A374530 0,1,10,11,12,2,20,13,3,30,14,4,40,15,5,50,16,6,60,17,7,70,18,8,80,19, %T A374530 9,90,100,101,102,21,103,31,104,41,105,51,106,61,107,71,108,81,109,91, %U A374530 110,111,112,22,23,32,24,42,25,52,26,62,27,72,28,82,29,92,200,113,33,34,43,35,53,36,63,37,73 %N A374530 Lexicographically earliest permutation of the nonnegative terms such that the absolute difference between the rightmost digit of a(n) and the leftmost digit of a(n+1) is the smallest possible one. %C A374530 The mentioned absolute differences are always < 2. %H A374530 Dominic McCarty, <a href="/A374530/b374530.txt">Table of n, a(n) for n = 1..10000</a> %e A374530 The digits touching the 1st comma (0 and 1) have an absolute difference of 1; %e A374530 The digits touching the 2nd comma (1 and 1) have an absolute difference of 0; %e A374530 The digits touching the 3rd comma (0 and 1) have an absolute difference of 1; %e A374530 The digits touching the 4th comma (1 and 1) have an absolute difference of 0; %e A374530 The digits touching the 5th comma (2 and 2) have an absolute difference of 0; %e A374530 The digits touching the 6th comma (2 and 2) have an absolute difference of 0; %e A374530 The digits touching the 7th comma (0 and 1) have an absolute difference of 1; %e A374530 The digits touching the 8th comma (3 and 3) have an absolute difference of 0; %e A374530 The digits touching the 9th comma (3 and 3) have an absolute difference of 0; etc. %o A374530 (Python) %o A374530 from itertools import count %o A374530 a = [0] %o A374530 while len(a) < 30: a.append(next(k for k in count() if k not in a and ((r:=a[-1]%10)==(l:=int(str(k)[0])) or ((r,l)==(0,1))))) %o A374530 print(a) # _Dominic McCarty_, Mar 24 2025 %Y A374530 Cf. A374504, A076654. %K A374530 base,nonn %O A374530 1,3 %A A374530 _Eric Angelini_, Jul 10 2024