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.

A337193 Total number of inversions in all permutations of [n] where the descent set equals the subset of odd elements in [n-1].

This page as a plain text file.
%I A337193 #28 Jan 02 2021 12:17:08
%S A337193 0,0,1,3,18,80,495,2856,20244,142848,1167885,9729280,90858438,
%T A337193 872361984,9193900443,99947258880,1175452387560,14270843322368,
%U A337193 185456745850329,2487099677147136,35413726451731770,519907295578030080,8052572864648861703,128451121643116822528
%N A337193 Total number of inversions in all permutations of [n] where the descent set equals the subset of odd elements in [n-1].
%H A337193 Alois P. Heinz, <a href="/A337193/b337193.txt">Table of n, a(n) for n = 0..483</a>
%H A337193 Wikipedia, <a href="https://en.wikipedia.org/wiki/Inversion_(discrete_mathematics)">Inversion</a>
%H A337193 Wikipedia, <a href="https://en.wikipedia.org/wiki/Permutation">Permutation</a>
%F A337193 a(n) = Sum_{k=1..ceiling((n-1)^2/2)} k * A337126(n,k).
%F A337193 From _Vaclav Kotesovec_, Aug 31 2020: (Start)
%F A337193 a(n) ~ n! * 2^n * n^2 / Pi^(n+1).
%F A337193 a(n) ~ 2^(n + 1/2) * n^(n + 5/2) / (Pi^(n + 1/2) * exp(n)). (End)
%e A337193 a(3) = 3, because in the A000111(3) = 2 permutations 213, 312 there are 3 inversions: (2,1), (3,1), (3,2).
%e A337193 a(4) = 18, because in the A000111(4) = 5 permutations 2143, 3142, 3241, 4132, 4231 there are 18 inversions: (2,1), (4,3), (3,1), (3,2), (4,2), (3,2), (3,1), (2,1), (4,1), (4,1), (4,3), (4,2), (3,2), (4,2), (4,3), (4,1), (2,1), (3,1).
%p A337193 b:= proc(u, o, t) option remember; `if`(u+o=0, [1, 0], add((p-> [0,
%p A337193       `if`(t=0, o-1+j, u-j)*p[1]]+p)(b(o-1+j, u-j, 1-t)), j=1..u))
%p A337193     end:
%p A337193 a:= n-> b(n, 0$2)[2]:
%p A337193 seq(a(n), n=0..30);
%t A337193 b[u_, o_, t_] := b[u, o, t] = Expand[If[u + o == 0, 1, Sum[x^If[t == 0, o - 1 + j, u - j]*b[o - 1 + j, u - j, 1 - t], {j, 1, u}]]];
%t A337193 a[n_] := With[{cc = CoefficientList[b[n, 0, 0], x]}, cc.Range[0, Length[cc]-1] ];
%t A337193 a /@ Range[0, 30] (* _Jean-François Alcover_, Jan 02 2021, after _Alois P. Heinz_ in A337126 *)
%Y A337193 Cf. A000111, A001809, A211606, A216239, A337126.
%K A337193 nonn
%O A337193 0,4
%A A337193 _Alois P. Heinz_, Aug 18 2020