First time here? Check out the FAQ!
answered 2014-11-25 21:17:31 +0100
Maybe you can try to use the Zmod rings instead of the mod function?
sage: ring_q = Zmod(691) # defining the ring of integers modulo 691 sage: ring_q(345543423) # converting an integer to this ring 581