Blog

Forming Numbers From Digits: Zero, Repetition, and Divisibility Rules

Learn a clean way to solve digit-number questions with zero, repetition, and divisibility rules through cases and examples.

  • 11th
  • Study Advice
Glowing digit tiles moving through a brass counting machine with zero set apart as a gatekeeper

Forming numbers from digits looks simple at first.

You get a set of digits, a length of number, and a condition. Then the question asks, “How many numbers can be formed?”

The trouble begins when zero appears. Then repetition is allowed in one question and not allowed in the next. Then a divisibility rule is added, and suddenly the same-looking question gives a completely different answer.

The solution is not to memorise many separate formulas.

The solution is to count positions in the right order.

This guide will help you handle zero, repetition, and divisibility restrictions without guesswork.

First, Remember What You Are Counting

When you form a number, order matters.

For example:

234 and 432 are different numbers.

They use the same digits, but the positions have changed. So most number-formation questions use permutation thinking, or more simply, place-by-place counting.

If you are forming a 3-digit number, think of three boxes:

Hundreds | Tens | Ones

If you are forming a 4-digit number, think of four boxes:

Thousands | Hundreds | Tens | Ones

Your job is to fill the boxes while respecting the conditions.

The Four Questions to Ask Before Calculating

Before writing any multiplication, ask these four questions.

QuestionWhy it matters
How many places are there?This gives the number of boxes to fill.
Is zero available?Zero may be blocked from the first place.
Is repetition allowed?Choices may stay the same or reduce after each place.
Is there a divisibility condition?The last digit, last two digits, or digit sum may need attention first.

Do not skip this step. Most wrong answers come from starting the multiplication before understanding the restrictions.

Why Zero Needs Special Care

Zero is a perfectly valid digit, but it cannot stand at the beginning of an ordinary number.

For example, 047 is not a 3-digit number. It is just 47 written with a zero in front.

So when the question asks for a 3-digit number using the digits 0, 1, 2, 3, 4, the hundreds place cannot be zero.

This one detail changes the answer.

Example 1: Without Repetition and Zero Included

Question:

How many 3-digit numbers can be formed from 0, 1, 2, 3, and 4 if repetition is not allowed?

Use three places:

Hundreds | Tens | Ones

The hundreds place cannot be zero. So it has 4 choices:

1, 2, 3, or 4

After that, one digit has already been used. Since repetition is not allowed, 4 digits remain for the tens place.

Then 3 digits remain for the ones place.

So:

4 x 4 x 3 = 48

Answer:

48 numbers

Example 2: With Repetition and Zero Included

Now change only one line.

Question:

How many 3-digit numbers can be formed from 0, 1, 2, 3, and 4 if repetition is allowed?

The hundreds place still cannot be zero.

So the hundreds place has 4 choices:

1, 2, 3, or 4

But now repetition is allowed. That means each later place can use any of the 5 digits again.

So:

4 x 5 x 5 = 100

Answer:

100 numbers

Notice what changed. Only the repetition condition changed, but the answer moved from 48 to 100.

A Clean Rule for Repetition

When repetition is not allowed, choices reduce after each used digit.

For example, from 5 digits:

5 x 4 x 3

When repetition is allowed, choices usually stay the same.

For example, from 5 digits:

5 x 5 x 5

But zero may still restrict the first place.

That is why a 3-digit number from 0, 1, 2, 3, 4 with repetition allowed is not:

5 x 5 x 5

It is:

4 x 5 x 5

The first place has only 4 choices because zero cannot be used there.

Divisibility Restrictions: Choose the Right Position First

Divisibility conditions usually control a special part of the number.

ConditionWhat to check first
Divisible by 2Ones place must be even.
Divisible by 5Ones place must be 0 or 5.
Divisible by 10Ones place must be 0.
Divisible by 4Last two digits must form a number divisible by 4.
Divisible by 3Sum of digits must be divisible by 3.
Divisible by 9Sum of digits must be divisible by 9.

The mistake students often make is filling the first place first, then discovering that the last digit had a condition.

If the condition is on the last digit, fill the last digit first.

If the condition is on the last two digits, think about the last two places first.

If the condition is on the digit sum, choose a valid group of digits first, then arrange them.

Example 3: Even Numbers Without Repetition

Question:

How many 3-digit even numbers can be formed from 0, 1, 2, 3, 4, and 5 if repetition is not allowed?

Since the number must be even, the ones place must be:

0, 2, or 4

But zero behaves differently if it is used at the end. So make cases.

Case 1: Ones Place Is 0

The number looks like this:

_ _ 0

The hundreds place can be any of:

1, 2, 3, 4, 5

So the hundreds place has 5 choices.

Then the tens place has 4 choices.

So:

5 x 4 = 20

Case 2: Ones Place Is 2 or 4

The ones place has 2 choices.

After choosing the ones digit, zero is still available, but the hundreds place cannot be zero.

Let us count carefully.

If the ones place is fixed as either 2 or 4, there are 5 digits left. Among them, zero is one digit and 4 are non-zero digits.

So the hundreds place has 4 choices.

Then the tens place has 4 choices.

So:

2 x 4 x 4 = 32

Total:

20 + 32 = 52

Answer:

52 even numbers

Example 4: Numbers Divisible by 5

Question:

How many 4-digit numbers divisible by 5 can be formed from 0, 1, 2, 3, 5, and 7 if repetition is not allowed?

A number divisible by 5 must end in:

0 or 5

Again, make cases.

Case 1: Ones Place Is 0

The number looks like:

_ _ _ 0

The thousands place can be any of the 5 non-zero digits:

1, 2, 3, 5, 7

Then 4 choices remain for the hundreds place and 3 choices remain for the tens place.

So:

5 x 4 x 3 = 60

Case 2: Ones Place Is 5

The number looks like:

_ _ _ 5

The thousands place cannot be zero. From the remaining digits 0, 1, 2, 3, 7, the thousands place has 4 choices:

1, 2, 3, or 7

Then the hundreds place has 4 choices and the tens place has 3 choices.

So:

4 x 4 x 3 = 48

Total:

60 + 48 = 108

Answer:

108 numbers

Example 5: Divisible by 10

Question:

How many 5-digit numbers divisible by 10 can be formed from 0, 1, 2, 3, 4, and 5 if repetition is not allowed?

For divisibility by 10, the ones place must be zero.

So fix zero at the end:

_ _ _ _ 0

Now fill the first four places using 1, 2, 3, 4, 5.

Since repetition is not allowed:

5 x 4 x 3 x 2 = 120

Answer:

120 numbers

This is easier than the divisible-by-5 question because there is only one possible final digit.

Example 6: Divisible by 3

Divisibility by 3 is different because it depends on the sum of the digits.

Question:

How many 3-digit numbers divisible by 3 can be formed from 0, 1, 2, 3, 4, and 5 if repetition is not allowed?

The sum of the digits must be divisible by 3.

Group the digits by their remainder when divided by 3:

RemainderDigits
00, 3
11, 4
22, 5

For a 3-digit number, one neat way to make a sum divisible by 3 is to choose one digit from each remainder group:

0 + 1 + 2 gives a multiple of 3

There are:

2 x 2 x 2 = 8

valid sets of three digits.

Now split those sets into two types.

Sets That Include Zero

If zero is chosen from the remainder-0 group, then we choose one digit from each of the other two groups.

Number of such sets:

1 x 2 x 2 = 4

Each set has 3 different digits, including zero.

Total arrangements of 3 different digits:

3! = 6

But arrangements with zero in the hundreds place are not allowed:

2! = 2

So each zero-including set gives:

6 - 2 = 4

numbers.

Total from these sets:

4 x 4 = 16

Sets That Do Not Include Zero

Here we choose the digit 3 from the remainder-0 group, and one digit from each of the other two groups.

Number of such sets:

1 x 2 x 2 = 4

Each set has no zero, so all arrangements are valid:

3! = 6

Total from these sets:

4 x 6 = 24

Final total:

16 + 24 = 40

Answer:

40 numbers

A Reliable Step-by-Step Method

Use this routine for almost every digit-number question.

Step 1: Draw the Places

If the number is 3-digit, draw:

_ _ _

If it is 4-digit, draw:

_ _ _ _

This prevents you from counting abstractly.

Step 2: Mark the Restricted Place

If the number is even, mark the last place.

If it is divisible by 5 or 10, mark the last place.

If it is divisible by 4, mark the last two places.

If zero is present, mark the first place.

Step 3: Decide Whether Cases Are Needed

Cases are needed when one option behaves differently from another.

Zero usually creates cases.

For example, in a number divisible by 5, ending in zero and ending in five do not behave the same way because zero at the end is harmless, but zero left for the first place is restricted.

Step 4: Fill the Most Restricted Place First

Do not always begin from the left.

Begin with the place that has the strongest condition.

For even numbers, begin with the ones place.

For numbers divisible by 10, fix zero in the ones place.

For ordinary numbers with no divisibility rule, begin with the first place if zero is present.

Step 5: Multiply Within a Case, Add Across Cases

Inside one case, the choices happen together, so multiply.

Between cases, the cases are separate, so add.

For example:

ending in 0 + ending in 5

means:

count case 1 + count case 2

This is the cleanest way to avoid double-counting.

Common Mistakes and How to Avoid Them

Mistake 1: Treating 0 as a Normal First Digit

This is the most common error.

If the question asks for a 4-digit number, the first digit cannot be zero.

Do not count numbers like:

0123

as 4-digit numbers.

Mistake 2: Filling Places From Left to Right Every Time

Left to right is fine for simple questions.

But if the number must be even, divisible by 5, or divisible by 10, the last digit is more restricted than the first digit.

Fill the last digit first.

Mistake 3: Forgetting That Repetition Changes the Remaining Choices

Without repetition:

choices reduce after each place

With repetition:

choices may stay the same

Always underline the phrase “repetition allowed” or “no digit repeated” before solving.

Mistake 4: Mixing Cases

Suppose a number must be divisible by 5.

Ending in 0 and ending in 5 are different cases if zero is in the digit set.

If you treat them as identical, your count may include invalid first-zero numbers or miss valid numbers.

Mistake 5: Using nPr Without Checking Zero

nPr is useful when all chosen digits are treated normally.

But if zero is present, nPr may count arrangements that begin with zero.

In such questions, place-by-place counting is usually safer.

Practice Questions

Try these before looking at the answers.

QuestionAnswer
How many 3-digit numbers can be formed from 1, 2, 3, 4, 5 without repetition?5 x 4 x 3 = 60
How many 3-digit numbers can be formed from 0, 1, 2, 3, 4 without repetition?4 x 4 x 3 = 48
How many 3-digit numbers can be formed from 0, 1, 2, 3, 4 with repetition allowed?4 x 5 x 5 = 100
How many 4-digit numbers divisible by 10 can be formed from 0, 2, 3, 4, 5 without repetition?4 x 3 x 2 = 24
How many 3-digit odd numbers can be formed from 0, 1, 2, 3, 4, 5 without repetition?3 x 4 x 4 = 48

For the last question, the ones place can be 1, 3, or 5. After fixing that, the hundreds place has 4 choices because zero cannot be first, and the tens place has 4 choices.

The Best Way to Build Speed

Do not practise this topic by jumping directly to formulas.

Practise by writing the structure first.

For each question, write:

Places:
Zero restriction:
Repetition:
Divisibility condition:
Cases:

Then solve.

This takes a little longer at first, but it makes you much faster later because your method becomes automatic.

The best students in counting chapters do not do magic. They simply know which restriction deserves attention first.

Frequently Asked Questions

Why can zero not be the first digit of a number?

Because a number like 047 is actually 47, not a 3-digit number. Zero can appear inside or at the end of a number, but it cannot create the first place of an ordinary fixed-digit number.

Is a code allowed to start with zero?

Yes, if the question says it is a code, password, PIN, or identification number and does not forbid leading zero. In that case, 047 can be treated as a 3-digit code, even though it is not a 3-digit number.

When should I start with the last digit?

Start with the last digit when the number must be even, odd, divisible by 5, or divisible by 10. These conditions directly control the ones place.

When should I make cases?

Make cases when different choices behave differently. Zero often creates cases, especially in questions about numbers divisible by 5, because ending in 0 and ending in 5 leave different restrictions for the first digit.

What changes when repetition is allowed?

When repetition is allowed, using a digit once does not remove it from later places. So the number of choices often stays the same for the remaining places, except where zero or a divisibility rule creates a special restriction.

Is nPr wrong for forming numbers?

Not always. nPr can work when all selected digits are equally valid in all positions. But when zero is included, or when the last digit has a divisibility condition, place-by-place counting is safer and clearer.

How do I handle divisibility by 3 or 9?

First choose digit groups whose sum is divisible by 3 or 9. Then arrange those digits, remembering that zero cannot be placed first if you are forming an ordinary fixed-digit number.

Looking for commerce tuitions?

Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.

Start classes