Karim Belabas on Thu, 26 Oct 2023 00:55:35 +0200


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

Re: Polynomials with integer roots


* Andreas Enge [2023-10-25 11:13]:
> Am Wed, Oct 25, 2023 at 10:27:03AM +0200 schrieb Karim Belabas:
> > Say the list is contained in vector L. Here's the simplest way.
> >   [ T | T <- L, #nfroots(,T) == poldegree(T) ]
> 
> As I understand it, this requires the polynomials to be square-free,
> so multiple roots should be handled separately first.

You are right, I forgot about multiplicities. One should ensure that all
polynomials are squarefree to begin with, something like T /= gcd(T,T')

Here's an updated (still naive) solution, without the squarefreeness
assumption:

  OKpol(T) = my(t = T/gcd(T,T')); #nfroots(,t) == poldegree(t);
  [ T | T <- L, OKpol(T) ]

Cheers,

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/