Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

HOW TO DETERMINE THE NUMBER OF ODD INTEGERS IN A

GIVEN RANGE
To find the number of odd/even integers in a range, just pick up the first
odd/even and last odd/even in that range. Say for example:
Find the number of odd integers in the range 100 to 150 (inclusive).
1. Pick the first odd integer 101
2. Pick the last odd integer 149
3. Find the difference 149-101 = 48
4. Divide by the interval (in this case 2, since the positive difference
between any two odd integers is 2)
5. So 48/2 = 24
6. Add 1 for an inclusive range, 24+1=25 (This is the step we usually
do for all inclusive problems)
This will work for 1-100 like, range [1,99]:
99-1=98
98/2=49
49+1 = 50.
NOTE: For exclusive set, you should consider if the numbers you pick lie inside
the interval in order to consider it as an inclusive set. If its confusing, lets say
the above range 100 to 150 is not inclusive, we still pick up numbers 101 and
149 and they lie within the range, so the inclusive property continues here also.
But what if i need to find the number of even integers in this range? Same
procedure can be used,
1. Pick first and last even integer, 100 and 150
2. 150 - 100 = 50
3. 50/2 = 25
4. If it is inclusive set; add 1 25+1=26
5. If it is an exclusive set; subtract 1 25-1=24
1

Don't be confused, its just a basic understanding of ranges, read it once more.
This is actually very easy and reliable method.
This can be used not only for odd/even integers in a range but also for one of
the example given above.
How many integers of the form 5k+2 are there from 1 to 200?
Starting from k=0, 5(0)+2 = 2 and the last term will be 197, since we need
a (multiple of 5)+2 5(39)+2=195+2 The range would look like 2, 7, 12, ...
197 Again our technique, 197-2 = 195 Divide by 5 in this case, since the
positive difference is 5 So 195/5=39 Add 1, 39+1=40

You might also like