Max Alekseyev on Sat, 19 Oct 2024 17:08:44 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

number of permutations with a given cycle structure


Hello,

Any integer partition p of n can be treated as a cycle type of the permutations of n, and the number of those permutations is a fundamental function of p that would be nice to have handy in PARI.
Just in case, an explicit formula for this function can be seen in https://en.wikipedia.org/wiki/Permutation#Cycle_type
I was not able to find it in PARI, and if it's indeed missing, could you please add it?

On a related note, I'd appreciate it if this function is not restricted to t_VECSMALL type, but can also accept t_VEC.
I already see trouble with that in permcycles() when a permutation is manually constructed as t_VEC. Btw, can permcycles() be made to accept t_VEC as well?

Thanks,
Max