Re: Can bnfinit recognize square integer factors without factorization?

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <20201206172957.GB3116@yellowpig>
On Sun, Dec 06, 2020 at 06:02:18PM +0200, Georgi Guninski wrote:
> Version 2.11.1
> 
> after several allocatemem()s:
> 
> ? setrand(1);L=2^30;p=randomprime(L);q=randomprime(L);
> n=p^2*q;addprimes(n);K=bnfinit(x^2+n);
> 
> Takes very long, didn't wait it to finish.
> 
> Can this be used as algorithm to recognize square integer factors?

The 'correct' way to do the above is
setrand(1);L=2^30;p=randomprime(L);q=randomprime(L);n=p^2*q;
K=bnfinit(nfinit([x^2+n,[2,n]]));

which actually work
? K.disc
%7 = -4597325663778603262374139
? K.clgp
%8 = [603602686944,[603602686944],[[5,0;0,1]]]

But what you get is the class group of the quadratic order with
discriminant -n which you could obtain directly with

? quadclassunit(-n)
%12 = [603602686944,[603602686944],[Qfb(679298724049,-45901789467,1692713557093)],1]

n is not prime since the class number is even.
Not sure how one can conclude that n is not squarefree.

Cheers,
Bill.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.