Fetching contributors…
Cannot retrieve contributors at this time
43 lines (40 sloc) 1.94 KB
<!DOCTYPE html>
<html data-require="math">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Least common multiple</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
<div class="exercise">
<div class="vars">
<var id="A">randRange(2, 12)</var>
<var id="B">randRangeExclude(2, 12, [A])</var>
<var id="BIGGER">max(A, B)</var>
<var id="SMALLER">min(A, B)</var>
<var id="PRODUCT">A * B</var>
<var id="GCD">getGCD( A, B )</var>
<var id="LCM">PRODUCT / GCD</var>
<var id="MULTIPLES">getMultiples( BIGGER, LCM )</var>
<div class="problems">
<div class="question">
<p>What is the least common multiple of <code><var>A</var></code> and <code><var>B</var></code>?</p>
<p>Another way to say this is:</p>
<p><code>\lcm(<var>A</var>, <var>B</var>) = {?}</code></p>
<p class="solution" data-forms="integer"><var>LCM</var></p>
<div class="hints">
<p>The least common multiple is the smallest number that is a multiple of <code><var>A</var></code> and <code><var>B</var></code>.</p>
<p>We know that <code><var>A</var> \times <var>B</var></code> (or <code><var>PRODUCT</var></code>) is a common multiple,
but is it the least common multiple?</p>
<p>Write out the multiples of <code><var>BIGGER</var></code> until we find a number divisible by <code><var>SMALLER</var></code>.</p>
<span data-each="MULTIPLES as M"> <code><var>M</var></code>, </span>
<p>So, the least common multiple of <code><var>A</var></code> and <code><var>B</var></code> is <code><var>LCM</var></code>.</p>