Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error in Sage? Integer object is not callable

I call

p = random_prime(5000000, True, 4000000)
print(factor(p-1))

by copy from text file to sage terminal is OK next, I run

factors = [2]

def find_generator(p):
    return 1

for factor in factors:
    generator = find_generator(factor)

no errors yet but when I repeat

p = random_prime(5000000, True, 4000000)
print(factor(p-1))

Is error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-458583a9b4df> in <module>
      1 p = random_prime(Integer(5000000), True, Integer(4000000))
----> 2 print(factor(p-Integer(1)))

TypeError: 'sage.rings.integer.Integer' object is not callable

How avoid this?