If there is a question such as how many numbers are multiples of 3 between 301 and 9996, how would I calculate it with a formula?

Just like you’d solve the problem how many multiples of 5 are there between 15 and 160. Essentially it’s the same thing right?

\cfrac{\mathsf{last\ number - first \ number + 1}}{\mathsf{3}}

Consider them to be as part of an AP ( Arithmetic Progression )

we know for sure that 300 is a multiple of 3 , and so is 9999

So form an AP with all the info you have which would be something like this

303, 306, …, 9990, 9993 ( I didnt consider 9996 as the question is between and doesnt mention about including both 301 and 9996 )

So go with below formula

First Term “a” = 303

Last Term “l” = 9993

Difference between any two consecutive term “d” = 3

So total number of Terms in the AP is

(l-a)/d + 1 ( not the formula here which divides the whole thing by 3 )

So the answer is (9993-303)/3 + 1

3230 + 1 = 3231 Terms

**\mathsf{Clarification}**: Not indicating this is a formula to solve this question type in any sense. Just this is the approach I used to solve this specific question. I’m not of fan of memorizing formula, and methods to approach such questions depend on even parity of the first and the last number. In each case the method needs to be slightly adjusted. Typically I’d play around with a small set as a sample to decide how to adjust the formula I’ll be using.