OFFSET
0,3
COMMENTS
This is impossible if the number of symbols is odd.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..71
Mathieu Guay-Paquey and T. Kyle Petersen, The generating function for total displacement, arXiv:1404.4674 [math.CO], 2014.
FORMULA
a(n) = A062869(2n,n).
MATHEMATICA
f[n_] := If[n == 1, 1, Floor[n/2] t^Floor[(n - 1)/2] z];
F[t_, z_] = ContinuedFractionK[f[i], 1, {i, 1, 8}];
a[n_] := a[n] = SeriesCoefficient[F[t, z], {z, 0, 2 n}, {t, 0, n}];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 15}] (* Jean-François Alcover, Feb 25 2019 *)
PROG
(PARI) a(n)=sum(k=1, n!, if(sum(i=1, n, abs(i-component(numtoperm(n, k), i)))-n, 0, 1))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Aug 20 2002
EXTENSIONS
a(5) from Michel ten Voorde Jun 13 2003
a(6) from Ryan Propper, Mar 26 2007
a(7)-a(8) from Sean A. Irvine, Sep 22 2009
a(9)-a(12) from Robert Gerbicz, Nov 27 2010
a(13)-a(16) from Alois P. Heinz, May 02 2014 using formula given by Guay-Paquey and Petersen
a(17)-a(22) from Alois P. Heinz, Oct 01 2022
STATUS
approved