[GAP Forum] coprime to n

Surinder Kaur surinder.kaur at iitrpr.ac.in
Sat Feb 11 17:09:06 GMT 2017


Thank you very much. I found a direct command too PrimeResidues(n).

On Sat, Feb 11, 2017 at 10:31 PM, Bill Allombert <
Bill.Allombert at math.u-bordeaux.fr> wrote:

> 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 at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>



-- 
*Regards*
*Surinder Kaur*
*Research scholar  *
*Department of Mathematics *
*IIT Ropar*


More information about the Forum mailing list