Question: please use R program for this problem 1: Greatest Common Divisor (GCD) and Least Common Multiple (LCM) Please write a function, ged(), which takes two

please use R program for this problem
please use R program for this problem 1: Greatest Common Divisor (GCD)
and Least Common Multiple (LCM) Please write a function, ged(), which takes

1: Greatest Common Divisor (GCD) and Least Common Multiple (LCM) Please write a function, ged(), which takes two arguments x, y and calculates their greatest common divisor (GCD) using the Euclidean algorithm. The Euclidean Algorithm Example: Let a = 180 and b = 25 1. calculate 180/25, and get the result 7 with remainder 5, so 180 = 7 * 25 +5. 2. calculate 25/5, and get the result 5 with remainder 0, so 25 = 5 x 5 +0. 3. the greatest common divisor of 180 and 25 is 5. Make use of ged() to write a function, Icm(), which takes a vector and find the least common multiple. The length of the vector will be at least two but no more than 100. Test cases: Here are some suggested test cases but not limited to while grading. 1. GCD ged(72, 8) + 8 ged(-1, 531) 1 ged(47011, 73618)1 lem(c(12, 21)) 84 Icm(c(4789, 6123, 199)) 5835286353

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!