On this page
Finding the number of ways to pick three numbers in an arithmetic progression (AP) from a set like {1, 2, ..., 20} is a standard combinatorics problem. It might look as though you have to painstakingly count every possible common difference, but there is a much faster method.
How do you find the ways to choose three numbers in AP?
When first faced with this problem, many students try to count the progressions by looking at the common difference, d. Since the numbers must fit within the range 1 to 20, the largest possible difference is 9 (giving the sequence 1, 10, 19 or 2, 11, 20).
If you count them out systematically:
For d = 1, the possible sequences are (1, 2, 3), (2, 3, 4), and so on up to (18, 19, 20). That is 18 ways.
For d = 2, the sequences are (1, 3, 5), (2, 4, 6), up to (16, 18, 20). That is 16 ways.
For d = 3, you get 14 ways.
This pattern continues down to d = 9, which gives exactly 2 ways.
Summing these up—18 + 16 + 14 + 12 + 10 + 8 + 6 + 4 + 2—gives 90 total ways. While this additive approach works, it is time-consuming and leaves room for arithmetic errors during a high-pressure exam like JEE Main.
Why does the middle term take care of itself?
A far more elegant method focuses on the outer bounds of the progression. Let the three chosen numbers be a, b, and c in increasing order. For them to form an arithmetic progression, the step from the first to the second must equal the step from the second to the third: b − a = c − b
If you rearrange this equation, you find that the sum of the outer terms is simply 2b: a + c = 2b
Because 2b is always an even number, the sum a + c must also be even. In mathematics, two integers add up to an even number only if they share the same parity. That means a and c must either both be odd, or both be even.
For example, if you choose the odd numbers 3 and 11, their sum is 14. The required middle term is the average, 7, giving you the valid progression 3, 7, 11. If you pick the even numbers 6 and 20, their sum is 26, locking in a middle term of 13.
If you are practising for JEE Main and get tangled in problems like this, the step-by-step solver in the Fermi Problem Library explains the underlying reasoning rather than just printing the final number.
How do you count the same-parity pairs?
Because the middle term is simply the average of the first and third terms, your only job is to count the valid pairs for a and c.
In the integers from 1 to 20, there are exactly 10 odd numbers and 10 even numbers.
Choosing an odd pair: To pick two odd numbers from the 10 available, you use the combinations formula for "10 choose 2". This gives (10 × 9) / 2 = 45 pairs.
Choosing an even pair: Similarly, picking two even numbers from the 10 available gives (10 × 9) / 2 = 45 pairs.
Adding these together gives 45 + 45 = 90 ways. Once a and c are picked, the middle number b is automatically locked in.
For more on grouping items correctly, read about selection problems with combinations, or compare these counting rules in probability problems compared.
What is the formula for any range?
You can adapt this parity logic to any sequence of integers from 1 to n.
If n is an even number, like 20, there are exactly k = n/2 odds and k = n/2 evens. The total number of ways to pick your outer terms will always be 2 × k(k − 1)/2, which simplifies to k(k − 1). For 20, k = 10, giving 10 × 9 = 90.
If n is an odd number, there is one more odd number than there are evens. This changes the pairing counts slightly, leading to the formula k² where k = (n − 1)/2. Using these formulas will save you crucial minutes on test day.



