1. You could be using discrete_log() or one of its variants instead of
your cycle_power() function.
2. In CSP() would it not be faster to work out for each power h=g^k,
how many times h will arise and hence the coefficient of q^k? The
pattern in your example is fairly simple to see.
I know that neither of these points answers your actual question...
John
> @cached_function
> def CSP(n):
> C = groups.permutation.Cyclic(n)
> g = C.gen()
> R.<q> = ZZ[]
> return sum(q^min(cycle_power(g, e) for e in coset) for H in C.subgroups() for coset in C.cosets(H))
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
sage-devel+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-devel/a013e022-a007-4748-9a67-ae1e45f3e825n%40googlegroups.com.