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.

A126972 Number of distinct values taken by the entropy for permutations of [1..n], where the entropy of a permutation pi is Sum_{k=1..n} (pi(k)-k)^2.

This page as a plain text file.
%I A126972 #52 Sep 02 2025 04:16:48
%S A126972 1,1,2,4,11,21,36,57,85,121,166,221,287,365,456,561,681,817,970,1141,
%T A126972 1331,1541,1772,2025,2301,2601,2926,3277,3655,4061,4496,4961,5457,
%U A126972 5985,6546,7141,7771,8437,9140,9881,10661,11481,12342,13245,14191,15181,16216
%N A126972 Number of distinct values taken by the entropy for permutations of [1..n], where the entropy of a permutation pi is Sum_{k=1..n} (pi(k)-k)^2.
%C A126972 Also, number of distinct values taken by Sum_{k=1..n} k * pi(k). - _Joerg Arndt_, Apr 22 2011
%C A126972 For n>=4, Sum_{k=1..n} k * pi(k) takes every value in the interval [A000292(n),A000330(n)] (cf. A175929). - _Max Alekseyev_, Jan 28 2012
%H A126972 J. Sack and H. Ăšlfarsson, <a href="http://arxiv.org/abs/1106.1995">Refined inversion statistics on permutations</a>, arXiv preprint arXiv:1106.1995 [math.CO], 2011-2012.
%H A126972 Zhi-Wei Sun, <a href="https://arxiv.org/abs/1811.10503">On permutations of {1, ..., n} and related topics</a>, arXiv:1811.10503 [math.CO], 2018.
%H A126972 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F A126972 For n>=4, a(n) = 1 + binomial(n+1,3) = 1 + A000330(n) - A000292(n) = 1 + A000292(n-1).
%F A126972 G.f.: -(x^7-4*x^6+6*x^5-4*x^4+2*x^3-4*x^2+3*x-1)/(x-1)^4. - _M. F. Hasler_, Jan 12 2012
%e A126972 For 24 permutations of {1,2,3,4}, the set of sum(k=1..n, (pi(k)-k)^2) yields {0,2,4,6,8,10,12,14,16,18,20} (11 distinct values).
%e A126972 For 120 permutations of {1,2,3,4,5}, the set of sum(k=1..n, (pi(k)-k)^2) yields {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,36,38,40} (21 values).
%t A126972 LinearRecurrence[{4,-6,4,-1},{1,1,2,4,11,21,36,57},50] (* _Harvey P. Dale_, Jun 01 2016; a(0)=1 prepended by _Georg Fischer_, Apr 10 2019 *)
%o A126972 (PARI) A126972(n)=(n!=3)+binomial(n+1,3)  \\ _M. F. Hasler_, Jan 29 2012
%o A126972 (PARI) /* the following inefficient code is for illustrative purpose only: */ A126972(n)={my(u=0,v=vector(n,i,i),t); sum(k=1,n!, !bittest(u,t=norml2(numtoperm(n,k)-v)) & u+=1<<t) } /* _M. F. Hasler_, Jan 29 2012 */
%Y A126972 Cf. A007290 (largest permutation entropy), A000292 (average permutation entropy), A135298, A175929.
%K A126972 nonn,easy,changed
%O A126972 0,3
%A A126972 Jeff Boscole (jazzerciser(AT)hotmail.com), Mar 20 2007
%E A126972 Formula corrected by _Joel B. Lewis_, Aug 18 2009
%E A126972 Terms corrected, more terms added, and definition clarified by _Joerg Arndt_, Apr 22 2011
%E A126972 a(0)=1 prepended by _Alois P. Heinz_, Jan 22 2019