Next: Exercise 14. Up: Exercises Previous: Exercise 12.

Exercise 13.

Write a Maple n-ary procedure GCD that does integer and symbolic simplification of GCD calculations in . E.g. on input of GCD(b,GCD(b,a),-a), your procedure should return GCD(a,b). For integer inputs, your routine should compute the GCD directly. For symbolic inputs, your GCD procedure should know the following

  1. GCD(a,b) = GCD(b,a) (GCD's are commutative)
  2. GCD(GCD(a,b),c) = GCD(a,GCD(b,c)) = GCD(a,b,c) (GCD's are associative)
  3. GCD(0,a) = GCD(a) (the identity is 0)
  4. GCD(a) = GCD(a) = abs(a)


bondaren@thsun1.jinr.ru