GCD Test | Consider integers u = 297 and v = 366. Use Euclid's algorithm to determine the gcd u and v: 366 = 1*297 + 69 297 = 4*69 + 21 69 = 3*21 + 6 21 = 3*6 + 3 6 = 2*3 + 0 If u and v are random positive integers, then 3 objects result from applying Euclid's algorithm to the pair u, v: (1) the number of iterations, k, needed to find the gcd (k=5 in above example), (2) a variable-length sequence of partial quotients (1,4,3,3,2 in the above example) and (3) the gcd-the final value of u (3 in the example). In this version only (1) and (3) are showed and the result of test is chosen to be (1). |