Gapplet

Given a polynomial f Z/pZ[X], determine whether it has linear factors.

Input f,  e.g., X^7-2*X^4+1
 
Input p,  e.g., 5
 
 
The product of all distinct linear factors of f