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 A302501 #10 Feb 03 2025 16:56:28 %S A302501 0,1,2,3,4,5,6,7,8,9,45,67,83,456,72,34,56,12,345,61,23,450,123,4501, %T A302501 234,50,1234,501,2345,612,3450,12345,672,3456,78,94,567,89,4567,834, %U A302501 5672,34561,23450,123450,123456,723,4561,23456,783,45672,34567,894,5678,945,678,9456,789,45678,94567,8345,6723,45612,34501,234501,234561,234567,8945,6783,456723,456123,45012,345012 %N A302501 Lexicographically first sequence of distinct terms such that any set of six successive digits can be reordered as {d, d+1, d+2, d+3, d+4, d+5}, d being the smallest of the six digits. %C A302501 As the digit 0 has no predecessor and the digit 9 has no successor here, sets of successive digits like {4,3,2,1,0,9} and {5,6,7,8,9,0} are forbidden. %H A302501 Dominic McCarty, <a href="/A302501/b302501.txt">Table of n, a(n) for n = 1..10000</a> %e A302501 Terms a(1) to a(10) are obvious; %e A302501 a(11) is 45 because 45 is the smallest integer not yet in the sequence such that the elements of the sets {5,6,7,8,9,4} and {6,7,8,9,4,5} are six consecutive digits; %e A302501 a(12) is 67 because 67 is the smallest integer not yet in the sequence such that the elements of the sets {7,8,9,4,5,6} and {8,9,4,5,6,7} are six consecutive digits; %e A302501 a(13) is 83 because 83 is the smallest integer not yet in the sequence such that the elements of the sets {9,4,5,6,7,8} and {4,5,6,7,8,3} are six consecutive digits; %e A302501 etc. %o A302501 (Python) %o A302501 a, runLength = [i for i in range(10)], 6 %o A302501 def helper(s, k, l, a): %o A302501 if k not in a: return k %o A302501 return min([helper(s[(2-l):]+str(i), int(str(k)+str(i)), l, a) for i in range(10) if (k!=0 or i!=0) and s.find(str(i))==-1 and (all(d[n]+1==d[n+1] for n in range(l-1)) if (d:=sorted([int((s+str(i))[n]) for n in range(l)])) else False)]) %o A302501 while len(a)<100: a.append(helper(("".join(map(str, a)))[(1-runLength):], 0, runLength, a)) %o A302501 print(a) # _Dominic McCarty_, Feb 03 2025 %Y A302501 Cf. A228326 for the same idea with sets of two digits, A302173 (sets of three digits), A302499 (sets of four digits) and A302500 (sets of five digits). %K A302501 nonn,base %O A302501 1,3 %A A302501 _Eric Angelini_ and _Jean-Marc Falcoz_, Apr 09 2018