This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A159880 Infinite string related to Ehrlich's swap method for generating permutations. 3
 0, 1, 2, 0, 1, 2, 3, 0, 1, 3, 0, 1, 2, 3, 0, 2, 3, 0, 1, 2, 3, 1, 2, 3, 4, 0, 1, 4, 0, 1, 2, 4, 0, 2, 4, 0, 1, 2, 4, 1, 2, 4, 0, 1, 2, 0, 1, 2, 3, 4, 0, 3, 4, 0, 1, 3, 4, 1, 3, 4, 0, 1, 3, 0, 1, 3, 4, 0, 1, 4, 0, 1, 2, 3, 4, 2, 3, 4, 0, 2, 3, 0, 2, 3, 4, 0, 2, 4, 0, 2, 3, 4, 0, 3, 4, 0, 1, 2, 3, 1, 2, 3, 4, 1, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS a(n) is the position of the zero in the inverse permutation of the one generated by "Algorithm E" given in D. E. Knuth, TAOCP, Section 7.2.1.2. Alternatively, the first element in the permutation (see example). LINKS Joerg Arndt, Table of n, a(n) for n = 0..5039 Joerg Arndt, Matters Computational (The Fxtbook), section 10.8 "Star-transposition order", pp.257-258 D. E. Knuth, TAOCP, Section 7.2.1.2. FORMULA a(k!) = k (for k>=1) and a(j) < k for j=nf, f=nf; k+=1; nf*=k );     v[p+1] = (v[p-f+1]-1) % k;   );   return(v); } CROSSREFS Cf. A123400 (giving the nonzero position in "swap" in example). Sequence in context: A262881 A099173 A293377 * A289251 A233292 A108456 Adjacent sequences:  A159877 A159878 A159879 * A159881 A159882 A159883 KEYWORD nonn AUTHOR Joerg Arndt, Apr 25 2009 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.

Last modified October 20 10:31 EDT 2019. Contains 328257 sequences. (Running on oeis4.)