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 A320588 #46 Nov 15 2018 16:53:59 %S A320588 21,231,312,2143,2341,2413,3142,3412,3421,4123,4312,4321,21453,21534, %T A320588 23154,23451,23514,24153,24513,24531,25134,25413,25431,31254,31452, %U A320588 31524,34152,34251,34512,34521,35124,35214,35412,35421,41253,41523,41532,43152,43251,43512 %N A320588 Derangements of {1,2,...,n} (n >= 2) in lexicographic order. %C A320588 The number of derangements of {1,2,...,n} is given in A000166. %C A320588 This sequence is unsatisfactory for n >= 10. To have a sequence that is defined for all n, the derangements should be comma-separated lists, with keyword tabf. - _N. J. A. Sloane_, Nov 15 2018 %e A320588 Triangle begins: %e A320588 21; %e A320588 231, 312; %e A320588 2143, 2341, 2413, 3142, 3412, 3421, 4123, 4312, 4321; %e A320588 21453, 21534, 23154, 23451, 23514, 24153, 24513, 24531, 25134, ... %e A320588 ... %e A320588 From _David A. Corneth_, Nov 15 2018: (Start) %e A320588 43512 is in the sequence because no digit is equal to the index of the digit in the number (with offset 1). %e A320588 43125 is not in the sequence because 5 is at the fifth position. (End) %t A320588 Needs["Combinatorica`"]; Flatten @ Table[FromDigits /@ Derangements [Table[i, {i, n}]], {n, 9}] (* For first 150504 terms, _Amiram Eldar_, Nov 15 2018 after _Zak Seidov_ at A030299 *) %o A320588 (Perl) use ntheory ":all"; my(@L,@d); do { @d=(1..$_); forderange { push @L,join"",@d[@_]; } $_; } for 2..6; say join ",",@L; # _Dana Jacobsen_, Nov 15 2018 %Y A320588 Cf. A000166, A030299. %Y A320588 Cf. A214261. %K A320588 nonn,base,tabf %O A320588 2,1 %A A320588 _Enrique Navarrete_, Nov 14 2018