The Smallest Common Multiple challenge in the JavaScript Intermediate Algorithm Scripting unit seems a bit much for a mathematically unsophisticated group. I eventually solved it in about 90 minutes as described here but it ends up being 60 lines of qquite tight, mathematically sophisticated code.

Further, students attempting to solve it by valid yet inefficient loops simply struggle with trying to get their browser limits on JavaScript lifted. This seems a waste of learning effort.

I subsequently realized there is an efficient simple algorithm utilizing properties of the Greatest Common Divisor, as I noted here. Reproduced:

- Write a Greatest Common Divisor function
`GCD(a,b)`

. - Note that the Smallest Common Multiple (SCM) of any two numbers
*a*and*b*is the value:`a * b / GCD(a,b)`

. - Calculate the SCM for the first two numbers of the range; then successively calculate the SCM for that value plus the next value in the range until you hit the end of the range.

I suggest that the challenge be:

- Immediately preceded by a
*Write a GCD function*challenge; - Be pre-populated with the GCD function just written by the student; and
- Be supplemented with my algorithm note above (or at least the comment

Note that the Smallest Common Multiple (SCM) of any two numbers

aandbis the value:

`a * b / GCD(a,b)`

I believe this would be far more valuable to students than the existing challenge structure.