On Sat, Feb 11, 2017 at 10:11:55PM +0530, Surinder Kaur wrote: > Hi all > > We know that the Euler-totient function in GAP is Phi(n) . But how one can > list all the integers co-prime to a given integer n.
Just use Filtered: gap> n:=100;Filtered([1..n-1],x->Gcd(x,n)=1); 100 [ 1, 3, 7, 9, 11, 13, 17, 19, 21, 23, 27, 29, 31, 33, 37, 39, 41, 43, 47, 49, 51, 53, 57, 59, 61, 63, 67, 69, 71, 73, 77, 79, 81, 83, 87, 89, 91, 93, 97, 99 ] Cheers, Bill. _______________________________________________ Forum mailing list Forum@mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum