[GAP Forum] AllPolynomialDiv.

lopo apelo kosho helo_07 at yahoo.com
Sun Jan 21 21:47:07 GMT 2018


Dear friends, Good evening, I am still in need for a help and I hope that some one will have time to help. Trying to adapt the similar command for integers I came up with the following;

DivisorsPol:=function( n)

    local divisors, factors,divs;

 

 

    factors := Factors ( n );

 

    # recursive function to compute thedivisors

    divs := function ( i, m ) 

        if Length(factors(m)) < i     then return [ m ];

        elif Degree(m/factors(i))=0  then return divs(i+1,m*factors[i]);

        else return Concatenation( divs(i+1,m),divs(i+1,m*factors[i]) );

        fi;

   end;

 

    divisors :=divs( 1, 1);

    Sort( divisors );

    return Immutable(divisors);

end;
Unfortunately it does not work. Any suggestions Please!All the best,Paul.


More information about the Forum mailing list