Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (47 sloc) 2.104 kb
<!DOCTYPE html>
<html data-require="math word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Greatest common divisor</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars" data-ensure="A_START !== B_START">
<var id="A_START">randRange( 1, 10 )</var>
<var id="B_START">randRange( 1, 10 )</var>
<var id="FACTOR">randRange( 1, 5 )</var>
<var id="A">A_START * FACTOR</var>
<var id="B">B_START * FACTOR</var>
<var id="GCD">getGCD( A, B )</var>
<var id="A_FACTORS">toSentence(getFactors( A ))</var>
<var id="B_FACTORS">toSentence(getFactors( B ))</var>
</div>
<div class="problems">
<div>
<div class="question">
<p>What is the greatest common divisor of <var>A</var> and <var>B</var>?</p>
<p>Another way to say this is: </p>
<p><code>\gcd(<var>A</var>, <var>B</var>) = {?}</code></p>
</div>
<p class="solution" data-forms="integer"><var>GCD</var></p>
</div>
</div>
<div class="hints">
<p>The greatest common divisor is the largest number that is a factor (or divisor) of both <var>A</var> and <var>B</var>.</p>
<div>
<p data-if="A === 1">The only factor (divisor) of 1 is 1.</p>
<p data-else>The factors (divisors) of <var>A</var> are <var>A_FACTORS</var>.</p>
</div>
<div>
<p data-if="B === 1">The only factor (divisor) of 1 is 1.</p>
<p data-else>The factors (divisors) of <var>B</var> are <var>B_FACTORS</var>.</p>
</div>
<div>
<p>Thus, the greatest common divisor of <var>A</var> and <var>B</var> is <var>GCD</var>.</p>
<p><code>\gcd(<var>A</var>, <var>B</var>) = <var>GCD</var></code></p>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.