mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2019-06-19, 01:06   #1
tServo
 
tServo's Avatar
 
"Marv"
May 2009
near the Tannhäuser Gate

2A616 Posts
Default How does this compute

Can someone please explain how this Mod is computed?
TIA

Code:
(20:02) gp > (Mod(2633043,8388607)/9)
%1 = Mod(5884965, 8388607)
(20:02) gp > lift(%1)
%2 = 5884965]
tServo is offline   Reply With Quote
Old 2019-06-19, 01:15   #2
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

75368 Posts
Default

Quote:
Originally Posted by tServo View Post
Can someone please explain how this Mod is computed?
TIA

Code:
(20:02) gp > (Mod(2633043,8388607)/9)
%1 = Mod(5884965, 8388607)
(20:02) gp > lift(%1)
%2 = 5884965]
It computes 2633043 mod 8388607

Then 2633043/9 mod 8388607

Then "lifts" it to an integer.

It does the division by some kind of extended euclidian algorithm. Note that gcd(8388607,9)==1 must be so.

9 * 5884965 == 2633043 mod 8388607

That is 8388607 divides 9 * 5884965 - 2633043

Last fiddled with by paulunderwood on 2019-06-19 at 01:18
paulunderwood is offline   Reply With Quote
Old 2019-06-19, 01:17   #3
hansl
 
hansl's Avatar
 
Apr 2019

3158 Posts
Default

https://en.wikipedia.org/wiki/Modula...cative_inverse

Code:
? Mod(2633043,8388607)/9
%5 = Mod(5884965, 8388607)
? Mod(9,8388607)^-1
%6 = Mod(1864135, 8388607)
? Mod(1/9,8388607)
%7 = Mod(1864135, 8388607)
? Mod(2633043*1864135, 8388607)
%8 = Mod(5884965, 8388607)
?
hansl is offline   Reply With Quote
Old 2019-06-22, 14:48   #4
tServo
 
tServo's Avatar
 
"Marv"
May 2009
near the Tannhäuser Gate

2×3×113 Posts
Default

Thanks ! I appreciate your time.
tServo is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google compute engine pepi37 Software 14 2018-09-08 01:26
New GPU Compute System airsquirrels GPU Computing 90 2017-12-08 00:13
Piddling Around With Big Compute Power NBtarheel_33 GPU Computing 54 2013-05-15 03:32
New Compute Box Christenson Hardware 0 2011-01-15 04:44
My throughput does not compute... petrw1 Hardware 9 2007-08-13 14:38

All times are UTC. The time now is 01:05.


Thu Dec 2 01:05:21 UTC 2021 up 131 days, 19:34, 1 user, load averages: 1.07, 0.99, 0.89

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.