Bill Allombert on Sun, 06 Dec 2020 18:30:00 +0100


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

Re: Can bnfinit recognize square integer factors without factorization?


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.