[GAP Forum] ial Divisors in GAP

lopo apelo kosho helo_07 at yahoo.com
Tue Aug 3 05:52:58 BST 2021


Dear Friends;
I am writing a code to find the exponential unitary divisors for a given positive integer. 
Recal that if n=p_1^a_1*…*p_s^a_s
then d==p_1^b_1*…*p_s^b_s   iff b_i is unitary divisor for a_i, and that happens when gcd(a_i,a_i/b_i)=1.

I can find the unitary divisors for a given integer as follows:
UnitaryDivisors:=function(n);
return Filtered(DivisorsInt(n),x->Gcd(x,n/x)=1);
end;

to construct a code that  gives the unitary divisors of a given integer I did the following (which doesn’t work):
EUD:=function (n) local pf,t,i,ed,j,p,k;
t:=[];
pf:=Collected(Factors(n));
for i in [1..Size(pf)] do
ed:= UnitaryDivisors (pf[i][2]);
for j in [1..Size(ed[i])] do
#p:=pf[j][1]^ed[j];
for k in [1..Size(pf)*Size(ed)] do
Add(t,Product([1..Size(pf)],x->pf[x]^ed[x][k]) );
return t;
od;
od;
od;
end;


Can you help!
Thank you



More information about the Forum mailing list