JEE Main 2025 — 28 January, Morning Shift. Previous Year Question.
Problem
The number of ways to form 5-digit numbers greater than 50000 with the use of digits 0, 1, 2, 3, 4, 5, 6, 7, such that the sum of the first and last digit is not more than 8, is equal to:
Key insight. “Greater than 50000” forces the first digit to be 5, 6, or 7 — and the problem doesn’t state that repetition is disallowed, so the middle three digits can be filled freely from all 8 digits. The only real work is figuring out, for each choice of first digit, how many values the last digit can take without breaking the sum-at-most-8 condition.
Watch this explained step by step → · More on the Shiwam’s Classes channel
Approach
Since the number must exceed 50000, the first digit can only be 5, 6, or 7 — these are the only digits in the given set that satisfy the “greater than 50000” condition. For each choice of first digit, the condition “first digit + last digit ≤ 8” limits how many values the last digit can take, while the three middle digits are unrestricted and can repeat freely across all 8 available digits.
Solution
Step 1 — First digit = 5
The last digit must satisfy $5 + (\text{last digit}) \le 8$, so the last digit can be $0, 1, 2,$ or $3$ — 4 choices.
The three middle digits are unrestricted, so each has 8 choices (repetition allowed):
$$1 \times 8 \times 8 \times 8 \times 4 = 8^3 \times 4$$
Step 2 — First digit = 6
The last digit must satisfy $6 + (\text{last digit}) \le 8$, so it can be $0, 1,$ or $2$ — 3 choices:
$$8^3 \times 3$$
Step 3 — First digit = 7
The last digit must satisfy $7 + (\text{last digit}) \le 8$, so it can only be $0$ or $1$ — 2 choices:
$$8^3 \times 2$$
Step 4 — Add the three cases
$$8^3\times 4 + 8^3\times 3 + 8^3\times 2 = 8^3(4+3+2) = 8^3 \times 9$$
Since $8^3 = 512$:
$$512 \times 9 = 4608$$
Step 5 — Remove the one invalid case
Among the numbers counted when the first digit is 5, one specific combination is $5,0,0,0,0$ — that is, the number $50000$ itself, with every middle digit and the last digit equal to 0. But the question asks for numbers greater than 50000, so this one case must be excluded:
$$4608 – 1 = 4607$$
Answer
$$4607$$
Common mistakes
- Forgetting repetition is allowed. The problem doesn’t explicitly say digits can repeat, but numbers like 50001 and 50000 clearly reuse digits, so treating this as a without-repetition problem gives a completely wrong count.
- Not subtracting the boundary case. $8^3 \times 9 = 4608$ counts $50000$ itself, which fails the strict “greater than” condition — missing this subtraction lands on option (4) instead of the correct (3).
Practise next
- How many 4-digit numbers greater than $3000$, formed from the digits $0$–$5$ with repetition allowed, have first digit plus last digit at most $6$? The same case-by-case split on the first digit works.
Show answer
$323$. The first digit must be $3$, $4$ or $5$, and the two middle digits are always free, giving $6\times6=36$ each time.
If the first digit is $3$, the last is at most $3$ — four choices — giving $4\times36=144$; but $3000$ itself is not greater than $3000$, so this case contributes $143$. If it is $4$, the last is at most $2$: $3\times36=108$. If it is $5$, the last is at most $1$: $2\times36=72$.
Total $143+108+72 = 323$. The single excluded number is the whole reason to read “greater than” carefully rather than as “at least”.

Doubts are answered by Shiwam, usually within a day. Ask about this question specifically — a general question about the chapter is better asked in class.