How multiple of number is determined?

68 Views Asked by At

Problem 5 Project Euler

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

It is suggested in above example that, 2520 is divisible by all numbers from 1 to 10. How this number can be determined?

What if I need to determine some number, which is divisible by any range, say 15 - 25.

Seems to be basic maths, but not getting clue.

Thanks.

3

There are 3 best solutions below

0
On BEST ANSWER

How many primes are there in between $1$ and $10$ ? Four primes: $2,3,5,7$. And what is the greatest power of each such prime, which is also $\leqslant10$ ? $2^3=8$, $3^2=9$, $5^1=5$, and $7^1=7$. Now, just how much is $2^3\cdot3^3\cdot5\cdot7$ ? :-) But if your lower limit isn't $1$, then I'm afraid you'll have to meticulously factor each number, since, for instance, $7$ is not in the range $15-25$, but its multiple $21$ is.

0
On

If a number n is divisible by a1,a2.....,an. Then the lcm of the numbers also divides it. I think this might help.

Lcm(1,2,....,10)=2520.

0
On

Hint:

\begin{aligned} 2 &= 2&\\ 3 &= & 3\\ 4 &= 2 \cdot 2 & \\ 5 &= & &5\\ 6 &= 2 & 3\\ 7 &= & & & 7\\ 8 &= 2 \cdot 2\cdot 2\\ 9 &= & 3\cdot 3\\ 10 &= 2 & & 5 \end{aligned}