Hi Roland,

indeed strange.

I think a reasonable approach is to print some status information,
e.g.:

sage: def expon(mx,g):
....:     print 'expon'
....:     return floor(log(mx)/log(g))+1
....:
sage: def heelsnel(reeks,maxum):
....:     print reeks
....:     if len(reeks)==1: return expon(maxum,reeks[0])
....:     tel=0
....:     for k in range(1,expon(maxum,reeks[-1])):
....:         print k,'->',tel
....:         tel+=heelsnel(reeks[:-1],int(maxum/reeks[-1]^k))
....:     return tel

The protocol output for reeks=[2,5] is actually shorter than for
[2,3], but at some point the computation "takes a break", and this is
inside the "expon" function.

Note that expon uses Maxima, because you use the logarithm. So, I
reckon that your problem is related with 
http://trac.sagemath.org/sage_trac/ticket/4731
and http://trac.sagemath.org/sage_trac/ticket/6818.

Can you test whether the problem remains after applying the patch from
ticket #6818 ?

If not, you might try to work around by thinking what "expon" really
does. For example, one of my first problems with Sage occurred when I
used the logarithm for determining the number of digits of a natural
number n --  len(str(n)) is much faster!

Cheers,
Simon

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to