Skip to content · ⁨コンテンツへスキップ⁩

Greatest common divisor · ⁨最大公約数⁩

English

Greatest common divisor

The GCD of two numbers is the largest integer that divides both. Euclid's algorithm is beautifully short: while b isn't 0, replace the pair (a, b) with (b, a % b). When b reaches 0, a is the answer.

日本語

最大公約数

2つの整数の最大公因数は、両方を割り切る最大の整数です。ユークリッドの互除法は非常に簡潔です:b が 0 でない間、ペア (a, b) を (b, a % b) に置き換えます。b が 0 になったとき、a が答えになります。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP