Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Loop is not finishing execution

I have the following Sage code:

p1 = 2 p2 = 5 e1 = ceil(100log(2,p1)) e2 = ceil(5060log(2,p2)) f = 1 p = p1^e1p2^e2-1 while p not in Primes(): f = f + 1 p = p1^e1p2^e2*f-1 p

I'm running this code in Sage Notebook, in a cell, but the value of p is never printed. I guess it is not finishing the execution. If I run the same code in Magma, it finishes after few seconds with the result of p. Any ideas what the problem might be?

Loop is not finishing execution

I have the following Sage code:

p1 = 2
p2 = 5
e1 = ceil(100log(2,p1))
ceil(100*log(2,p1))
e2 = ceil(5060log(2,p2))
ceil(5060*log(2,p2))
f = 1
p = p1^e1p2^e2-1
p1^e1*p2^e2-1
while p not in Primes():
    f = f + 1
    p = p1^e1p2^e2*f-1
p 

p1^e1*p2^e2*f-1 p

I'm running this code in Sage Notebook, in a cell, but the value of p is never printed. I guess it is not finishing the execution. If I run the same code in Magma, it finishes after few seconds with the result of p. Any ideas what the problem might be?