Re: gaussian integer modulus / Pollard's rho method on gaussian integers

[email protected] Thu, 27 Nov 2025 15:01:31 +0100
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <[email protected]>
On 2025-11-27 13:15, [email protected] wrote:
> ...
> Now with nfinit I get same disvisor:
> 
> ? C=nfinit(y^2+1);
> ? a=190+190*y;
> ? b=19+4*y;
> ? nfeltdiveuc(C,a,b)
> [12, 8]~
> ?
> 
> But how to get the modulus from that like in gimod2?
> 
> ? a-(12+8*y)*b
> -32*y^2 - 10*y - 38
> ?
> 
I learned how to do that, just apply Mod():

? K=nfinit(y^2+1);
? a=190+190*y;
? b=19+4*y;
? nfeltdiveuc(K,a,b)
[12, 8]~
? lift(Mod(a-(12+8*y)*b,y^2+1))
-10*y - 6
?


Of course it is easier with builtin GP function Karim proposed in 
another posting:

? nfeltdivrem(K,a,b)
[[12, 8]~, [-6, -10]~]
?


Regards,

Hermann.