Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using powermod in a loop

Sorry if this question is naive, I have just started using Sage. I was playing around with Carmichael numbers and wanted to produce a list of a^n mod n for various values of a.

I thought the code for k in range(2,5): j = k.powermod(n,n)

would do what I wanted. But I get the error message 'int' object has no attribute 'powermod'

Any suggestions?