cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A072948 Number of permutations p of {1,2,3,...,2n} such that Sum_{k=1..2n} abs(k-p(k)) = 2n.

This page as a plain text file.
%I A072948 #50 Jan 14 2025 09:05:00
%S A072948 1,1,7,46,327,2350,17222,127508,952299,7159090,54107670,410729140,
%T A072948 3129241874,23914923644,183254996828,1407497158968,10832287881639,
%U A072948 83516348514010,644935028526278,4987483388201684,38619491922881310,299390833303838980,2323441087636417604
%N A072948 Number of permutations p of {1,2,3,...,2n} such that Sum_{k=1..2n} abs(k-p(k)) = 2n.
%C A072948 This is impossible if the number of symbols is odd.
%H A072948 Seiichi Manyama, <a href="/A072948/b072948.txt">Table of n, a(n) for n = 0..300</a> (terms 0..71 from Alois P. Heinz)
%H A072948 Mathieu Guay-Paquey and T. Kyle Petersen, <a href="http://arxiv.org/abs/1404.4674">The generating function for total displacement</a>, arXiv:1404.4674 [math.CO], 2014.
%F A072948 a(n) = A062869(2n,n).
%t A072948 f[n_] := If[n == 1, 1, Floor[n/2] t^Floor[(n - 1)/2] z];
%t A072948 F[t_, z_] = ContinuedFractionK[f[i], 1, {i, 1, 8}];
%t A072948 a[n_] := a[n] = SeriesCoefficient[F[t, z], {z, 0, 2 n}, {t, 0, n}];
%t A072948 Table[Print[n, " ", a[n]]; a[n], {n, 1, 15}] (* _Jean-François Alcover_, Feb 25 2019 *)
%o A072948 (PARI) a(n)=sum(k=1,n!,if(sum(i=1,n,abs(i-component(numtoperm(n,k),i)))-n,0,1))
%Y A072948 Cf. A072949, A062869, A357329.
%K A072948 nonn
%O A072948 0,3
%A A072948 _Benoit Cloitre_, Aug 20 2002
%E A072948 a(5) from _Michel ten Voorde_ Jun 13 2003
%E A072948 a(6) from _Ryan Propper_, Mar 26 2007
%E A072948 a(7)-a(8) from _Sean A. Irvine_, Sep 22 2009
%E A072948 a(9)-a(12) from _Robert Gerbicz_, Nov 27 2010
%E A072948 a(13)-a(16) from _Alois P. Heinz_, May 02 2014 using formula given by Guay-Paquey and Petersen
%E A072948 a(17)-a(22) from _Alois P. Heinz_, Oct 01 2022