(n: int)
return result
Compute the cycle index
    of S_n, i.e. the symmetry
    group of n symbols.
Compute the cycle index
    of S_n, i.e. the symmetry
    group of n symbols.
Compute the cycle index of S_n i . e . the symmetry group of n symbols .
def get_cycle_index_sym(n: int) -> Polynomial:
    """
    Compute the cycle index
    of S_n, i.e. the symmetry
    group of n symbols.

    """
    if n < 0:
    	raise ValueError('n should be a non-negative integer.')

    memo = {
        0: Polynomial([
            Monomial({}, Fraction(1, 1))
        ]),
        1: Polynomial([
            Monomial({1:1}, Fraction(1, 1))
        ]),
        2: Polynomial([
            Monomial({1: 2}, Fraction(1, 2)),
            Monomial({2: 1}, Fraction(1, 2))
        ]),
        3: Polynomial([
            Monomial({1: 3}, Fraction(1, 6)),
            Monomial({1: 1, 2: 1}, Fraction(1, 2)),
            Monomial({3:1}, Fraction(1, 3))
        ]),
        4: Polynomial([
            Monomial({1:4}, Fraction(1, 24)),
            Monomial({2:1, 1:2},Fraction(1, 4)),
            Monomial({3:1, 1:1}, Fraction(1, 3)),
            Monomial({2:2}, Fraction(1, 8)),
            Monomial({4:1}, Fraction(1, 4)),
        ])
    }
    result = cycle_index_sym_helper(n, memo)
    return result
def get_cycle_index_sym ( n : int ) -> Polynomial : if n < 0 : raise ValueError ( 'n should be a non-negative integer.' ) memo = { 0 : Polynomial ( [ Monomial ( { } , Fraction ( 1 , 1 ) ) ] ) , 1 : Polynomial ( [ Monomial ( { 1 : 1 } , Fraction ( 1 , 1 ) ) ] ) , 2 : Polynomial ( [ Monomial ( { 1 : 2 } , Fraction ( 1 , 2 ) ) , Monomial ( { 2 : 1 } , Fraction ( 1 , 2 ) ) ] ) , 3 : Polynomial ( [ Monomial ( { 1 : 3 } , Fraction ( 1 , 6 ) ) , Monomial ( { 1 : 1 , 2 : 1 } , Fraction ( 1 , 2 ) ) , Monomial ( { 3 : 1 } , Fraction ( 1 , 3 ) ) ] ) , 4 : Polynomial ( [ Monomial ( { 1 : 4 } , Fraction ( 1 , 24 ) ) , Monomial ( { 2 : 1 , 1 : 2 } , Fraction ( 1 , 4 ) ) , Monomial ( { 3 : 1 , 1 : 1 } , Fraction ( 1 , 3 ) ) , Monomial ( { 2 : 2 } , Fraction ( 1 , 8 ) ) , Monomial ( { 4 : 1 } , Fraction ( 1 , 4 ) ) , ] ) } result = cycle_index_sym_helper ( n , memo ) return result