First time here? Check out the FAQ!
answered 6 years ago
The problem is that range produces Python int, not Sage integers, hence the powermod method is not avaiable. Just replace range with srange and it shoud work !
range
int
powermod
srange