Let m ( x ) be defined as the smallest number that can be evenly divided by all the positive integers between 1 and x inclusive.
(For example, m ( 4 ) = 1 2 because 1 2 is the smallest number that can be evenly divided by 1 , 2 , 3 , and 4 .)
Find the value of m ( 1 2 0 ) m ( 1 3 0 ) .
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.
M a t h e m a t i c a
LCM@@Range@130/LCM@@Range@120
returns 1 3 9 7 0
Very concise solution!
The smallest number that evenly divides m ( x ) is the lcm from 1 to x and lcm(1.2.3,...,x) is the product of all primes numbers less than or equal x ie lcm(1 to x ) is ( p 1 q 1 ≤ x ) ⋅ ( p 2 q 2 ≤ x ) ⋅ ( p 3 q 3 ≤ x ) ⋯ ( p n q n ≤ x )
∴ lcm(1,2,3,4,.....120) lcm(1,2,3,....,130) = 2 6 ⋅ 3 4 ⋅ 5 2 ⋅ 7 2 ⋅ 1 1 2 7 ⋅ 3 4 ⋅ 5 3 ⋅ 7 2 ⋅ 1 1 2 ( 1 3 ⋅ 1 7 ⋯ 2 3 ⋯ 1 1 3 1 3 ⋅ 1 7 ⋯ 2 3 ⋯ 1 1 3 ) ⋅ 1 2 7 ⟹ m ( 1 2 0 ) m ( 1 3 0 ) = 2 ⋅ 5 ⋅ 1 1 1 2 7 = 1 3 9 7 0
Note: In case of lcm ( 1 , 2 , 3 , . . . 1 3 0 ) , 1 2 8 ( 2 7 ) , 1 2 5 ( 5 3 ) , 8 1 ( 3 4 ) , 4 9 ( 7 2 ) , 1 2 1 ( 1 1 2 ) appears multiple times and primes between 11 and 130 appears only a time for composite numbers between them. On the same way lcm from 1 to 120 can also be determined.
Nice solution!
Problem Loading...
Note Loading...
Set Loading...
The value of m ( x ) can be found by multiplying all the prime numbers less than or equal to x , and raising each prime number p to the highest exponent n such that p n ≤ x .
Therefore,
m ( 1 2 0 ) = 2 6 ⋅ 3 4 ⋅ 5 2 ⋅ 7 2 ⋅ 1 1 ⋅ 1 3 … 1 1 3
m ( 1 3 0 ) = 2 7 ⋅ 3 4 ⋅ 5 3 ⋅ 7 2 ⋅ 1 1 2 ⋅ 1 3 … 1 1 3 ⋅ 1 2 7
So m ( 1 2 0 ) m ( 1 3 0 = 2 6 ⋅ 3 4 ⋅ 5 2 ⋅ 7 2 ⋅ 1 1 ⋅ 1 3 … 1 1 3 2 7 ⋅ 3 4 ⋅ 5 3 ⋅ 7 2 ⋅ 1 1 2 ⋅ 1 3 … 1 1 3 ⋅ 1 2 7 = 2 ⋅ 5 ⋅ 1 1 ⋅ 1 2 7 = 1 3 9 7 0 .