[GAP Forum] AllPolynomialDiv.
Stefan Kohl
sk239 at st-andrews.ac.uk
Mon Jan 22 11:01:53 GMT 2018
The following function should do what you want:
DivisorsPol := P ->
Set(Combinations(Factors(P)),facts->Product(facts,One(P)));
-- Does this help you?
Best regards,
Stefan
Am 21.01.2018 um 22:47 schrieb lopo apelo kosho:
> 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.
> _______________________________________________
> Forum mailing list
> Forum at gap-system.org
> https://mail.gap-system.org/mailman/listinfo/forum
More information about the Forum
mailing list