The smallest number that

What is the smallest positive integer that is evenly divisible by every integer 1 - 10, inclusive?

This problem was sent to me by a friend and I wanted to share it.


The answer is 2520.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Edward Gleason
Dec 3, 2015

Regard the numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. You could try multiplying all the above numbers together, but the result (3,628,800) isn't the smallest number divisible by all integers 1 - 10. We look for the least amount of factors we need, Every positive integer is divisible by 1, so ignore it. Every integer divisible by 4, 6, 8 and 10 is also divisible by 2, so ignore 2. Every integer divisible by 6 is also divisible by 3, so ignore 3. 4 consists of the same factors that comprise 8; ignore 4

The numbers 6 and 10 consists of the same factors in 5, 7, 8 and 9, the only numbers we have to multiply to yield the answer

9 x 8 x 7 x 5 = 2520

Great! Thinking about it as "the numbers 6 and 10 consists of the same factors in 5, 7, 8 and 9" could get troublesome if we had a lot of integers. For example, is there a simple description for the smallest positive integer that is divisible by 1 to 100? What about 1000?

Calvin Lin Staff - 5 years, 6 months ago

I wrote a small code to do it

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
>>> def lcm(a, b):
        x = a * b
        while b:
            a, b = b, a%b
        return x / a

>>> num = 1
>>> for x in xrange(2, 11):
        num = lcm(num, x)
>>> num
2520

Arulx Z - 5 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...