Thread: Relatively Prime View Single Post
2003-08-01, 05:46   #3
hyh1048576

Jun 2003

10000002 Posts

Quote:
 Originally Posted by cheesehead Just 2 GCDs, right? gcd ( gcd ( A, B ), C ) I've seen library GCDs that took more than two arguments, but the question would be whether anyone's coded a really fast one.
:? I don't think it is right. ;)

If gcd(A,B)>1, they are not relatively primes. So when A,B,C are relatively primes, gcd(A,B)=1, so gcd ( gcd ( A, B ), C )=gcd(1,C) must be equal to 1 ......That means it's useless in the determination :( And for example, A=p1p2, B=p3p4, C=p2p3, p1,p2,p3,p4 are primes.The two gcd are both equal to 1, but they are not relatively primes.

My method is A,B,C are relatively primes iff gcd(A,B) and gcd(AB,C) are both equal to 1 :)