*****************************************************************************
*       www.FindStat.org - The Combinatorial Statistic Finder               *
*                                                                           *
*       Copyright (C) 2019 The FindStatCrew <info@findstat.org>             *
*                                                                           *
*    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: St001098

-----------------------------------------------------------------------------
Collection: Integer partitions

-----------------------------------------------------------------------------
Description: The coefficient times the product of the factorials of the parts of the monomial symmetric function indexed by the partition in the formal group law for vertex labelled trees.

For a generating function $f$ the associated formal group law is the symmetric function $f(f^{(-1)}(x_1) + f^{(-1)}(x_2), \dots)$, see [1].

This statistic records the coefficient of the monomial symmetric function $m_\lambda$ times the product of the factorials of the parts of $\lambda$ in the formal group law for vertex labelled trees, whose reversal of the generating function $f^{(-1)}(x) = x\exp(-x)$, see [1, sec. 3.3]

Fix a set of distinguishable vertices and a coloring of the vertices so that $\lambda_i$ are colored $i$.  Then this statistic gives the number of ways of putting a rooted tree on this set of colored vertices so that no leaf is the same color as its parent.

-----------------------------------------------------------------------------
References: [1]   Taylor, J. Formal group laws and hypergraph colorings [[MathSciNet:3542357]]

-----------------------------------------------------------------------------
Code:
@cached_function
def data(n):
    R.<x> = PowerSeriesRing(SR, default_prec=n+1)
    f_rev = x*exp(-x) # labelled trees
    f = f_rev.reverse()
    f_coefficients = f.list()
    t = var('t')
    polynomials = (t*f_rev).exp().list()
    polynomials = [p.expand() for p in polynomials]
    return (f_coefficients, polynomials)

def statistic(P):
    f_coefficients, polynomials = data(P.size())
    p = SR(1)
    for i in P:
        p *= polynomials[i]
    p = p.expand()
    return (prod(factorial(e) for e in P)
	    *sum(p.coefficient(t,n) * f_coefficients[n] * factorial(n)
                 for n in range(p.degree(t)+1)).expand())


-----------------------------------------------------------------------------
Statistic values:

[2]                   => 0
[1,1]                 => 2
[3]                   => 0
[2,1]                 => 5
[1,1,1]               => 9
[4]                   => 0
[3,1]                 => 16
[2,2]                 => 36
[2,1,1]               => 46
[1,1,1,1]             => 64
[5]                   => 0
[4,1]                 => 65
[3,2]                 => 236
[3,1,1]               => 268
[2,2,1]               => 405
[2,1,1,1]             => 497
[1,1,1,1,1]           => 625
[6]                   => 0
[5,1]                 => 326
[4,2]                 => 1646
[4,1,1]               => 1776
[3,3]                 => 2658
[3,2,1]               => 3682
[3,1,1,1]             => 4218
[2,2,2]               => 4722
[2,2,1,1]             => 5532
[2,1,1,1,1]           => 6526
[1,1,1,1,1,1]         => 7776
[7]                   => 0
[6,1]                 => 1957
[5,2]                 => 12652
[5,1,1]               => 13304
[4,3]                 => 28620
[4,2,1]               => 35529
[4,1,1,1]             => 39081
[3,3,1]               => 48364
[3,2,2]               => 57068
[3,2,1,1]             => 64432
[3,1,1,1,1]           => 72868
[2,2,2,1]             => 77981
[2,2,1,1,1]           => 89045
[2,1,1,1,1,1]         => 102097
[1,1,1,1,1,1,1]       => 117649
[8]                   => 0
[7,1]                 => 13700
[6,2]                 => 107814
[6,1,1]               => 111728
[5,3]                 => 315486
[5,2,1]               => 367724
[5,1,1,1]             => 394332
[4,4]                 => 442880
[4,3,1]               => 640330
[4,2,2]               => 720268
[4,2,1,1]             => 791326
[4,1,1,1,1]           => 869488
[3,3,2]               => 893304
[3,3,1,1]             => 990032
[3,2,2,1]             => 1139986
[3,2,1,1,1]           => 1268850
[3,1,1,1,1,1]         => 1414586
[2,2,2,2]             => 1323608
[2,2,2,1,1]           => 1479570
[2,2,1,1,1,1]         => 1657660
[2,1,1,1,1,1,1]       => 1861854
[1,1,1,1,1,1,1,1]     => 2097152
[9]                   => 0
[8,1]                 => 109601
[7,2]                 => 1015352
[7,1,1]               => 1042752
[6,3]                 => 3654000
[6,2,1]               => 4095041
[6,1,1,1]             => 4318497
[5,4]                 => 6659144
[5,3,1]               => 8747056
[5,2,2]               => 9549024
[5,2,1,1]             => 10284472
[5,1,1,1,1]           => 11073136
[4,4,1]               => 11170353
[4,3,2]               => 14293024
[4,3,1,1]             => 15573684
[4,2,2,1]             => 17351741
[4,2,1,1,1]           => 18934393
[4,1,1,1,1,1]         => 20673369
[3,3,3]               => 16752744
[3,3,2,1]             => 20567780
[3,3,1,1,1]           => 22547844
[3,2,2,2]             => 23169912
[3,2,2,1,1]           => 25449884
[3,2,1,1,1,1]         => 27987584
[3,1,1,1,1,1,1]       => 30816756
[2,2,2,2,1]           => 28854249
[2,2,2,1,1,1]         => 31813389
[2,2,1,1,1,1,1]       => 35128709
[2,1,1,1,1,1,1,1]     => 38852417
[1,1,1,1,1,1,1,1,1]   => 43046721
[10]                  => 0
[9,1]                 => 986410
[8,2]                 => 10506174
[8,1,1]               => 10725376
[7,3]                 => 44918754
[7,2,1]               => 49048662
[7,1,1,1]             => 51134166
[6,4]                 => 101098560
[6,3,1]               => 124671082
[6,2,2]               => 133419804
[6,2,1,1]             => 141609886
[6,1,1,1,1]           => 150246880
[5,5]                 => 131400690
[5,4,1]               => 194969340
[5,3,2]               => 235686288
[5,3,1,1]             => 253180400
[5,2,2,1]             => 275721004
[5,2,1,1,1]           => 296289948
[5,1,1,1,1,1]         => 318436220
[4,4,2]               => 283590654
[4,4,1,1]             => 305931360
[4,3,3]               => 320347536
[4,3,2,1]             => 380721282
[4,3,1,1,1]           => 411868650
[4,2,2,2]             => 419381394
[4,2,2,1,1]           => 454084876
[4,2,1,1,1,1]         => 491953662
[4,1,1,1,1,1,1]       => 533300400
[3,3,3,1]             => 435037384
[3,3,2,2]             => 481123104
[3,3,2,1,1]           => 522258664
[3,3,1,1,1,1]         => 567354352
[3,2,2,2,1]           => 579502682
[3,2,2,1,1,1]         => 630402450
[3,2,1,1,1,1,1]       => 686377618
[3,1,1,1,1,1,1,1]     => 748011130
[2,2,2,2,2]           => 644609030
[2,2,2,2,1,1]         => 702317528
[2,2,2,1,1,1,1]       => 765944306
[2,2,1,1,1,1,1,1]     => 836201724
[2,1,1,1,1,1,1,1,1]   => 913906558
[1,1,1,1,1,1,1,1,1,1] => 1000000000
[11]                  => 0
[10,1]                => 9864101
[9,2]                 => 118687532
[9,1,1]               => 120660352
[8,3]                 => 588005676
[8,2,1]               => 630578377
[8,1,1,1]             => 652029129
[7,4]                 => 1579007720
[7,3,1]               => 1863969724
[7,2,2]               => 1967280808
[7,2,1,1]             => 2065378132
[12]                  => 0
[11,1]                => 108505112
[10,2]                => 1455009206
[10,1,1]              => 1474737408

-----------------------------------------------------------------------------
Created: Feb 02, 2018 at 20:09 by Martin Rubey

-----------------------------------------------------------------------------
Last Updated: Feb 04, 2018 at 21:51 by Jair Taylor