The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A072949 Number of permutations p of (1,2,3,...,n) such that sum(k=1,n,abs(k-p(k)))=2n. 2
 0, 0, 0, 4, 24, 148, 744, 3696, 17640, 83420, 390144, 1817652, 8438664, 39117852, 181136304, 838372452, 3879505944, 17952463180, 83086702848, 384626048292, 1781018204328, 8249656925564, 38225193868560, 177179811427796, 821544012667704, 3810648054607212 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,4 COMMENTS a(n) is always even. More generally, A062869(n,k) is even whenever k >= n. - Conjectured by Franklin T. Adams-Watters, proved by Max Alekseyev. (see link in A062869) LINKS Mathieu Guay-Paquey and T. Kyle Petersen, The generating function for total displacement, arXiv:1404.4674, 2014 MAPLE with(linalg): f := (i, j) -> x^(abs(i-j)):for n from 1 to 17 do A := matrix(n, n, f): printf("%d, ", coeff(permanent(A), x, 2*n)) od: # Herman Jamke (hermanjamke(AT)fastmail.fm), Apr 27 2008 MATHEMATICA g[h_, n_] := 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]]]; a[n_ /; n<4] = 0; a[n_] := SeriesCoefficient[1/g[0, n], {z, 0, n}, {t, 0, n}]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 26}] (* Jean-François Alcover, Jan 07 2016, after Alois P. Heinz *) PROG (PARI) a(n)=sum(k=1, n!, if(sum(i=1, n, abs(i-component(numtoperm(n, k), i)))-2*n, 0, 1)) CROSSREFS Cf. A072948, A062869. Sequence in context: A045915 A052609 A077613 * A104531 A225050 A045738 Adjacent sequences:  A072946 A072947 A072948 * A072950 A072951 A072952 KEYWORD nonn AUTHOR Benoit Cloitre, Aug 20 2002 EXTENSIONS More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Apr 27 2008 a(18)-a(21) from Robert Gerbicz, Nov 21 2010 a(22)-a(26) from Alois P. Heinz, May 02 2014 using formula given by Guay-Paquey and Petersen STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 5 12:47 EDT 2020. Contains 334840 sequences. (Running on oeis4.)