A062868
Number of permutations of degree n with barycenter 0.
Original entry on oeis.org
1, 1, 2, 4, 14, 46, 282, 1394, 12658, 83122, 985730, 8012962, 116597538, 1127575970, 19410377378, 217492266658, 4320408974978, 55023200887938, 1238467679662722, 17665859065690754, 444247724347355554, 7015393325151055906, 194912434760367113570, 3375509056735963889634
Offset: 0
(4,1,3,5,2) has difference (3,-1,0,1,-3) and signs (1,-1,0,1,-1) with total 0.
-
b:= proc(s, t) option remember; (n-> `if`(abs(t)>n, 0, `if`(n=0, 1,
add(b(s minus {j}, t+signum(n-j)), j=s))))(nops(s))
end:
a:= n-> b({$1..n}, 0):
seq(a(n), n=0..14); # Alois P. Heinz, Jul 31 2018
-
E1[n_ /; n >= 0, 0] = 1;
E1[n_, k_] /; k < 0 || k > n = 0;
E1[n_, k_] := E1[n, k] = (n-k) E1[n-1, k-1] + (k+1) E1[n-1, k];
b[n_] := Sum[(-1)^(n-k) E1[n+k, n] Binomial[2n, n-k], {k, 0, n}];
a[n_] := Sum[Binomial[n, n-2k] b[k], {k, 0, n/2}];
a /@ Range[0, 150] (* Jean-François Alcover, Oct 29 2020, after Peter Luschny in A320337 *)
A062869
Triangle read by rows: For n >= 0, k >= 0, T(n,k) is the number of permutations pi of n such that the total distance Sum_i abs(i-pi(i)) = 2k. Equivalently, k = Sum_i max(i-pi(i),0).
Original entry on oeis.org
1, 1, 1, 1, 1, 2, 3, 1, 3, 7, 9, 4, 1, 4, 12, 24, 35, 24, 20, 1, 5, 18, 46, 93, 137, 148, 136, 100, 36, 1, 6, 25, 76, 187, 366, 591, 744, 884, 832, 716, 360, 252, 1, 7, 33, 115, 327, 765, 1523, 2553, 3696, 4852, 5708, 5892, 5452, 4212, 2844, 1764, 576, 1, 8, 42, 164, 524
Offset: 0
Triangle T(n,k) begins:
1;
1;
1, 1;
1, 2, 3;
1, 3, 7, 9, 4;
1, 4, 12, 24, 35, 24, 20;
1, 5, 18, 46, 93, 137, 148, 136, 100, 36;
1, 6, 25, 76, 187, 366, 591, 744, 884, 832, 716, 360, 252;
...
(4,3,1,2) has distances (3,1,2,2), sum is 8 and there are 3 other permutations of degree 4 with this sum.
- D. E. Knuth, The Art of Computer Programming, vol. 3, (1998), page 22 (exercise 28) and page 597 (solution and comments).
- Daniel Graf and Alois P. Heinz, Rows n = 0..50, flattened (first 31 rows from Alois P. Heinz)
- Max Alekseyev, Proof that T(n,k) is even for k>=n, SeqFan Mailing List, Dec 07 2006
- Andreas Bärtschi, Barbara Geissmann, Daniel Graf, Tomas Hruz, Paolo Penna, and Thomas Tschager, On computing the total displacement number via weighted Motzkin paths, arXiv:1606.05538 [cs.DS], 2016. See pp. 1, 3-5, 13. - _Daniel Graf_, Jun 20 2016
- P. Diaconis and R. L. Graham, Spearman's Footrule as a Measure of Disarray, J. Royal Stat. Soc. B, 39 (1977), 262-268.
- FindStat - Combinatorial Statistic Finder, The depth of a permutation., The sum of the descent differences of a permutations.
- Mathieu Guay-Paquet and T. Kyle Petersen, The generating function for total displacement, arXiv:1404.4674 [math.CO], 2014.
- Mathieu Guay-Paquet and T. Kyle Petersen, The generating function for total displacement, The Electronic Journal of Combinatorics, 21(3) (2014), #P3.37.
- Dirk Liebhold, Gabriele Nebe, and Angeles Vazquez-Castro, Network coding and spherical buildings, arXiv preprint arXiv:1612.07177 [cs.IT], 2016. See p. 4.
- T. Kyle Petersen and Bridget Eileen Tenner, The depth of a permutation, arXiv:1202.4765 [math.CO], 2012.
- Balázs R. Sziklai, Attila Gere, Károly Héberger, and Jochen Staudacher, rSRD: An R package for the Sum of Ranking Differences statistical procedure, arXiv:2502.03208 [math.ST], 2025. See p. 34.
-
# The following program yields the entries of the specified row n
n := 9: with(combinat): P := permute(n): excsum := proc (p) (1/2)*add(abs(p[i]-i), i = 1 .. nops(p)) end proc: f[n] := sort(add(t^excsum(P[j]), j = 1 .. factorial(n))): seq(coeff(f[n], t, j), j = 0 .. floor((1/4)*n^2)); # Emeric Deutsch, Apr 02 2010
# Maple program using the g.f. given by Guay-Paquey and Petersen:
g:= proc(h, n) local i, j; j:= irem(h, 2, 'i');
1-`if`(h=n, 0, (i+1)*z*t^(i+j)/g(h+1, n))
end:
T:= n-> (p-> seq(coeff(p, t, k), k=0..degree(p)))
(coeff(series(1/g(0, n), z, n+1), z, n)):
seq(T(n), n=0..10); # Alois P. Heinz, May 02 2014
-
g[h_, n_] := Module[{i, j}, {i, j} = QuotientRemainder[h, 2]; 1 - If[h == n, 0, (i + 1)*z*t^(i + j)/g[h + 1, n]]]; T[n_] := Function[p, Table[ Coefficient[p, t, k], {k, 0, Exponent[p, t]}]][SeriesCoefficient[ 1/g[0, n], {z, 0, n}]]; Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, Jan 07 2016, after Alois P. Heinz *)
f[i_] := If[i == 1, 1, -(i-1)^2 t^(2i - 3) z^2];
g[i_] := 1 - (2i - 1) t^(i-1) z;
cf = ContinuedFractionK[f[i], g[i], {i, 1, 5}];
CoefficientList[#, t]& /@ CoefficientList[cf + O[z]^10, z] // Rest // Flatten (* Jean-François Alcover, Nov 25 2018, after Mathieu Guay-Paquet *)
-
# The following Sage program
# yields the entries of the first n rows
# as a list of lists
def get_first_rows(n):
R, t = PolynomialRing(ZZ, 't').objgen()
S, z = PowerSeriesRing(R, 'z').objgen()
gf = S(1).add_bigoh(1)
for i in srange(n, 0, -1):
a = (i+1) // 2
b = i // 2
gf = 1 / (1 - a * t^b * z * gf)
return [list(row) for row in gf.shift(-1)]
# Mathieu Guay-Paquet, Apr 30 2014
A062867
Triangle read by rows: entries give numbers of permutations of [1..n] by absolute barycenter.
Original entry on oeis.org
1, 1, 2, 4, 2, 14, 8, 2, 46, 62, 10, 2, 282, 292, 132, 12, 2, 1394, 2578, 784, 268, 14, 2, 12658, 15472, 9718, 1920, 534, 16, 2, 83122, 171662, 69318, 33230, 4470, 1058, 18, 2, 985730, 1282604, 964544, 276044, 107660, 10100, 2096, 20, 2, 8012962, 17465978, 8199268, 4851200, 1022824, 337988, 22396, 4160, 22, 2
Offset: 0
[1], [2], [4, 2], [14, 8, 2], [46, 62, 10, 2], [282, 292, 132, 12, 2], ...
(1,6,2,3,4,5,7) has difference (0,5,-1,-1,-1,-1,0) and signs (0,1,-1,-1,-1,-1,0) with total -3, absolute value is 3. This is one of 268 such permutations of degree 7.
Triangle T(n,k) begins:
1;
1;
2;
4, 2;
14, 8, 2;
46, 62, 10, 2;
282, 292, 132, 12, 2;
1394, 2578, 784, 268, 14, 2;
12658, 15472, 9718, 1920, 534, 16, 2;
83122, 171662, 69318, 33230, 4470, 1058, 18, 2;
985730, 1282604, 964544, 276044, 107660, 10100, 2096, 20, 2;
-
b:= proc(s, t) option remember; (n-> `if`(n=0, x^t,
add(b(s minus {j}, t+signum(n-j)), j=s)))(nops(s))
end:
T:= n-> (p-> seq(coeff(p, x, i)*`if`(i=0, 1, 2), i=0..degree(p)))(b({$1..n}, 0)):
seq(T(n), n=0..12); # Alois P. Heinz, Jul 31 2018
-
b[s_, t_] := b[s, t] = With[{n = Length[s]}, If[n == 0, x^t, Sum[b[s ~Complement~ {j}, t + Sign[n - j]], {j, s}]]];
T[n_] := With[{p = b[Range[n], 0]}, Table[Coefficient[p, x, i]*If[i == 0, 1, 2], {i, 0, Exponent[p, x]}]];
Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Jan 25 2021, after Alois P. Heinz *)
A062870
Number of permutations of degree n with greatest sum of distances.
Original entry on oeis.org
1, 1, 1, 3, 4, 20, 36, 252, 576, 5184, 14400, 158400, 518400, 6739200, 25401600, 381024000, 1625702400, 27636940800, 131681894400, 2501955993600, 13168189440000, 276531978240000, 1593350922240000, 36647071211520000, 229442532802560000, 5736063320064000000
Offset: 0
(4,3,1,2) has distances (3,1,2,2), sum is 8 and there are 3 other permutations of degree 4 {3, 4, 1, 2}, {3, 4, 2, 1}, {4, 3, 2, 1} with this sum which is the maximum possible.
-
a:= proc(n) option remember; `if`(n<2, 1+n*(n-1),
(n*((n-1)^2*(3*n-4)*a(n-2)-4*a(n-1)))/(4*(n-1)*(3*n-7)))
end:
seq(a(n), n=0..30); # Alois P. Heinz, Jan 16 2014
-
a[n_?EvenQ] := (n/2)!^2; a[n_?OddQ] := n*((n-1)/2)!^2; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Apr 15 2015 *)
-
for(k=0,20,print1((2*k+1)*k!^2","(k+1)!^2",")) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 27 2007
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 27 2007
A169934
Number of permutations of 1..n with the number moved left exceeding the number moved right by 2.
Original entry on oeis.org
0, 0, 0, 1, 5, 66, 392, 4859, 34659, 482272, 4099634, 65762489, 653977909, 12026621478, 137361430156, 2862534403223, 36968414699239, 862935261673212, 12440701298168534, 321935664074780549, 5126628962937663529, 145768013651370381026, 2541561479354892816304
Offset: 1
Equal number moved left and right, see
A062868.
A179562
Number of permutations of 1..n with the number moved left exceeding the number moved right by 1.
Original entry on oeis.org
0, 0, 1, 4, 31, 146, 1289, 7736, 85831, 641302, 8732989, 78432212, 1270475155, 13338831858, 250740220345, 3013809363056, 64512904742895, 873589792390382, 20982459271174517, 316070362138732172, 8418423492219771211, 139628838506569935338, 4084524856346911809777
Offset: 1
Equal number moved left and right, see
A062868.
A179564
Number of permutations of 1..n with the number moved left exceeding the number moved right by 3.
Original entry on oeis.org
0, 0, 0, 0, 1, 6, 134, 960, 16615, 138022, 2425600, 23279224, 444500577, 4880181294, 102914967458, 1277238809792, 29767443364523, 412889949481670, 10588965173821348, 162515224089696984, 4560137456338593333, 76773519570724122126, 2343258977445039475014
Offset: 1
Equal number moved left and right, see
A062868.
A179565
Number of permutations of [n] with the number moved left exceeding the number moved right by 4.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 7, 267, 2235, 53830, 511412, 11370998, 122063526, 2787148807, 33618432005, 817366315013, 10992904020133, 288039183533356, 4284317049630762, 121306011298119784, 1980129988160763368, 60512049675634245013, 1076468156084116242851
Offset: 1
Equal number moved left and right, see
A062868.
A179566
Number of permutations of 1..n with the number moved left exceeding the number moved right by 0 or more.
Original entry on oeis.org
1, 1, 2, 5, 19, 83, 501, 3217, 26489, 223001, 2307265, 23964881, 297799569, 3677298385, 53294334289, 762583317329, 12621599431489, 205355314491969, 3820420692695361, 69655479737261377, 1438574866261997777, 29053167748430247953, 659456581268987396785, 14613762897810470264817
Offset: 0
For equal numbers moved left and right, see
A062868.
Showing 1-9 of 9 results.
Comments