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 *)
A062866
Triangle of number of permutations by barycenter.
Original entry on oeis.org
1, 1, 2, 1, 4, 1, 1, 4, 14, 4, 1, 1, 5, 31, 46, 31, 5, 1, 1, 6, 66, 146, 282, 146, 66, 6, 1, 1, 7, 134, 392, 1289, 1394, 1289, 392, 134, 7, 1, 1, 8, 267, 960, 4859, 7736, 12658, 7736, 4859, 960, 267, 8, 1, 1, 9, 529, 2235, 16615, 34659, 85831, 83122, 85831, 34659, 16615, 2235, 529, 9, 1
Offset: 0
(1,3,2,5,7,6,4) has difference (0,1,-1,1,2,0,-3) and signs (0,1,-1,1,1,0,-1) with total 1. This is one of 1289 such permutations of degree 7.
Triangle begins:
: 1 ;
: 1 ;
: 2 ;
: 1, 4, 1 ;
: 1, 4, 14, 4, 1 ;
: 1, 5, 31, 46, 31, 5, 1 ;
: 1, 6, 66, 146, 282, 146, 66, 6, 1 ;
: 1, 7, 134, 392, 1289, 1394, 1289, 392, 134, 7, 1 ;
: 1, 8, 267, 960, 4859, 7736, 12658, 7736, 4859, 960, 267, 8, 1 ;
-
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), i=ldegree(p)..degree(p)))(b({$1..n}, 0)):
seq(T(n), n=0..11); # Alois P. Heinz, Jul 31 2018
-
row[n_] := Sort[Tally[Total[Sign[# - Range[n]]]& /@ Permutations[Range[n]] ]][[All, 2]]; Array[row, 9] // Flatten (* Jean-François Alcover, Oct 07 2016 *)
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
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
Showing 1-4 of 4 results.
Comments