博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Greatest Common Divisor (GCD) - Euclidean algorithm
阅读量:4031 次
发布时间:2019-05-24

本文共 1612 字,大约阅读时间需要 5 分钟。

The Euclidean algorithm calculates the greatest common divisor (GCD) of two  a and b. The greatest common divisor g is the largest natural number that divides both a and b without leaving a remainder. Synonyms for the GCD include the greatest common factor (GCF), the highest common factor (HCF), and the greatest common measure (GCM). The greatest common divisor is often written as gcd(ab) or, more simply, as (ab), although the latter notation is also used for other mathematical concepts, such as two-dimensional .

If gcd(ab) = 1, then a and b are said to be  (or relatively prime). This property does not imply that a or b are themselves . For example, neither 6 nor 35 is a prime number, since they both have two prime factors: 6 = 2 × 3 and 35 = 5 × 7. Nevertheless, 6 and 35 are coprime. No natural number other than 1 divides both 6 and 35, since they have no prime factors in common.

A 24-by-60 rectangle is covered with ten 12-by-12 square tiles, where 12 is the GCD of 24 and 60. More generally, an 
a-by-
b rectangle can be covered with square tiles of side-length 
c only if 
c is a common divisor of 
a and 
b.

Let g = gcd(ab). Since a and b are both multiples of g, they can be written a = mg and b = ng, and there is no larger number G > g for which this is true. The natural numbers m and n must be coprime, since any common factor could be factored out of m and n to make g greater. Thus, any other number c that divides both a and bmust also divide g. The greatest common divisor g of a and b is the unique (positive) common divisor of a and bthat is divisible by any other common divisor c.

转载地址:http://flhbi.baihongyu.com/

你可能感兴趣的文章
[LeetCode By Python]172. Factorial Trailing Zeroes
查看>>
[LeetCode By MYSQL] Combine Two Tables
查看>>
python jieba分词模块的基本用法
查看>>
[CCF BY C++]2017.12 最小差值
查看>>
[CCF BY C++]2017-12 游戏
查看>>
如何打开ipynb文件
查看>>
[Leetcode BY python ]190. Reverse Bits
查看>>
面试---刷牛客算法题
查看>>
Android下调用收发短信邮件等(转载)
查看>>
Android中电池信息(Battery information)的取得
查看>>
SVN客户端命令详解
查看>>
Android/Linux 内存监视
查看>>
Linux系统信息查看
查看>>
用find命令查找最近修改过的文件
查看>>
Android2.1消息应用(Messaging)源码学习笔记
查看>>
在android上运行native可执行程序
查看>>
Phone双模修改涉及文件列表
查看>>
android UI小知识点
查看>>
Android之TelephonyManager类的方法详解
查看>>
android raw读取超过1M文件的方法
查看>>