# Khan/khan-exercises

Start integer sum exercise

1 parent cc8f3e5 commit 5055c92f6bb1848f376de80028797a8669854cfa petercollingridge committed Jun 23, 2012
Showing with 54 additions and 0 deletions.
1. +54 −0 exercises/integer_sums.html
54 exercises/integer_sums.html
 @@ -0,0 +1,54 @@ + + + + + Integer sums + + + +
+
+ randRange(1, 100) + randRange(2, 5) + randRange(1, 2) + + + (function() { + var sequence = [FIRST_NUM]; + for (var i = 1; i <SEQ_LENGTH; i++) { + sequence.push(i, FIRST_NUM + i * DIFFERENCE); + } + return sequence; + })() + + FIRST_NUM * SEQ_LENGTH + DIFFERENCE * SEQ_LENGTH * (SEQ_LENGTH - 1) / 2 +
+ +
+
+
+

The sum of SEQ_LENGTH consecutive NUMBER_TYPE is SUM.

+
+

What is the smallest of the SEQ_LENGTH NUMBER_TYPE?

+

FIRST_NUM

+
+
+ +
+

The greatest common divisor is the largest number that is a factor (or divisor) of both A and B.

+
+

The only factor (divisor) of 1 is 1.

+

The factors (divisors) of A are A_FACTORS.

+
+
+

The only factor (divisor) of 1 is 1.

+

The factors (divisors) of B are B_FACTORS.

+
+
+

Thus, the greatest common divisor of A and B is GCD.

+

\gcd(A, B) = GCD

+
+
+
+ +