Andrew Walker on Thu, 19 Dec 2019 08:46:53 +0100


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

Pari functions that support gaussian integers


Hi, just a quick request that either here or preferably on the main web page we could have a list of
functions that support gaussian integers.

I've been using factor() with these for a few years to find amicable pairs in gaussian integers, it's nice that
Pari supports the first quadrant form of the factorisation as noted by Robert Spira!

( See especially some of my posts here https://mersenneforum.org/showthread.php?t=21068   )

I've just recently noticed that lcm and gcd work with gaussian integers.

I have been using my own version of the sigma function CSigma, could this be added to the main
release in the future?

CSigma(n)=
{
local(s,v,i);
s=1;

v=factor(n);
for(i=1,length(v~), if(abs(v[i,1])>1,  s=s*  (v[i,1]^(v[i,2]+1)-1)/( v[i,1]-1 ) ) );
return(s)

}

( PS can also use factor(n,I) above which gives a different result for reals...)

isprime, ispseudoprime and similar functions would also be ones to keep in mind for future support

There are many others in the "Arithmetic Functions" group that could also be useful if they aren't too difficult
and they make sense!

nextprime(z) for example, would need to be ordered by norm(z), and some sensible choice for odering with identical norm values.
First quadrant first?

Andrew

PS Then there are Eisenstein integers and beyond.... .