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 A249591 #14 Dec 23 2024 14:53:44 %S A249591 1,10,9,8,7,6,5,4,3,2,11,12,13,14,15,16,17,18,19,21,20,29,22,23,24,25, %T A249591 26,27,28,32,30,39,31,33,34,35,36,37,38,43,40,49,41,42,44,45,46,47,48, %U A249591 54,50,59,51,52,53,55,56,57,58,65,60,69,61,62,63,64,66,67,68,70,76,71 %N A249591 Lexicographically earliest permutation of the integers such that a(n+1) shares at least one digit with a(n)-1. %H A249591 Reinhard Zumkeller, <a href="/A249591/b249591.txt">Table of n, a(n) for n = 1..10000</a> %H A249591 E. Angelini, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2014-November/013904.html">a(n) shows one of the digits of a(n-1)-1</a>, Nov 02 2014. %o A249591 (PARI) {u=0; a=1; for(n=1, 99, print1(a","); u+=1<<a; D=Set(if(a>1,digits(a-1))); for(k=2, 9e9, bittest(u, k)&&next; #setintersect(D, Set(digits(k)))||next; a=k; break))} %o A249591 (Haskell) %o A249591 import Data.List (intersect, delete) %o A249591 a249591 n = a249591_list !! (n-1) %o A249591 a249591_list = 1 : f 1 [2..] where %o A249591 f x zs = g zs where %o A249591 g (y:ys) = if null $ show y `intersect` show (x - 1) %o A249591 then g ys else y : f y (delete y zs) %o A249591 -- _Reinhard Zumkeller_, Nov 02 2014 %Y A249591 Cf. A249585. %Y A249591 Cf. A184992. %K A249591 nonn,base %O A249591 1,2 %A A249591 _Eric Angelini_ and _M. F. Hasler_, Nov 01 2014