Relationship between fixed points and inversions in permutations
@virtuolie, the full list of values for n=30 is (to 3dp) [222.583, 217.583, 212.417, 207.083, 201.583, 195.917, 190.083, 184.083, 177.917, 171.583, 165.083, 158.417, 151.583, 144.583, 137.417, 130.083, 122.583, 114.917, 107.083, 99.083, 90.917, 82.583, 74.083, 65.416, 56.585, 47.576, 38.444, 29.000, 19.667, NaN, 0.000]. Empirically it seems that there's more to be said about the trend: if you fit a quadratic to E(inv) as a function of k for fixed n, it seems to be an extremely good fit, so it may be worth trying to (a) prove the conjectured formula; (b) prove a quadratic asymptotic form.