By the end of this chapter you'll be able to…

  • 1Compute the number and sum of divisors of N from its prime factorisation
  • 2Apply HCF x LCM = product of two numbers, and use the Euclidean algorithm for HCF
  • 3Apply divisibility rules for 2 through 11, including the alternating-sum rule for 11
  • 4Use cyclicity to find units digits and remainders of large powers, including Fermat's little theorem
  • 5Apply Legendre's formula for trailing zeros and the highest power of a prime dividing n!
  • 6Use inclusion-exclusion to count integers satisfying two or three divisibility conditions
  • 7Convert numbers between base 10 and another base
💡
Why this chapter matters in CAT
Number System questions frequently involve numbers too large to compute directly, and the entire topic is a set of shortcuts — prime factorisation, modular arithmetic, cyclicity, and Legendre's formula — that avoid ever computing the large number itself. It is also QA's most 'trick-dependent' topic: recognising which shortcut applies is usually faster than any direct computation, and the shortcuts themselves are simple once seen.

Before you start — revise these

🔗
Comfort with prime factorisation of small to medium numbers
Every shortcut in this chapter starts from a correct prime factorisation.
🔗
Arithmetic
Percentage and ratio fluency from Arithmetic supports the word-problem framing of HCF/LCM questions.
🔗
Basic modular arithmetic notation (a ≡ b mod n)
Read as 'a and b leave the same remainder when divided by n' — used throughout Sections 4 and 7.

Number System — CAT Quantitative Ability

Number System questions frequently involve numbers too large to compute directly — a 100-digit factorial, a power like , or a divisor count for a number with dozens of factors. The entire topic is a set of shortcuts that avoid ever computing the large number itself, built on prime factorisation, modular arithmetic and a few counting identities.

1. Factors and divisors

If is the prime factorisation of , then:

For : number of divisors , and sum of divisors . Both formulas depend entirely on correct prime factorisation — an arithmetic slip there propagates through the whole computation, so factorising carefully is worth the extra ten seconds.

A number is a perfect square if and only if it has an odd number of divisors — every divisor of pairs with , and this pairing is perfect except when , which happens only when is a perfect square. This converts "how many perfect squares divide 's divisor list" reasoning into a parity check on the divisor count itself, without listing a single divisor.

Euler's totient function counts the integers from to that share no common factor with , and for it is computed directly from the prime factorisation:

For : — exactly 12 of the numbers from 1 to 36 share no factor with 36.

2. HCF and LCM

For any two numbers, the product of their HCF and LCM always equals the product of the numbers themselves:

This identity converts a question that gives HCF and one number (or LCM and one number) directly into the other, without factorising either number. The Euclidean algorithm — repeatedly replacing the larger number with the remainder of dividing it by the smaller, until the remainder is — finds the HCF of two numbers faster than factorising both, especially when the numbers are large or share no small common factors that are easy to spot by inspection.

Trap. The HCF-LCM product identity holds only for two numbers, not three or more. For three numbers, HCF and LCM must each be computed directly (pairwise HCF repeated, or via prime factorisation), and there is no shortcut product relationship analogous to the two-number case.

HCF and LCM of fractions follow their own direct rule, applied to numerators and denominators separately:

A recurring word-problem pattern — "find the greatest length that can measure three given lengths exactly" — is simply asking for the HCF of the three lengths, while "find the smallest quantity that is a whole multiple of each of several given quantities" is asking for the LCM; recognising which of the two a word problem wants, before computing anything, is the actual difficulty.

3. Divisibility rules

DivisorRule
2Last digit is even
3Digit sum divisible by 3
4Last two digits divisible by 4
5Last digit is 0 or 5
6Divisible by both 2 and 3
8Last three digits divisible by 8
9Digit sum divisible by 9
11Alternating digit sum (from the right) divisible by 11

The rule for 11 is the one candidates most often get wrong by applying it inconsistently: take the digits from the right, alternately adding and subtracting, and check whether the result is a multiple of (including ). For : alternating sum , a multiple of — confirming .

Divisibility by 7 has no single-glance rule, but a genuinely fast iterative one exists: double the last digit, subtract it from the remaining leading digits, and repeat until a small enough number remains to check by inspection. For : last digit , doubled is ; remaining digits , minus is , which is — so is divisible by .

This is faster than long division once practised, though most CAT questions involving 7 are better handled through the remainder and cyclicity techniques of the next two sections rather than a pure divisibility check.

4. Remainders and congruences

Modular arithmetic (writing when and leave the same remainder on division by ) lets remainders be computed step by step rather than by dividing an enormous number directly: remainders of a product are the product of the remainders (each reduced mod as you go), and remainders of a sum are the sum of the remainders.

Fermat's little theorem gives a direct shortcut for remainders modulo a prime : if does not divide , then . This is why large-exponent remainder questions modulo a prime often reduce to finding the exponent's remainder modulo first, rather than reducing the base's powers one at a time.

A binomial-expansion trick handles remainder questions where the base is one more or one less than the divisor. Writing as and expanding by the binomial theorem, every term except the last carries a factor of , so — the whole computation reduces to the sign of , with no actual expansion needed.

A negative remainder is simply converted to the standard positive form by adding the divisor: a computed remainder of modulo is reported as , since remainders are conventionally stated as non-negative and smaller than the divisor.

5. Units digit and cyclicity

The units digit of a power depends only on the units digit of the base, and it repeats in a cycle of length at most 4:

Units digit of baseCycleLength
0, 1, 5, 6Always the same digit1
4, 9Two-digit cycle2
2, 3, 7, 8Four-digit cycle4

To find the units digit of , find the cycle for 's units digit, then reduce modulo the cycle length (treating a remainder of as the last position in the cycle, not position ). For : the cycle of is (length 4), and , so the units digit is the 2nd entry, .

6. Primes

A number is prime only if it has no factor other than 1 and itself, and testing this requires checking divisibility only up to its square root — if had a factor greater than , it would necessarily pair with a factor smaller than , which would already have been found. This is why primality testing for even a fairly large number is fast: checking means testing divisibility only by primes up to .

Any two consecutive integers are always coprime (their HCF is always 1), since any common factor greater than 1 would have to divide their difference, which is exactly 1. This single fact underlies why consecutive-integer product and sum questions in probability and counting rarely need an explicit HCF computation — coprimality is guaranteed by the setup itself.

6a. Number systems and base conversion

A number written in base uses digits through , and its value in base 10 is the sum of each digit times the corresponding power of . Converting (base 8) to base 10: .

Converting base 10 to another base reverses the process, by repeated division: divide by the target base, record the remainder, and repeat on the quotient until it reaches 0 — the remainders, read from last to first, are the digits of the new base representation. This is the same repeated-division idea used in the Euclidean algorithm, applied to place value instead of to a common factor.

7. Factorials — trailing zeros and prime powers

A trailing zero in comes from a factor of , and factors of 5 are always scarcer than factors of 2 in a factorial — so the number of trailing zeros equals the number of times divides , computed by Legendre's formula:

For : trailing zeros . The same formula with any prime gives the highest power of that prime dividing , not just for trailing zeros.

8. Counting via inclusion-exclusion

For two overlapping conditions, counting "either A or B" by simply adding the counts of A and B double-counts everything satisfying both:

To count numbers from 1 to 100 divisible by 2 or 3: . The subtracted term is always the count divisible by the LCM of the two divisors, not their product, which matters once the two conditions share a common factor.

For three conditions, the pattern extends by adding back the triple overlap that gets subtracted out twice:

Each pairwise and triple intersection is again computed via the LCM of the relevant divisors — counting numbers up to 100 divisible by 2, 3 or 5 needs the individual counts, all three pairwise LCM counts (6, 15, 10), and the count divisible by their overall LCM (30), combined by this alternating pattern.

Worked Examples

Example 1 (divisors — easy). Find the number of divisors and the sum of divisors of 360.

. Number of divisors . Sum of divisors .

Example 2 (HCF-LCM — easy). Two numbers have HCF 12 and LCM 72. If one of the numbers is 24, find the other.

Using product of the numbers: .

Example 3 (HCF via Euclid — medium). Find the HCF of 1071 and 462 using the Euclidean algorithm.

. . . The last non-zero remainder is , so .

Example 4 (remainders — hard). Find the remainder when is divided by 5.

, so we need . The cycle of powers of mod is (length 4, matching Fermat's little theorem since ). , meaning the exponent is an exact multiple of the cycle length, landing on the last (4th) entry: . The remainder is .

Example 5 (units digit — easy). Find the units digit of .

The cycle of units digits of powers of 3 is (length 4). , landing on the 2nd entry: .

Example 6 (factorials, trailing zeros — medium). Find the number of trailing zeros in .

trailing zeros.

Example 7 (factorials, prime power — hard). Find the highest power of 3 that divides .

. So divides , and does not.

Example 8 (inclusion-exclusion — medium). How many integers from 1 to 100 are divisible by 2 or 3?

.

Example 9 (base conversion — medium). Convert 300 (base 10) to base 8.

remainder . remainder . remainder . Reading the remainders from last to first: .

Check: , confirming the conversion.

Summary

Number System questions almost always avoid computing the large number itself — through prime factorisation, modular arithmetic, or a counting identity — so the goal is always to find the right shortcut, not to brute-force the arithmetic.

Number and sum of divisors follow directly from prime factorisation: for the count, and the product of terms for the sum.

HCF × LCM equals the product of the two numbers — for two numbers only, never three or more — and the Euclidean algorithm finds HCF fast without factorising.

Units digits and remainders both repeat in cycles of length at most 4 (mod 10 for units digits; length for remainders modulo a prime , via Fermat's little theorem); reduce the exponent modulo the cycle length, treating an exact multiple as the last position, not position zero.

Trailing zeros in and the highest power of any prime dividing both use Legendre's formula, summing until the terms vanish.

Inclusion-exclusion for two overlapping conditions subtracts the count divisible by their LCM, not their product, from the sum of the individual counts.

Key formulas & results

Everything to memorise for the exam hall, in one card. Screenshot this for revision.

Number and sum of divisors
Both computed from N's prime factorisation p_1^{a_1}p_2^{a_2}\cdots.
Perfect square divisor test
Every divisor pairs with N/d except when d=N/d=√N.
Euler's totient
Counts integers from 1 to N sharing no common factor with N.
HCF-LCM product
Holds for two numbers only, never three or more.
Divisibility by 11
The most-misapplied rule when the alternation direction is inconsistent.
Fermat's little theorem
Reduces the exponent modulo p-1 for remainder questions modulo a prime.
Cyclicity of units digits
Reduce the exponent modulo the cycle length; an exact multiple lands on the LAST entry, not position 0.
Legendre's formula
Gives the highest power of prime p dividing n!; trailing zeros use p=5.
Inclusion-exclusion (two sets)
The subtracted term uses the LCM of the two divisors, not their product.
Inclusion-exclusion (three sets)
Every intersection term uses the LCM of the relevant divisors.
⚠️

Traps CAT sets — and how to dodge them

These are the exact option-traps and misreads that cost marks under negative marking.

WATCH OUT
Applying the HCF x LCM = product identity to three or more numbers
Compute HCF and LCM of three or more numbers directly via prime factorisation; the two-number product shortcut does not generalise.
Why it happens: The identity relies on a pairing specific to exactly two numbers' prime factorisations.
WATCH OUT
Treating an exponent that is an exact multiple of the cycle length as landing on 'position 0'
An exact multiple of the cycle length lands on the LAST entry of the cycle, not a hypothetical zeroth one.
Why it happens: Cycles are conventionally indexed starting at position 1, so remainder 0 in modular arithmetic corresponds to the final position.
WATCH OUT
Computing trailing zeros by counting factors of 2 instead of 5 in n!
Count factors of 5 via Legendre's formula — factors of 2 are always more abundant, so 5 is the limiting factor.
Why it happens: Every even number contributes a factor of 2, while only every fifth number contributes a factor of 5, making 5 the scarcer resource.
WATCH OUT
Subtracting the product of two divisors instead of their LCM in inclusion-exclusion
The overlap term |A∩B| is the count divisible by the LCM of the two divisors, not their product.
Why it happens: Only when the two divisors are coprime does their LCM equal their product; otherwise using the product undercounts the overlap.
WATCH OUT
Reporting a negative remainder directly
Add the divisor to a negative remainder to convert it to the standard non-negative form smaller than the divisor.
Why it happens: Remainders are conventionally reported as non-negative integers less than the divisor.
WATCH OUT
Re-deriving the alternating-sum rule for 11 inconsistently (sometimes from the left, sometimes from the right)
Always alternate starting from the rightmost (units) digit.
Why it happens: Applying the rule from the wrong end can silently flip the sign of some terms and give a false result.

Exam-pattern practice

PYQ-style questions with full solutions. Work through them as a readiness check — mark yourself honestly and get your gap report at the end.

Readiness check

Are you exam-ready for Number System?

12 problems from this chapter. Try each one, reveal the worked solution, mark yourself honestly — get your gap report at the end.

12 questions~8 min worth ~66 marks in CAT exams

5-minute revision

The whole chapter, distilled. Read this the night before the exam.

  • Prime factorisation is the starting point for divisor count, divisor sum, HCF, LCM and totient.
  • N is a perfect square iff it has an odd number of divisors.
  • HCF x LCM = product of the numbers, for two numbers only.
  • The Euclidean algorithm finds HCF fast without full factorisation.
  • Divisibility by 11: alternating digit sum from the right must be a multiple of 11.
  • Units digits cycle with length 1, 2 or 4 depending on the base's units digit.
  • An exponent that is an exact multiple of the cycle length lands on the LAST entry, not position 0.
  • Fermat's little theorem: a^(p-1) ≡ 1 (mod p) for prime p not dividing a.
  • A base-plus-or-minus-one trick (binomial expansion) solves many large-exponent remainder questions in one line.
  • Trailing zeros in n! and the highest power of any prime dividing n! both use Legendre's formula.
  • Inclusion-exclusion overlap terms always use the LCM of the relevant divisors, not their product.
  • Base conversion: base-to-10 uses place values; 10-to-base uses repeated division, reading remainders last to first.

CAT question blueprint

How this topic is asked, tier by tier — so you can prep to the pattern.

Typical weightage: Number System contributes an estimated 6-9 of QA's 66 marks (about 3 of 22 questions)

Question styleMarks eachTypical countWhat it tests
Factors and divisors3~1Divisor count/sum, perfect-square test and totient
HCF and LCM3~1The product identity and the Euclidean algorithm
Remainders and congruences3~1Cyclicity, Fermat's little theorem and the binomial remainder trick
Factorials3~0-1Legendre's formula for trailing zeros and prime powers
Counting via inclusion-exclusion3~0-1Two- and three-set overlap counting
Units digit and cyclicity3~0-1Cycle length identification and exponent reduction
Number systems and base conversion3~0-1Base-to-decimal and decimal-to-base conversion
Prep strategy
  • Day 1: prime factorisation, divisor count/sum, perfect squares and Euler's totient.
  • Day 2: HCF, LCM, the Euclidean algorithm and divisibility rules.
  • Day 3: cyclicity for units digits and remainders, plus Fermat's little theorem.
  • Day 4: Legendre's formula and inclusion-exclusion, then a timed mixed set across all sub-topics.

Exam-hall strategy

Battle-tested tips from mentors and toppers for this topic under the sectional clock.

  1. Factorise carefully before applying any divisor-count, divisor-sum or totient formula.
  2. For any large-exponent remainder or units-digit question, find the cycle first, then reduce the exponent modulo the cycle length.
  3. Treat an exact multiple of the cycle length as landing on the last entry, never position zero.
  4. Use Legendre's formula directly for trailing-zero and highest-prime-power questions; never attempt to compute the factorial itself.
  5. For an inclusion-exclusion count, use the LCM of the divisors for every overlap term.

Beyond the exam

Where this skill shows up in the job you're competing for — and in life.

Cryptography and secure communication

Modular arithmetic and Fermat's little theorem are the direct mathematical basis of RSA and other public-key encryption schemes.

Scheduling and resource allocation

LCM finds the next time multiple recurring events (production cycles, bus schedules) coincide; HCF finds the largest common measuring unit.

Computer number representation

Base conversion between decimal, binary, octal and hexadecimal is exactly how computers represent and process numeric data internally.

Where else this topic is tested

Prepare once, score in every exam that asks it.

XAT Quantitative Ability & DIHigh — near-identical number-system topics
SSC CGL / IBPS PO Quantitative AptitudeHigh — heavier on direct divisibility and HCF-LCM word problems
GATE Discrete MathematicsModerate overlap on modular arithmetic and number theory basics, at a more formal level

Questions aspirants ask

Pulled from the Q&A community and mentor sessions.

Roughly 3 of QA's 22 questions — the smallest individual QA topic by question count, but often the highest-leverage per question because a single memorised shortcut (cyclicity, Legendre's formula, inclusion-exclusion) can solve what looks like an intractable computation.

The cycle length tells you how far to look before the pattern repeats — 1, 2 or 4 depending on the base's units digit. When the exponent is an exact multiple of the cycle length, the result lands on the LAST entry of the cycle, not a nonexistent 'zeroth' position — for example, powers of 3 with exponent a multiple of 4 always end in 1, the fourth and final entry of the cycle 3,9,7,1.

Count factors of 5 using Legendre's formula, summing floor(n/5) + floor(n/25) + floor(n/125) + ... until the terms become zero. Factors of 2 are always more abundant in a factorial than factors of 5, so 5 is always the limiting factor for trailing zeros.

Whenever the two (or more) conditions can both be true for the same number — for instance, being divisible by both 2 and 3 at once. Simply adding the individual counts double-counts every number satisfying both conditions, so the overlap (computed via the LCM of the divisors) must be subtracted back out.

Mostly, yes — but the rules are few and each one replaces what would otherwise be an intractable direct computation on a very large number. The actual exam skill is recognising which rule the question's structure calls for, not deriving the rule itself under time pressure.
Header Logo