 What's up guys, I'm Michael and welcome to my YouTube channel today We're gonna go over another problem that is actually really really easy and it's a one-liner But it takes a little bit of thinking to figure it out. Okay, so you're given a number n and you want to find the the numbers Numbers one to n You can you need to count the numbers one to n that are divisible By two up to ten two to ten, right? So you might be thinking well How are we gonna do this? How are you gonna do this? Okay? Well, it's actually pretty easy first of all Let's figure out a way to find the common multiple From two to ten. So then that once we have that we could easily just find the number of numbers are divisible by one n, right? Because if we could find one single number that is we could say that it's divisible by then we don't have to like We don't have to We don't have to mod every single number like two three four four five six seven eight nine ten Okay, so let's just list out the numbers of two two is equal to Two to the first three is equal to three to the first Four is equal to two to the second Five is equal to five to the first Let's just go to six six is equal to two to the first times three to the first Seven is equal to seven to the first eight is equal to two to the third nine is equal to three to the second and ten is equal to two To the first times five to the first, okay So now once you have all these Now it's the time is a little just to look at the largest exponent and then pick the ones with the largest exponent to multiply to find our common multiple so let's pick up So we could pick the largest of two, right? So then wait, no, let's see. So the largest exponent for two is actually Let's see is three actually two to third, right? So we're gonna pick that two to third here So now we don't have to think about two at all Let's pick. Let's look at three. What's the large exponent of three this one? Three to the second. So we're gonna multiply by three to the second What's the large exponent of five five to the first it's five to first of the multiple five to the first Well about six Well, we are six you already have two to the three, right both of these so yeah, what about seven? Let's look at seven Seven is seven to the first eight Well, we already have eight nine. We already have nine because it's the second one ten is just two times five. Yeah, so that's it So now let's let's multiply these out and see what we get so What is this? eight times nine times five times seven, which is equal to 72 times 35 and if we bring out our trusty calculator 2520 and Yeah, so now we have one single multiple to think about now. Let's think about the number of Numbers that are divisible by this large number Well, if you think about it if if I want to find the number of numbers Count the number of numbers are from one to like 300 that are divisible by six all I have to do is it's just a The number of multiples of six are in that are up to 300 So for that I would just take 300 over six to find the number of numbers that are divisible by six Right from one to three hundred Well, that's the same thing here if I want to find the number of numbers that are divisible from one to n I just take n over 2520 and yeah, that's basically the answer so yeah, that's a short video and All you got to do is just code up see out n over 2520 submit your answer and that's it all right guys So this is the problem statement J. Divisibility and for what did I do for my submission is That I just read in n and then did see out n over 2520 so yeah, that's that's it. This is a quick quick video some some Some explanations are really quick rate com subscribe. Let me know if I should do another Challenge not challenge another problem of 629. All right, or whatever video I should do next. So yeah peace