David Cleaver on Mon, 19 Oct 2009 07:24:57 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Calculating powmod...



Bill Allombert wrote:
On Sun, Oct 18, 2009 at 11:20:51AM -0500, David Cleaver wrote:
Hello,

I'm interested in calculating "powmod"'s such as:
Mod(2^9182347891540, 9182347891541)
However, when I ran the function, it gave an error:
 ***   length (lg) overflow

Of course because PARI cannot compute 2^9182347891540.
You should compute with the class of 2 in in Z/9182347891541Z, i.e.
Mod(2, 9182347891541).  In that case you get:

? Mod(2, 9182347891541)^9182347891540
%1 = Mod(7569093976632, 9182347891541)

Cheers,
Bill.


Thank you very much for this answer.

Also, is there a way to print out timing information at the end of a program? I know that when a "program" I've written finishes, I can do a ## to see how long it took to run. But, I'd like to somehow put that command into the program. When I tried "##" or "##;", it said "unexpected character(s)" and pointed to right after the "##".

-David C.