OFFSET
2,2
REFERENCES
Donald E. Knuth: The Art of Computer Programming, Volume 4, Fascicle 2, Generating All Tuples and Permutations. Addison-Wesley (2005). Chapter 7.2.1.2, 39-40.
LINKS
R. J. Ord-Smith, Generation of permutation sequences: Part 1, Computer J., 13 (1970), 151-155.
FORMULA
a(2)=0, a(n)=n*a(n-1) + (n-1)*floor((n-1)/2).
c = limit n ->infinity a(n)/n! = 0.5430806.. = (e+1/e)/2-1 = A073743 - 1.
a(n) = floor (c*n! - (n-1)/2) for n>=2.
PROG
(Fortran) c FORTRAN program available at Pfoertner link.
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hugo Pfoertner, Jan 24 2003
STATUS
approved