***************************************************************************** * www.FindStat.org - The Combinatorial Statistic Finder * * * * Copyright (C) 2019 The FindStatCrew * * * * This information is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * ***************************************************************************** ----------------------------------------------------------------------------- Statistic identifier: St000992 ----------------------------------------------------------------------------- Collection: Integer partitions ----------------------------------------------------------------------------- Description: The alternating sum of the parts of an integer partition. For a partition $\lambda = (\lambda_1,\ldots,\lambda_k)$, this is $\lambda_1 - \lambda_2 + \cdots \pm \lambda_k$. ----------------------------------------------------------------------------- References: ----------------------------------------------------------------------------- Code: def statistic(L): return sum( (-1)^k*L[k] for k in range(len(L)) ) ----------------------------------------------------------------------------- Statistic values: [] => 0 [1] => 1 [2] => 2 [1,1] => 0 [3] => 3 [2,1] => 1 [1,1,1] => 1 [4] => 4 [3,1] => 2 [2,2] => 0 [2,1,1] => 2 [1,1,1,1] => 0 [5] => 5 [4,1] => 3 [3,2] => 1 [3,1,1] => 3 [2,2,1] => 1 [2,1,1,1] => 1 [1,1,1,1,1] => 1 [6] => 6 [5,1] => 4 [4,2] => 2 [4,1,1] => 4 [3,3] => 0 [3,2,1] => 2 [3,1,1,1] => 2 [2,2,2] => 2 [2,2,1,1] => 0 [2,1,1,1,1] => 2 [1,1,1,1,1,1] => 0 [7] => 7 [6,1] => 5 [5,2] => 3 [5,1,1] => 5 [4,3] => 1 [4,2,1] => 3 [4,1,1,1] => 3 [3,3,1] => 1 [3,2,2] => 3 [3,2,1,1] => 1 [3,1,1,1,1] => 3 [2,2,2,1] => 1 [2,2,1,1,1] => 1 [2,1,1,1,1,1] => 1 [1,1,1,1,1,1,1] => 1 [8] => 8 [7,1] => 6 [6,2] => 4 [6,1,1] => 6 [5,3] => 2 [5,2,1] => 4 [5,1,1,1] => 4 [4,4] => 0 [4,3,1] => 2 [4,2,2] => 4 [4,2,1,1] => 2 [4,1,1,1,1] => 4 [3,3,2] => 2 [3,3,1,1] => 0 [3,2,2,1] => 2 [3,2,1,1,1] => 2 [3,1,1,1,1,1] => 2 [2,2,2,2] => 0 [2,2,2,1,1] => 2 [2,2,1,1,1,1] => 0 [2,1,1,1,1,1,1] => 2 [1,1,1,1,1,1,1,1] => 0 [9] => 9 [8,1] => 7 [7,2] => 5 [7,1,1] => 7 [6,3] => 3 [6,2,1] => 5 [6,1,1,1] => 5 [5,4] => 1 [5,3,1] => 3 [5,2,2] => 5 [5,2,1,1] => 3 [5,1,1,1,1] => 5 [4,4,1] => 1 [4,3,2] => 3 [4,3,1,1] => 1 [4,2,2,1] => 3 [4,2,1,1,1] => 3 [4,1,1,1,1,1] => 3 [3,3,3] => 3 [3,3,2,1] => 1 [3,3,1,1,1] => 1 [3,2,2,2] => 1 [3,2,2,1,1] => 3 [3,2,1,1,1,1] => 1 [3,1,1,1,1,1,1] => 3 [2,2,2,2,1] => 1 [2,2,2,1,1,1] => 1 [2,2,1,1,1,1,1] => 1 [2,1,1,1,1,1,1,1] => 1 [1,1,1,1,1,1,1,1,1] => 1 [10] => 10 [9,1] => 8 [8,2] => 6 [8,1,1] => 8 [7,3] => 4 [7,2,1] => 6 [7,1,1,1] => 6 [6,4] => 2 [6,3,1] => 4 [6,2,2] => 6 [6,2,1,1] => 4 [6,1,1,1,1] => 6 [5,5] => 0 [5,4,1] => 2 [5,3,2] => 4 [5,3,1,1] => 2 [5,2,2,1] => 4 [5,2,1,1,1] => 4 [5,1,1,1,1,1] => 4 [4,4,2] => 2 [4,4,1,1] => 0 [4,3,3] => 4 [4,3,2,1] => 2 [4,3,1,1,1] => 2 [4,2,2,2] => 2 [4,2,2,1,1] => 4 [4,2,1,1,1,1] => 2 [4,1,1,1,1,1,1] => 4 [3,3,3,1] => 2 [3,3,2,2] => 0 [3,3,2,1,1] => 2 [3,3,1,1,1,1] => 0 [3,2,2,2,1] => 2 [3,2,2,1,1,1] => 2 [3,2,1,1,1,1,1] => 2 [3,1,1,1,1,1,1,1] => 2 [2,2,2,2,2] => 2 [2,2,2,2,1,1] => 0 [2,2,2,1,1,1,1] => 2 [2,2,1,1,1,1,1,1] => 0 [2,1,1,1,1,1,1,1,1] => 2 [1,1,1,1,1,1,1,1,1,1] => 0 [11] => 11 [10,1] => 9 [9,2] => 7 [9,1,1] => 9 [8,3] => 5 [8,2,1] => 7 [8,1,1,1] => 7 [7,4] => 3 [7,3,1] => 5 [7,2,2] => 7 [7,2,1,1] => 5 [7,1,1,1,1] => 7 [6,5] => 1 [6,4,1] => 3 [6,3,2] => 5 [6,3,1,1] => 3 [6,2,2,1] => 5 [6,2,1,1,1] => 5 [6,1,1,1,1,1] => 5 [5,5,1] => 1 [5,4,2] => 3 [5,4,1,1] => 1 [5,3,3] => 5 [5,3,2,1] => 3 [5,3,1,1,1] => 3 [5,2,2,2] => 3 [5,2,2,1,1] => 5 [5,2,1,1,1,1] => 3 [5,1,1,1,1,1,1] => 5 [4,4,3] => 3 [4,4,2,1] => 1 [4,4,1,1,1] => 1 [4,3,3,1] => 3 [4,3,2,2] => 1 [4,3,2,1,1] => 3 [4,3,1,1,1,1] => 1 [4,2,2,2,1] => 3 [4,2,2,1,1,1] => 3 [4,2,1,1,1,1,1] => 3 [4,1,1,1,1,1,1,1] => 3 [3,3,3,2] => 1 [3,3,3,1,1] => 3 [3,3,2,2,1] => 1 [3,3,2,1,1,1] => 1 [3,3,1,1,1,1,1] => 1 [3,2,2,2,2] => 3 [3,2,2,2,1,1] => 1 [3,2,2,1,1,1,1] => 3 [3,2,1,1,1,1,1,1] => 1 [3,1,1,1,1,1,1,1,1] => 3 [2,2,2,2,2,1] => 1 [2,2,2,2,1,1,1] => 1 [2,2,2,1,1,1,1,1] => 1 [2,2,1,1,1,1,1,1,1] => 1 [2,1,1,1,1,1,1,1,1,1] => 1 [1,1,1,1,1,1,1,1,1,1,1] => 1 [12] => 12 [11,1] => 10 [10,2] => 8 [10,1,1] => 10 [9,3] => 6 [9,2,1] => 8 [9,1,1,1] => 8 [8,4] => 4 [8,3,1] => 6 [8,2,2] => 8 [8,2,1,1] => 6 [8,1,1,1,1] => 8 [7,5] => 2 [7,4,1] => 4 [7,3,2] => 6 [7,3,1,1] => 4 [7,2,2,1] => 6 [7,2,1,1,1] => 6 [7,1,1,1,1,1] => 6 [6,6] => 0 [6,5,1] => 2 [6,4,2] => 4 [6,4,1,1] => 2 [6,3,3] => 6 [6,3,2,1] => 4 [6,3,1,1,1] => 4 [6,2,2,2] => 4 [6,2,2,1,1] => 6 [6,2,1,1,1,1] => 4 [6,1,1,1,1,1,1] => 6 [5,5,2] => 2 [5,5,1,1] => 0 [5,4,3] => 4 [5,4,2,1] => 2 [5,4,1,1,1] => 2 [5,3,3,1] => 4 [5,3,2,2] => 2 [5,3,2,1,1] => 4 [5,3,1,1,1,1] => 2 [5,2,2,2,1] => 4 [5,2,2,1,1,1] => 4 [5,2,1,1,1,1,1] => 4 [5,1,1,1,1,1,1,1] => 4 [4,4,4] => 4 [4,4,3,1] => 2 [4,4,2,2] => 0 [4,4,2,1,1] => 2 [4,4,1,1,1,1] => 0 [4,3,3,2] => 2 [4,3,3,1,1] => 4 [4,3,2,2,1] => 2 [4,3,2,1,1,1] => 2 [4,3,1,1,1,1,1] => 2 [4,2,2,2,2] => 4 [4,2,2,2,1,1] => 2 [4,2,2,1,1,1,1] => 4 [4,2,1,1,1,1,1,1] => 2 [4,1,1,1,1,1,1,1,1] => 4 [3,3,3,3] => 0 [3,3,3,2,1] => 2 [3,3,3,1,1,1] => 2 [3,3,2,2,2] => 2 [3,3,2,2,1,1] => 0 [3,3,2,1,1,1,1] => 2 [3,3,1,1,1,1,1,1] => 0 [3,2,2,2,2,1] => 2 [3,2,2,2,1,1,1] => 2 [3,2,2,1,1,1,1,1] => 2 [3,2,1,1,1,1,1,1,1] => 2 [3,1,1,1,1,1,1,1,1,1] => 2 [2,2,2,2,2,2] => 0 [2,2,2,2,2,1,1] => 2 [2,2,2,2,1,1,1,1] => 0 [2,2,2,1,1,1,1,1,1] => 2 [2,2,1,1,1,1,1,1,1,1] => 0 [2,1,1,1,1,1,1,1,1,1,1] => 2 [1,1,1,1,1,1,1,1,1,1,1,1] => 0 [5,4,3,1] => 3 [5,4,2,2] => 1 [5,4,2,1,1] => 3 [5,3,3,2] => 3 [5,3,3,1,1] => 5 [5,3,2,2,1] => 3 [4,4,3,2] => 1 [4,4,3,1,1] => 3 [4,4,2,2,1] => 1 [4,3,3,2,1] => 3 [5,4,3,2] => 2 [5,4,3,1,1] => 4 [5,4,2,2,1] => 2 [5,3,3,2,1] => 4 [4,4,3,2,1] => 2 [5,4,3,2,1] => 3 [7,5,3,1] => 4 [7,5,4,3,1] => 4 [6,5,4,3,2,1] => 3 [11,7,5,1] => 8 [9,7,5,3,1] => 5 [7,6,5,4,3,2,1] => 4 [9,7,5,5,3,1] => 4 [11,9,7,5,3,1] => 6 [11,8,7,5,4,1] => 8 [8,7,6,5,4,3,2,1] => 4 [11,9,7,6,5,3,1] => 6 [13,11,9,7,5,3,1] => 7 [13,11,9,7,7,5,3,1] => 8 [17,13,11,9,7,5,1] => 9 [15,13,11,9,7,5,3,1] => 8 [29,23,19,17,13,11,7,1] => 16 ----------------------------------------------------------------------------- Created: Oct 17, 2017 at 11:36 by Christian Stump ----------------------------------------------------------------------------- Last Updated: Sep 07, 2020 at 19:49 by Martin Rubey