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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A212397 Denominator of the average number of move operations required by an insertion sort of n (distinct) elements. 3
1, 1, 2, 6, 6, 30, 5, 35, 140, 1260, 1260, 13860, 13860, 180180, 180180, 180180, 360360, 6126120, 2042040, 38798760, 7759752, 2586584, 2586584, 59491432, 178474296, 4461857400, 4461857400, 40156716600, 40156716600, 1164544781400, 1164544781400 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

The average number of move operations is 1/n! times the number of move operations required to sort all permutations of [n] (A212395), assuming that each permutation is equiprobable.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..1000

Wikipedia, Insertion sort

Index entries for sequences related to sorting

FORMULA

a(n) = denominator of A212395(n)/A000142(n).

MAPLE

b:= proc(n) option remember;

      `if`(n=0, 0, b(n-1)*n + (n-1)! * (n-1)*(n+4)/2)

    end:

a:= n-> denom(b(n)/n!):

seq(a(n), n=0..30);

MATHEMATICA

a[n_] := Denominator[n (n + 7)/4 - 2 HarmonicNumber[n]];

Table[a[n], {n, 0, 30}] (* Jean-Fran├žois Alcover, May 29 2018, from 2nd formula in A212396 *)

CROSSREFS

Numerators are in A212396.

Cf. A000142, A212395.

Sequence in context: A085087 A072983 A055204 * A008339 A077139 A068629

Adjacent sequences:  A212394 A212395 A212396 * A212398 A212399 A212400

KEYWORD

nonn,frac

AUTHOR

Alois P. Heinz, May 14 2012

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 June 24 09:37 EDT 2019. Contains 324323 sequences. (Running on oeis4.)