অস্থির একটা জিনিস
Let's factorize numbers from 2 to 10. 2 = 2, 3 = 3, 4 = 22, 5 = 5, 6 = 2·3, 7 = 7, 8 = 23, 9 = 32, 10 = 2·5. If a number is divisible by all numbers from 2 to 10, its factorization should contain 2 at least in the power of 3, 3 at least in the power of 2, 5 and 7 at least in the power of 1. So it can be written as x·23·32·5·7 = x·2520. So any number divisible by 2520 is divisible by all numbers from 2 to 10.
There are numbers from 1 to n divisible by all numbers from 2 to 10. In a programming language it is usually implemented as simple integer division.
No comments:
Post a Comment