本文へスキップ

リソース · ガイド・記事

Least common multiple

最小公倍数を扱います。定義、小さな数に使える倍数を書き出す方法、GCD を使う公式を紹介しています。

確認日

元のサイトを開く: Least common multiple (元のサイトを新しいタブで開きます)

ロードマップに追加

取り組んでいるロードマップにこのリソースを追加できます。自分用の追加リソースとして表示され、ロードマップの手順は変わらず、記録した手順数にも数えられません。

出典コンテンツの言語:英語

In arithmetic and number theory, the least common multiple, lowest common multiple, or smallest common multiple of two integers a and b, usually denoted by LCM(a, b), is the smallest positive integer that is divisible by both a and b. Since division of integers by zero is undefined, this definition has meaning only if a and b are both different from zero. However, some authors define lcm(a,0) as 0 for all a, which is the result of taking the lcm to be the least upper bound in the lattice of divisibility. Common multiples of 4 and 6 are simply the numbers that are in both lists: So, from this list of the first few common multiples of the numbers 4 and 6, their least common multiple is 12.

PrepKit の概要

この概要は PrepKit 編集部がソースリポジトリをもとに執筆・確認したもので、リソース本文の引用ではありません。

対象
ソースにレベルの記載はありません
形式
リファレンス

扱っている内容

  • 定義と、0 に関する注意および lcm(a, 0) の慣例
  • 倍数を書き出して LCM(4, 6) = 12 を求める例
  • lcm(a, b) = |a * b| / gcd(a, b)
  • 2、3、4、5、7 のベン図と、60枚のカードを配る例

使い方

PrepKit の学習アドバイスであり、ソースの主張ではありません。

掛ける前に割る形で GCD を使って lcm を実装し、2、3、4、5 に順に適用して 60 になることを確かめてください。

範囲と制約

オーバーフロー、計算量、GCD の求め方は扱っていません。

利用方法と形式

GitHub の MIT ライセンスの trekhleb/javascript-algorithms リポジトリにある、英語の無料 README です。

PrepKit が 2026/10/02 に確認しました。 リソースの出典のコミット: 85293e3e2b88

この概要の根拠
  • src/algorithms/math/least-common-multiple/README.md

この項目を掲載しているページ

PrepKit ニュースレターを受け取る

任意です。PrepKit の利用には必要ありません。

メールアドレスの取り扱いについて