Bill Allombert on Thu, 14 Dec 2017 19:54:24 +0100


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

Re: issquare(polynomial) ?


On Thu, Dec 14, 2017 at 05:55:10PM +0000, Jacques Gélinas wrote:
> How can I best use PARI/GP to detect if a polynomial is a perfect square ?

Hello Jacques,

You can use issquare. However this will check if it is a square in Z[X]
if your polynomial is in Z[X]. Maybe you want to check if it is square
in C[X] instead.

> ND(3) == 2^6*3^12*5^5 * (5*d+16)^2 * (15*d^3+160*d^2+540*d+576)^2 
> issquare(ND(4))
>   ***   at top-level: issquare(ND(4))
>   ***                          ^------
>   ***   not a function in function call

This means that ND is not a function, which probably means it got
corrupted.

ND(4) is not a square because its content is not a square.
So it is not a square in Z[X] but is a square in C[X].
To test whether it is a square in C[X] you should divide by
the content first.

Cheers,
Bill.