[sage-support] Re: counting cusps for the principal congruence subgroup

2010-12-21 Thread John Cremona
On Dec 21, 1:38 am, rje ronevan...@gmail.com wrote: Thanks for the helpful response.  The appropriate code  for computing Gamma(n).ncusps() is n=self.level() if n=2:         return[None,1,3][n] return ZZ(sum([moebius(d)*(n/d)^2/ZZ(2) for d in n.divisors()])) But can I impose on someone

[sage-support] Re: counting cusps for the principal congruence subgroup

2010-12-21 Thread John Cremona
There's now a patch at #10506 (http://trac.sagemath.org/sage_trac/ ticket/10506) ready for review. John Cremona On Dec 21, 11:40 am, John Cremona john.crem...@gmail.com wrote: On Dec 21, 1:38 am, rje ronevan...@gmail.com wrote: Thanks for the helpful response.  The appropriate code  for

[sage-support] Re: counting cusps for the principal congruence subgroup

2010-12-21 Thread rje
Your product formula is a good idea. It's faster than my summation formula. On Dec 21, 3:40 am, John Cremona john.crem...@gmail.com wrote: On Dec 21, 1:38 am, rje ronevan...@gmail.com wrote: Thanks for the helpful response.  The appropriate code  for computing Gamma(n).ncusps() is

[sage-support] Re: counting cusps for the principal congruence subgroup

2010-12-20 Thread John Cremona
You are right, and you can see the reason like this: sage: G = Gamma(5) sage: G.ncusps?? shows that the code is a one-liner return ZZ(len(self.cusps())) i.e. a complete set of cusps is computed (to see how, do G.cusps??), while for the other groups a formula is used, e.g. sage: G = Gamma0(5)

[sage-support] Re: counting cusps for the principal congruence subgroup

2010-12-20 Thread rje
Thanks for the helpful response. The appropriate code for computing Gamma(n).ncusps() is n=self.level() if n=2: return[None,1,3][n] return ZZ(sum([moebius(d)*(n/d)^2/ZZ(2) for d in n.divisors()])) But can I impose on someone who knows the ticketing procedure to get this implemented?