Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why does list(primes(2,10)) behave different from [2,3,5,7]?

I'm trying to run the following code: http://pastebin.com/UrBHRxr7

I experience a very strange behaviour. With this code I'll hit a memory limit even for the first integral that is being calculated. If I comment out line 17 and use line 16 instead (so primes = [2,3,5,7] instead of primes = list(primes(2,10))) the computation goes through quickly and without any problems!

What could be the source for this? How can I rewrite the code so that I can use parameters instead of a hard-coded list?

I'm using Sage Version 4.8, Release Date: 2012-01-20.