Mike Hansen <mhan...@gmail.com> writes:

>> I'm not sure whether you saw my answer yet... It shows that you can have
>> full evaluation (as in Python), and still work modulo n.
>
> William was just saying that the mod function in
> mod(2^(2^517)+1,84977118993*2^520+1) couldn't easily recognize of the
> structure in the arguments since they are evaluated before mod sees
> them.
>
>> (I'd be surprised and disappointed if sage cannot do this.)
>
> Here is your example in Sage:
>
> sage: F = Integers(84977118993*2^520+1)
> sage: F(2)^(2^517)+1
> 0
> sage: F(2)^(2^516)+1
> 207830575673500686411447362595659393768941593937702880049854622986883156049131962664562951494983277006774963177214890291645066756995999343954972963541296782130435362337

precisely! thanks.

BTW: could you alternatively specify the expected return type?  I.e.,
tell sage: please use those operations that make the result be in F?

Martin

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to