%I
%S 1,0,0,2,6,0,184,936,6688,0,420480,4298664,44405142,0,6732621476,
%T 92014579912,1345077232898,0,349174373111790,6179276762966832,
%U 114913276077265202,0
%N Number of permutations (p_1, ..., p_n) of {1,...,n} that are "balanced" in the sense that the sum of k*p_k equals the sum of (n+1k)*p_k; equivalently, the expected value of k*p_k is (expected value of k) times (expected value of p_k), assuming the uniform distribution.
%C a(4k+2) = 0; also, the same sequence enumerates permutations of {0,1,...,n1} with the stated expected value property.
%C Also, central coefficients in the expansion of the probability generating function for the exact null distribution of Spearman's rho.  Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), May 14 2002
%D D. E. Knuth, The Art of Computer Programming: Generating all tuples and permutations, Volume 4, Fascicle 2, AddisonWesley, Upper Saddle River, NJ (2005); p. 74, Exercise 104.
%D Ivan Moscovich, More Brainmatics Logic Puzzles, see p. 130.  from Neven Juric, Jan 21 2010.
%H Dongyang Cheng and Petros Hadjicostas, <a href="https://ajc.maths.uq.edu.au/pdf/57/ajc_v57_p157.pdf">Rightinvariant metrics applied to rank correlation coefficients</a>, Australas. J. Combin. 57 (2013), 157187; see Section 5 for similar questions about other nonparametric rank correlation coefficients.
%H E. I. Marshall, <a href="https://www.jstor.org/stable/25052818">Conditions for rank correlation to be zero</a>, Sankhyā 56(1) (1994), 5966; he proved that a(n) = 0 if and only if n = 3 or n = 4*k+2 for some integer k >= 0 (see Theorem 2, p. 62).
%H M. A. van de Wiel and A. Di Bucchianico, <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.45.7124">Fast computation of the exact null distribution of Spearman's rho and Page's L statistic for samples with and without ties</a>, Memorandum COSOR 9817, 1998, Eindhoven University of Technology.
%H M. A. van de Wiel and A. Di Bucchianico, <a href="https://research.tue.nl/en/publications/fastcomputationoftheexactnulldistributionofspearmansrho">Fast computation of the exact null distribution of Spearman's rho and Page's L statistic for samples with and without ties</a>, Memorandum COSOR 9817, 1998, Eindhoven University of Technology.
%H M. A. van de Wiel and A. Di Bucchianico, <a href="https://doi.org/10.1016/S03783758(00)00166X">Fast computation of the exact null distribution of Spearman's rho and Page's L statistic for samples with and without ties</a>, J. Statist. Plann. Inference, 92(12) (2001), 133145.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient">Spearman rank correlation coefficient</a>.
%e a(5) = 6 because of the permutations 15432, 23451, 25314, 41352, 43215, 51234.
%K hard,nonn
%O 1,4
%A _Don Knuth_, Sep 03 2000
%E More terms from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), May 14 2002
