cp's OEIS Frontend

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.

A159325 Median number of comparisons used by insertion sort on n (distinct) elements.

This page as a plain text file.
%I A159325 #3 Dec 16 2016 16:23:35
%S A159325 0,1,3,5,8,11,15,19,24,30,36,42,49,56,64,73,82,91,101,111,122,134,146,
%T A159325 158,171,185
%N A159325 Median number of comparisons used by insertion sort on n (distinct) elements.
%C A159325 The frequencies of the number of comparisons are given by sequence A129178, so if Sum_{k=0..i-1} A129178(n,k) < n!/2 and Sum_{k=0..i} A129178(n,k) > n!/2, then the median is entry i, which corresponds to n(n-1)/2-i comparisons.
%C A159325 Close to average number of comparisons: A159324(n)/n!
%e A159325 For n=3, permutations 123,132,213,231,312,321 require 3,3,3,2,3,2 comparisons respectively, so the median is 3.
%Y A159325 Cf. A129178, A159323, A159324.
%K A159325 nonn
%O A159325 1,3
%A A159325 Harmen Wassenaar (towr(AT)ai.rug.nl), Apr 10 2009