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=p
1p
2, B=p
3p
4, C=p
2p
3, p
1,p
2,p
3,p
4 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 :)