login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A320588 Derangements of {1,2,...,n} (n >= 2) in lexicographic order. 0
21, 231, 312, 2143, 2341, 2413, 3142, 3412, 3421, 4123, 4312, 4321, 21453, 21534, 23154, 23451, 23514, 24153, 24513, 24531, 25134, 25413, 25431, 31254, 31452, 31524, 34152, 34251, 34512, 34521, 35124, 35214, 35412, 35421, 41253, 41523, 41532, 43152, 43251, 43512 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

COMMENTS

The number of derangements of {1,2,...,n} is given in A000166.

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

LINKS

Table of n, a(n) for n=2..41.

EXAMPLE

Triangle begins:

     21;

    231,   312;

   2143,  2341,  2413,  3142,  3412,  3421,  4123,  4312,  4321;

  21453, 21534, 23154, 23451, 23514, 24153, 24513, 24531, 25134, ...

  ...

From David A. Corneth, Nov 15 2018: (Start)

43512 is in the sequence because no digit is equal to the index of the digit in the number (with offset 1).

43125 is not in the sequence because 5 is at the fifth position. (End)

MATHEMATICA

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 *)

PROG

(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

CROSSREFS

Cf. A000166, A030299.

Cf. A214261.

Sequence in context: A162360 A161899 A220721 * A020267 A188354 A064322

Adjacent sequences:  A320585 A320586 A320587 * A320589 A320590 A320591

KEYWORD

nonn,base,tabf

AUTHOR

Enrique Navarrete, Nov 14 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 21 22:40 EST 2019. Contains 329383 sequences. (Running on oeis4.)