GCD と LCM 計算機

数のリストの最大公約数と最小公約数を求める。

整数をコンマまたはスペースで区切ってください。
最大公約数 —
最小公倍数 —
覆いか? —

結果はタイプすると更新されます。

この計算機は正しい答えを与えたか。

この計算機の情報

This calculator finds the greatest common divisor (GCD) — the largest number that divides all your values evenly — and the least common multiple (LCM), the smallest number they all divide into. Enter two or more whole numbers separated by commas or spaces and it also tells you whether they are coprime.

The GCD is found with the Euclidean algorithm: repeatedly replace the larger number with the remainder of dividing the two until one becomes zero; the other is the GCD. The LCM is then built up pairwise using LCM = a × b ÷ GCD. For 12, 18 and 24 the greatest common divisor is 6 and the least common multiple is 72. When the GCD is 1 the numbers share no common factor and are called coprime.

The GCD is what you use to reduce a fraction to lowest terms, while the LCM gives the common denominator for adding fractions and the period at which repeating cycles line up. The result is the same no matter what order you enter the numbers in.

よくある質問

最大共通部分はどのように計算されますか?

ユークリッドアルゴリズムを使用します: 1 がゼロになるまで、2 の除算の残りでより大きな数を繰り返し置換します。もう一方は GCD です。

GCDとLCMはどのように関係しているのか。

2 つの数の場合、GCD × LCM = 数の積です。 つまり、LCM = a × b ÷ GCD です。このツールは、全てのリストに LCM を拡張します。

コプライムとは何ですか?

2 つ以上の数が共通素数である場合、最大公約数が 1 である。1 以外の共通因子はありません。ツールはこれをフラグします。

2つ以上の数字を入力できますか。

はい。整数をコンマまたはスペースで区切り、GCDと LCMは全リストで計算されます。

12,18,24の最大共通部分と最大共通部分は何である?

最大公約数は6(3つを分割する最大の数)で、最小公約数は72である。

数字の順番は重要ですか。

いや、GCDとLCMは、数字を入力する順序に関係なく同じです。

❤️ ラブ Calculator.Free? 分けて

𝕏  X Facebook Reddit
API — コードからこの計算機を使う

この計算機を自由な JSON エンドポイントとして呼び出します。鍵は必要ありません。下のフィールド値をクエリパラメータまたは JSON として送信してください。 省略したものは、このページに既に入力されているデフォルトと同じ値を使用します。未知のパラメータは 400 で、サイレンスゼロはありません。 API ドキュメントを読む →

エンドポイント

GET https://calculator.free/api/v1/gcd-lcm/

curl

curl "https://calculator.free/api/v1/gcd-lcm/?numbers=12, 18, 24"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/gcd-lcm/?" + new URLSearchParams({
    "numbers": "12, 18, 24"
  }));
const data = await r.json();
console.log(data.results);

結果は一般的な指導のための推定であり,財務的,医療的または税務的な助言ではない。