Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 46 lines (43 sloc) 1.648 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
<!DOCTYPE html>
<html data-require="math">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Least common multiple</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="C">randRange( 2, 6 )</var>
<var id="START_A">randRange( 1, 10 )</var>
<var id="START_B">randRangeExclude( 1, 10, [ START_A ] )</var>
<var id="A">START_A * C</var>
<var id="B">START_B * C</var>
<var id="BIGGER">Math.max( A, B )</var>
<var id="SMALLER">Math.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>

<div class="problems">
<div>
<div class="question">
<p>What is the least common multiple of <var>A</var> and <var>B</var>?</p>
<p>Another way to say this is:</p>
<p><code>\lcm(<var>A</var>, <var>B</var>) = {?}</code></p>
</div>
<p class="solution" data-forms="integer"><var>LCM</var></p>
</div>
</div>

<div class="hints">
<p>The least common multiple is the smallest number that is a multiple of <var>A</var> and <var>B</var>.</p>
<p>We know that <var>A</var> x <var>B</var> (or <var>PRODUCT</var>) is a common multiple,
but is it the least common multiple?</p>
<p>Write out the multiples of <var>BIGGER</var> until we find a number divisible by <var>SMALLER</var>.</p>
<span data-each="MULTIPLES as M"> <var>M</var>, </span>
<p>So, <var>LCM</var> is the least common multiple of <var>A</var> and <var>B</var>.</p>
</div>
</div>
</body>
</html>
Something went wrong with that request. Please try again.