Permalink
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (48 sloc) 2.3 KB
<!DOCTYPE html>
<html data-require="math word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Greatest common factor</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="A_START">randRange(1, 10)</var>
<var id="B_START">randRangeExclude(1, 10, [A_START])</var>
<var id="FACTOR">randRange(1, 10)</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">toSentenceTex(getFactors( A ))</var>
<var id="B_FACTORS">toSentenceTex(getFactors( B ))</var>
<var id="GCF_TEXT">i18n._("gcf")</var>
</div>
<div class="problems">
<div>
<div class="question">
<p>What is the greatest common factor of <code><var>A</var></code> and <code><var>B</var></code>?</p>
<p>Another way to say this is: </p>
<p><code>\operatorname{<var>GCF_TEXT</var>}(<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 factor is the largest number that is a factor of both <code><var>A</var></code> and <code><var>B</var></code>.</p>
<div>
<p data-if="A === 1">The only factor of <code>1</code> is <code>1</code>.</p>
<p data-else="">The factors of <code><var>A</var></code> are <var>A_FACTORS</var>.</p>
</div>
<div>
<p data-if="B === 1">The only factor of <code>1</code> is <code>1</code>.</p>
<p data-else="">The factors of <code><var>B</var></code> are <var>B_FACTORS</var>.</p>
</div>
<div>
<p>Thus, the greatest common factor of <code><var>A</var></code> and <code><var>B</var></code> is <code><var>GCD</var></code>.</p>
<p><code>\operatorname{<var>GCF_TEXT</var>}(<var>A</var>, <var>B</var>) = <var>GCD</var></code></p>
</div>
</div>
</div>
</body>
</html>