原书出处
Introduction to Algorithms, Fourth Edition
31 第31章 数论算法
: The following theorem provides an alternative and useful way to characterize gcd(a, b).
Theorem 31.2 If a and b are any integers, not both zero, then gcd(a, b) is the smallest positive element of the set {ax + by : x, y ∈ ℤ} of linear combinations of a and b. Proof Let s be the smallest positive such linear combination of a and b, and let s = ax + by for some x, y ∈ ℤ. Let q = ⌊a/s⌋. Equation (3.11) on page 64 then implies a mod s = a – qs = a – q(ax + by
) = a (1 – qx) + b (–qy), so that a mod s is a linear combination of a and b as well. Beca
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Introduction to Algorithms, Fourth Edition/_epub-src/OEBPS/chapter031.xhtml
EPUB SHA-256:ec7ced04bb875b93983816aef7a667855a4b71c5cf53b63406b9439c74e27aea