Compute GCD(210,588)two different ways: by finding the factorization of each number, and by using Euclid’s algorithm.

Short Answer

Expert verified

GCD of the numbers210 and 588is calculated using Factorization method and Euclid’s Algorithm and the GCD is 42.

Step by step solution

01

Explain GCD

Euclid algorithm is defined as a method to find GCD of two integers. General formula used is:

GCD (A, B) = GCD (B, A MOD N)

This step runs recursively till the remainder becomes zero.

02

Compute GCD by factorization method

GCD(210,588)Factorof210=2×3×5×7Factorof588=2×2×3×7×7Commondivisorof210and588=2×3×7GCD(210,588)=42

03

Compute GCD by Euclid’s algorithm

GCD(210,588)Letthequotientbeqandremainderber.588=210×q+r588=210×2+168210=168×1+42168=42×4+0GCDequaltotheremainderbefore0i.e.42.GCD(210,588)byEuclidsmethod=42

Hence, GCD of the given numbers is 42.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Consider an RSA key set with p = 17 , q = 23, N = 23 and e = 3 (as in Figure 1.9). What value of d should be used for the secret key? What is the encryption of the message M = 41 ?

Determine necessary and sufficient conditions on xandc so that the following holds: for anya,b, if axbxmodc, thenabmodc .

Justify the correctness of the recursive division algorithm given in page 25, and show that it takes time O(n2)onn- bit inputs.

1.38. To see if a number, say 562437487, is divisible by 3, you just add up the digits of its decimalrepresentation, and see if the result is divisible by role="math" localid="1658402816137" 3.

( 5+6+2+4+3+7+4+8+7=46, so it is not divisible by 3).

To see if the same number is divisible by 11, you can do this: subdivide the number into pairs ofdigits, from the right-hand end(87,74,43,62,5) , add these numbers and see if the sum is divisible by11 (if it's too big, repeat).

How about 37? To see if the number is divisible by 37, subdivide it into triples from the end(487,437,562) add these up, and see if the sum is divisible by37 .


This is true for any prime pother than2 and 5. That is, for any prime p≠2,5, there is an integer rsuch that in order to see ifp divides a decimal number n, we breakn into r-tuples of decimal digits (starting from the right-hand end), add up these r-tuples, and check if the sum is divisible by p.

(a) What is the smallest rsuch for p=13? Forp=13 ?

(b) Show thatr is a divisor of p-1.

Give an efficient algorithm to compute the least common multiple of two n-bit numbers x and y, that is, the smallest number divisible by bothx and y. What is the running time of your algorithm as a function of n?

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free