Placement Prep

Remainder Concept: Methods and Examples for Aptitude Tests

Solve remainder problems in aptitude rounds: product rule, negative remainders, Euler's theorem, and fully verified worked examples for TCS NQT and AMCAT.

By FACE Prep Team 5 min read
remainder-problems modular-arithmetic quantitative-aptitude aptitude-tricks placement-prep number-theory

Remainder problems in placement aptitude rounds test three techniques most students skip: the product rule for modular arithmetic, the negative-remainder shortcut, and Euler’s theorem for large powers. Basic division gets most students to the starting line. These three techniques separate top scorers in the TCS NQT Numerical Ability section, AMCAT Quantitative, and similar campus recruitment rounds.

This guide covers each technique with worked examples verified from first principles, including one example where the widely circulated answer is wrong.

What Is a Remainder?

The remainder is the amount left over when one integer is divided by another and the result is not exact. The division equation captures this:

N = D × q + r

Here N is the dividend, D is the divisor, q is the quotient, and r is the remainder.

The key constraint: r is always greater than or equal to 0, and strictly less than D. This means r can only take values from 0 to D minus 1.

Worked example: 17 divided by 5

  • 5 fits into 17 three times (5 × 3 = 15), leaving 2 over.
  • Division equation: 17 = 5 × 3 + 2
  • Remainder = 2

A frequent mix-up: students sometimes report the quotient (3) instead of the remainder (2). The remainder is what is left after subtracting the largest multiple of D that fits into N.

When the Remainder Is Zero

If D divides N exactly, r = 0. That is a valid remainder, not a special case. Divisibility tests (by 3, by 9, by 11) are asking precisely this: does r = 0 under that divisor?

The Product Rule for Remainders

Modular arithmetic distributes over multiplication. To find (A × B) mod D: reduce each factor individually, multiply, and reduce again.

Steps:

  • Step 1: Compute A mod D = a.
  • Step 2: Compute B mod D = b.
  • Step 3: Answer = (a × b) mod D.

Worked example: remainder when (18 × 27) is divided by 13

  • Step 1: 18 mod 13 = 5 (since 18 = 13 × 1 + 5)
  • Step 2: 27 mod 13 = 1 (since 27 = 13 × 2 + 1)
  • Step 3: 5 × 1 = 5
  • Remainder = 5

The same distributive property applies to sums: (A + B) mod D equals ((A mod D) + (B mod D)) mod D. For chains of three or more factors, reduce each in turn.

This property appears across several aptitude topics beyond standalone remainder questions. Calendar day-of-week problems use mod 7 with exactly this rule (see Calendar Problems in Aptitude Tests). Clock-hand position problems use mod 12 for hours (see Clocks for Competitive Exams). The 111 multiplication trick also relies on the same modular logic at its core.

The Negative Remainder Shortcut

When a number N is just below a multiple of the divisor D, write it as D minus k. Then N ≡ -k (mod D). This is the negative-remainder technique, and it is most valuable when raising the number to a large power, because the sign of (-k)^power follows simple odd-even rules.

Worked example: remainder when 17^2001 is divided by 18

  • Step 1: 17 = 18 - 1, so 17 ≡ -1 (mod 18).
  • Step 2: Raise both sides to the power 2001: 17^2001 ≡ (-1)^2001 (mod 18).
  • Step 3: 2001 is odd, so (-1)^2001 = -1.
  • Step 4: Convert -1 to its positive equivalent: -1 + 18 = 17.
  • Remainder = 17

A widely circulated version of this problem gives the answer as 1. That is arithmetically wrong for exponent 2001. The answer 1 would be correct for an even exponent ((-1)^2000 = 1), but the odd exponent gives -1, which adjusts to 17. Mixing up the sign rule for odd and even exponents is the most common error type in this category.

Verification of the technique with a simpler product:

Find the remainder when (13 × 15) is divided by 7.

  • 13 mod 7 = 6; rewrite as -1 (mod 7) since 6 = 7 - 1.
  • 15 mod 7 = 1.
  • (-1) × 1 = -1 ≡ 6 (mod 7).
  • Remainder = 6
  • Direct check: 13 × 15 = 195 = 7 × 27 + 6. Confirmed.

Large Powers: Euler’s and Fermat’s Theorems

The negative-remainder trick covers cases where the base is close to the divisor. For arbitrary large powers with a general divisor, Euler’s theorem provides a systematic reduction.

Euler’s theorem: If gcd(a, n) = 1 (a and n share no common factors), then a^φ(n) ≡ 1 (mod n).

Here φ(n) is Euler’s totient function (the count of integers from 1 to n that are coprime to n).

φ(n) for common divisors used in aptitude problems:

Divisor nφ(n)Notes
Prime pp - 1All integers below p are coprime to p
25 (= 5^2)20Formula: p^(k-1) × (p - 1)
36 (= 4 × 9)12Formula: φ(m) × φ(n) when gcd(m,n) = 1

Worked example: remainder when (13^100 + 17^100) is divided by 25

  • Step 1: φ(25) = 20. Both gcd(13, 25) = 1 and gcd(17, 25) = 1, so Euler’s theorem applies.
  • Step 2: By Euler’s theorem, 13^20 ≡ 1 (mod 25) and 17^20 ≡ 1 (mod 25).
  • Step 3: 100 = 5 × 20, so 13^100 = (13^20)^5 ≡ 1^5 = 1 (mod 25).
  • Step 4: Similarly, 17^100 = (17^20)^5 ≡ 1 (mod 25).
  • Step 5: 1 + 1 = 2.
  • Remainder = 2

Fermat’s Little Theorem

Fermat’s Little Theorem is the special case of Euler’s theorem for prime divisors. If p is prime and gcd(a, p) = 1, then a^(p-1) ≡ 1 (mod p). Use it whenever the divisor is prime; p - 1 is directly available without computing φ, which saves a step. For composite divisors, use the full Euler formula.

Multiple-Condition Remainder Problems

These problems state one remainder condition and ask how many values a second remainder can take. The LCM of the two divisors sets the period of the cycle.

Problem: A number N, when divided by 18, leaves remainder 7. When divided by 12, it leaves remainder n. How many values can n take?

Solution:

  • Step 1: Write N = 18k + 7 for non-negative integer k.
  • Step 2: LCM(18, 12) = 36. The value of N mod 12 repeats every 36.
  • Step 3: Work through one LCM cycle:
    • k = 0: N = 7; 7 mod 12 = 7
    • k = 1: N = 25; 25 mod 12 = 1
    • k = 2: N = 43; 43 mod 12 = 7 (cycle restarts)
  • n can be 7 or 1, giving two possible values.

The approach generalises: step k from 0 to (LCM / larger_divisor - 1) and collect distinct values. The maximum number of distinct values equals LCM divided by the larger divisor.

From Aptitude to Engineering: The Same Mod n Reasoning

The negative-remainder reduction used above: spotting 17 ≡ -1 (mod 18) and raising both sides to the same power is exactly the reasoning behind modular indexing in code. The % operator in C and most other languages implements mod directly, and the rules in this guide apply verbatim to understanding how ring buffers and hash tables distribute entries. For C coding problems, the modulo operator is already there; the aptitude reasoning above explains why it works.

TinkerLLM connects that number-theory intuition to building AI pipelines, where modular indexing over token batches and attention windows appears regularly. The entry tier starts at ₹299, a concrete way to check whether the engineering layer interests you before committing to a full programme.

Primary sources

Frequently asked questions

What is the formula for calculating a remainder?

The division equation is N = D × q + r, where q is the whole quotient and r is the remainder. The remainder is always 0 or above and strictly less than D. For 17 ÷ 5: 17 = 5 × 3 + 2, so r = 2.

How do I find the remainder when a product is divided by a number?

Use the product rule: reduce each factor modulo the divisor first, multiply the two reduced values, then reduce the result once more. For (18 × 27) mod 13, reduce 18 to 5 and 27 to 1, then 5 × 1 = 5. This works because remainders distribute over multiplication.

What is a negative remainder and when does it help?

A negative remainder arises when you write the dividend as (divisor minus k), giving dividend ≡ -k (mod divisor). It is most useful when the base is just below the divisor. For 17 mod 18, writing 17 = 18 - 1 means 17 ≡ -1 (mod 18), which dramatically simplifies power calculations.

When should I use Euler's theorem instead of the cyclicity method?

Use Euler's theorem when the divisor is not 10 or a power of 10 and the exponent is too large for direct calculation. The cyclicity (unit-digit) method is fastest for mod 10 problems. Euler's theorem applies whenever the base and divisor are coprime, regardless of the divisor value.

What is Fermat's Little Theorem and how does it differ from Euler's theorem?

Fermat's Little Theorem is the special case of Euler's theorem for prime divisors: if p is prime and the base a is not divisible by p, then a^(p-1) ≡ 1 (mod p). Euler's theorem generalises this to any modulus using the totient function φ(n), making it applicable to composite divisors like 25 or 36.

How do I count possible values of a remainder in a two-condition problem?

Find the LCM of the two divisors. Step through one LCM cycle starting from the given initial value and list the remainder with respect to the smaller divisor at each step. Each distinct value that appears is a possible answer. For a number with remainder 7 under divisor 18 and unknown remainder under divisor 12, the LCM is 36 and yields exactly two possible remainders: 7 and 1.

Build AI projects

A self-paced playground for building with LLMs.

TinkerLLM is FACE Prep's sister property. A guided environment for shipping real LLM applications, the kind of project that earns a paragraph on your resume, not a line.

Try TinkerLLM (₹299 launch)
Free AI Roadmap PDF