***************************************************************************** * 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: St000275 ----------------------------------------------------------------------------- Collection: Integer partitions ----------------------------------------------------------------------------- Description: Number of permutations whose sorted list of non zero multiplicities of the Lehmer code is the given partition. ----------------------------------------------------------------------------- References: [1] Hivert, F., Novelli, J.-C., Thibon, J.-Y. Multivariate generalizations of the Foata-Schützenberger equidistribution [[MathSciNet:2509639]] [[arXiv:math/0605060]] ----------------------------------------------------------------------------- Code: import collections def part_of_perm(p): c = p.to_lehmer_code() return Partition(sorted([c.count(i) for i in range(len(p)) if i in c])[::-1]) @cached_function def stat(N): res = collections.defaultdict(int) for p in Permutations(N): res[part_of_perm(p)] += 1 return dict(res) def statistic(L): return stat(L.size())[L] ----------------------------------------------------------------------------- Statistic values: [7,3] => 255 [4,2,2] => 768 [4,4,1] => 1736 [4,2,1,1,1] => 43422 [3] => 1 [1,1,1,1] => 1 [5,4,1] => 8220 [6,1,1,1] => 2934 [6,2] => 64 [5,2,1] => 1038 [4,2] => 26 [7,1,1] => 491 [2,2,2,1,1,1] => 28768 [7,2,1] => 3788 [2,1,1,1,1,1] => 120 [3,1,1,1,1,1,1] => 4414 [4,2,2,1,1] => 325500 [3,3,2,1] => 22680 [4,3,1,1] => 18864 [5,5] => 210 [2,2,2,2] => 496 [2,2,2,1] => 496 [1,1,1,1,1,1,1,1,1] => 1 [5,2,1,1] => 14988 [3,2,2] => 294 [4,3,2,1] => 156894 [3,3,2,1,1] => 346539 [2,2,2,2,1] => 11056 [3,1,1,1,1,1,1,1] => 13744 [7] => 1 [4,4,1,1] => 31016 [1,1] => 1 [6,2,2] => 3868 [3,2] => 15 [4,1,1,1,1,1,1] => 44002 [3,1,1] => 32 [8,2] => 130 [3,2,1] => 192 [5,1,1,1,1] => 8157 [4,1,1,1,1] => 2127 [8] => 1 [2,2,1,1,1,1,1,1] => 34096 [3,1,1,1,1,1] => 1389 [4,2,2,1] => 20838 [3,2,2,1] => 5946 [3,2,2,1,1] => 70206 [5,1,1,1] => 1206 [2,2,2,1,1,1,1] => 166042 [3,2,2,2] => 7930 [4,1,1] => 76 [6,3,1] => 6426 [2,2,1,1,1,1] => 2904 [2,2,1,1,1] => 768 [5,3] => 98 [5,3,1] => 3068 [2,2,2,1,1] => 4288 [3,3,3,1] => 28665 [2,1,1,1,1,1,1] => 247 [3,2,1,1,1] => 9204 [6,2,1] => 2062 [3,1] => 7 [6,1,1,1,1] => 25761 [4,1,1,1] => 426 [4] => 1 [1,1,1,1,1,1,1,1,1,1] => 1 [5,2,2,1] => 63456 [] => 1 [3,3,2,2] => 46470 [6,1,1] => 288 [1,1,1,1,1] => 1 [2,1,1,1,1,1,1,1,1] => 1013 [4,3,2] => 4590 [3,2,1,1,1,1,1] => 245148 [2,1,1,1,1,1,1,1] => 502 [2,2,1,1] => 180 [3,3,1,1,1] => 23349 [9,1] => 46 [3,2,1,1,1,1] => 49569 [3,3,1,1] => 2829 [2,2,2,2,2] => 11056 [5,2,1,1,1] => 165978 [2,1] => 4 [5,3,1,1] => 55328 [4,2,1,1] => 5142 [3,3,1] => 267 [4,3,3] => 7155 [5,3,2] => 11270 [3,2,2,1,1,1] => 635610 [5,1] => 16 [4,2,1,1,1,1] => 316164 [9] => 1 [3,3,3] => 855 [4,3,1] => 1344 [3,3] => 15 [1] => 1 [3,3,2] => 855 [8,1] => 37 [5,2,2] => 1806 [4,1,1,1,1,1] => 9897 [4,4] => 56 [2,2,2,2,1,1] => 141584 [5,1,1] => 156 [3,1,1,1] => 122 [6,3] => 162 [5] => 1 [7,2] => 93 [2,2] => 4 [4,1] => 11 [2,2,1,1,1,1,1] => 10194 [1,1,1,1,1,1] => 1 [6,4] => 372 [5,4] => 210 [1,1,1,1,1,1,1,1] => 1 [6,2,1,1] => 38224 [2,1,1,1] => 26 [7,1] => 29 [1,1,1,1,1,1,1] => 1 [10] => 1 [8,1,1] => 787 [1,1,1] => 1 [5,1,1,1,1,1] => 50682 [4,2,2,2] => 28768 [2,2,2] => 34 [3,1,1,1,1] => 423 [2,1,1,1,1] => 57 [4,3,1,1,1] => 203304 [2,2,1] => 34 [2] => 1 [6,1] => 22 [2,1,1] => 11 [3,3,1,1,1,1] => 166314 [4,2,1] => 474 [7,1,1,1] => 6371 [6] => 1 [4,3] => 56 [3,2,1,1] => 1494 [3,2,2,2,1] => 232216 [5,2] => 42 [4,4,2] => 6326 ----------------------------------------------------------------------------- Created: Sep 04, 2015 at 17:58 by Florent Hivert ----------------------------------------------------------------------------- Last Updated: Sep 15, 2015 at 15:49 by Christian Stump