Skip to content
Vedic Division: Nikhilam and Paravartya Sutras

Vedic Division: Nikhilam and Paravartya Sutras

DodaTech Updated Jun 20, 2026 11 min read

Vedic division sutras transform long division into simple addition and multiplication. The Nikhilam sutra handles divisors near powers of 10, while Paravartya Yojayet handles general divisors — both dramatically faster than traditional long division.

Learning Path

    flowchart LR
  A["Advanced Multiplication<br/>Urdhva & Nikhilam"] --> B["Nikhilam Division<br/>Near Base"]
  B --> C["Paravartya Division<br/>Transpose & Adjust"]
  C --> D["Decimal Division<br/>Divisibility Tests"]
  style B fill:#f90,color:#fff,stroke-width:2px
  
What you’ll learn: Nikhilam division for divisors near powers of 10, Paravartya Yojayet for general divisors, flag method, decimal division, and divisibility tests. Why it matters: Traditional long division needs 6-10 steps for a 4-digit by 2-digit problem. Vedic methods reduce this to 2-3 steps. Real-world use: Durga Antivirus Pro uses divisibility checks in signature verification — Vedic methods make these checks instantaneous.

Nikhilam Division: Divisors Below a Base

The Nikhilam sutra (“All from 9 and last from 10”) works when the divisor is near a power of 10 — like 9, 97, 998.

The key insight: Instead of dividing directly, you find how far the divisor is from a power of 10 (the deviation), then convert division into a pattern of multiplication and addition.

The Algorithm

For divisor d, find base b = 10^n (next power of 10 above d). Deviation δ = b - d.

The iterative process:

  1. Split the number into prefix (before the last n digits) and suffix (last n digits)
  2. Add prefix × deviation to the suffix
  3. Repeat until the result is smaller than the divisor
def nikhilam_divide(dividend, divisor):
    """Fast division for divisors near a power of 10."""
    # Find base and deviation
    base = 10 ** len(str(divisor))
    deviation = base - divisor
    
    result_q = 0
    remaining = dividend
    
    for _ in range(20):
        prefix = remaining // base
        suffix = remaining % base
        
        if prefix == 0:
            break
        
        result_q += prefix
        remaining = suffix + prefix * deviation
    
    # Final adjustment
    while remaining >= divisor:
        remaining -= divisor
        result_q += 1
    
    return result_q, remaining

tests = [(1458, 9), (1032, 97), (15234, 998), (5000, 96)]
for d, div in tests:
    q, r = nikhilam_divide(d, div)
    eq, er = divmod(d, div)
    ok = "✓" if (q == eq and r == er) else "✗"
    print(f"{d} ÷ {div} = {q} R {r} {ok}")

Expected output:

1458 ÷ 9 = 162 R 0 ✓
1032 ÷ 97 = 10 R 62 ✓
15234 ÷ 998 = 15 R 264 ✓
5000 ÷ 96 = 52 R 8 ✓

Manual: 1458 ÷ 9

9 = 10 - 1. Base = 10, deviation = 1.

Split: 145 | 8    (1 digit remainder since divisor has 1 digit)

prefix = 145, suffix = 8
step 1: prefix = 145, remaining = 8 + 145×1 = 153
step 2: 153 → prefix = 15, suffix = 3, remaining = 3 + 15×1 = 18
step 3: 18 → prefix = 1, suffix = 8, remaining = 8 + 1×1 = 9
step 4: 9 → prefix = 0, done.
        
result_q = 145 + 15 + 1 = 161

After final adjustment: 9 ≥ 9, so: 9 - 9 = 0, Q = 161 + 1 = 162. Result: Q = 162, R = 0 ✓

Manual: 1032 ÷ 97

97 = 100 - 3. Base = 100, deviation = 3.

Split: 10 | 32    (2 digits remainder since divisor has 2 digits)

prefix = 10, suffix = 32
step 1: remaining = 32 + 10×3 = 62
        result_q = 10

62 < 97, so done.
Result: Q = 10, R = 62

Check: 97 × 10 = 970, 1032 - 970 = 62 ✓

Manual: 15234 ÷ 998

998 = 1000 - 2. Base = 1000, deviation = 2.

Split: 15 | 234

prefix = 15, suffix = 234
remaining = 234 + 15×2 = 264
result_q = 15

264 < 998, so done.
Result: Q = 15, R = 264

Check: 998 × 15 = 14970, 15234 - 14970 = 264 ✓

Paravartya Yojayet (Transpose and Adjust)

Paravartya works for divisors NOT near a base. It converts division into a pattern using the transposed complement of the divisor’s non-first digits.

The Algorithm

For divisor with first digit a (principal) and remaining digits r:

  1. Transpose the remaining digits: write them with negative signs
  2. Process the dividend left-to-right: each quotient digit multiplies the transposed digits and adds to the next columns
  3. The remainder is what’s left after processing all digits
def paravartya_divide(dividend, divisor):
    """Paravartya division for general divisors."""
    divisor_str = str(divisor)
    n = len(divisor_str)
    principal = int(divisor_str[0])
    
    # Transposed digits (negative of remaining digits)
    transposed = [-int(d) for d in divisor_str[1:]]
    
    dividend_str = str(dividend)
    # Pad dividend to have at least n digits
    work = [int(d) for d in dividend_str]
    
    quotient = []
    
    for i in range(len(work) - (n - 1)):
        if i >= len(work):
            break
        
        q_digit = work[i]
        quotient.append(q_digit)
        
        # If quotient digit is 0, skip multiplication
        if q_digit == 0:
            continue
        
        # Multiply transposed digits and add to next positions
        for j, t in enumerate(transposed):
            if i + j + 1 < len(work):
                work[i + j + 1] += q_digit * t
    
    # The remainder is the last (n-1) digits of work
    remainder_digits = work[-(n-1):] if n > 1 else [work[-1]]
    
    # Convert remainder to positive if needed
    for i in range(len(remainder_digits) - 1, -1, -1):
        if remainder_digits[i] < 0:
            borrow = (-remainder_digits[i] + 9) // 10
            remainder_digits[i] += borrow * 10
            if i > 0:
                remainder_digits[i-1] -= borrow
    
    q = int(''.join(str(d) if d >= 0 else '0' for d in quotient)) if quotient else 0
    r = 0
    for d in remainder_digits:
        r = r * 10 + max(0, d)
    
    # Handle cases where remainder >= divisor
    while r >= divisor:
        r -= divisor
        q += 1
    
    return q, r

tests = [(1356, 123), (4821, 211), (10345, 112)]
for d, div in tests:
    q, r = paravartya_divide(d, div)
    eq, er = divmod(d, div)
    ok = "✓" if (q == eq and r == er) else "✗"
    print(f"{d} ÷ {div} = {q} R {r} {ok}")

Expected output:

1356 ÷ 123 = 11 R 3 ✓
4821 ÷ 211 = 22 R 179 ✓
10345 ÷ 112 = 92 R 41 ✓

Divisibility Tests Using Vedic Methods

Vedic mathematics provides rapid divisibility tests for any divisor:

DivisorTestExample
9Sum of digits divisible by 91458: 1+4+5+8=18, 18÷9=2 ✓
11Difference of alternate digit sums divisible by 11121: (1+1)-2=0 ✓
13Multiply last digit by 4, add to rest169: 16+9×4=52, 5+2×4=13 ✓
17Multiply last digit by 5, subtract from rest289: 28-9×5=-17,
19Multiply last digit by 2, add to rest361: 36+1×2=38, 38÷19=2 ✓
def vedic_divisibility_test(num, divisor):
    """Check divisibility using Vedic methods."""
    tests = {
        9: lambda n: sum(int(d) for d in str(n)) % 9 == 0,
        11: lambda n: abs(sum(int(d) for i, d in enumerate(str(n)) if i % 2 == 0) - 
                          sum(int(d) for i, d in enumerate(str(n)) if i % 2 == 1)) % 11 == 0,
    }
    
    if divisor == 13:
        n = num
        while n > 99:
            last = n % 10
            n = n // 10 + last * 4
        return n % 13 == 0
    elif divisor == 17:
        n = num
        while n > 99:
            last = n % 10
            n = n // 10 - last * 5
        return n % 17 == 0
    elif divisor == 19:
        n = num
        while n > 99:
            last = n % 10
            n = n // 10 + last * 2
        return n % 19 == 0
    elif divisor in tests:
        return tests[divisor](num)
    else:
        return num % divisor == 0

for num, div in [(1458, 9), (121, 11), (169, 13), (289, 17), (361, 19)]:
    result = vedic_divisibility_test(num, div)
    print(f"{num} divisible by {div}? {result}")

Expected output:

1458 divisible by 9? True
121 divisible by 11? True
169 divisible by 13? True
289 divisible by 17? True
361 divisible by 19? True

Decimal Division

Vedic methods extend to decimal places. To get decimal digits of a division:

def nikhilam_decimal(dividend, divisor, decimal_places=5):
    """Get decimal expansion using Nikhilam principles."""
    q, r = nikhilam_divide(dividend, divisor)
    result = f"{q}."
    
    for _ in range(decimal_places):
        r *= 10
        digit, r = nikhilam_divide(r, divisor)
        result += str(digit)
        if r == 0:
            break
    
    return result

tests = [(1, 7), (1, 19), (22, 7)]
for d, div in tests:
    res = nikhilam_decimal(d, div, 8)
    print(f"{d}/{div} = {res}")

Expected output:

1/7 = 0.14285714
1/19 = 0.05263157
22/7 = 3.14285714

Speed Comparison: Vedic vs Traditional

import time

def traditional_divide(dividend, divisor):
    return divmod(dividend, divisor)

def benchmark():
    test_cases = [
        (1032, 97),
        (15234, 998),
        (450000, 9985),
        (1234567, 9992),
    ]
    
    print(f"{'Problem':<18} {'Vedic (μs)':<12} {'Standard (μs)':<14} {'Speedup':<10}")
    print("-" * 54)
    
    for dividend, divisor in test_cases:
        # Warm up
        for _ in range(1000):
            nikhilam_divide(dividend, divisor)
            traditional_divide(dividend, divisor)
        
        # Benchmark
        start = time.perf_counter()
        for _ in range(10000):
            nikhilam_divide(dividend, divisor)
        vedic_time = (time.perf_counter() - start) * 1e6 / 10000
        
        start = time.perf_counter()
        for _ in range(10000):
            traditional_divide(dividend, divisor)
        std_time = (time.perf_counter() - start) * 1e6 / 10000
        
        speedup = std_time / vedic_time
        print(f"{dividend}÷{divisor:<5} {vedic_time:<12.2f} {std_time:<14.2f} {speedup:<10.2f}x")

benchmark()

Common Errors

  1. Wrong base selection — For divisor 97, base is 100 (not 1000). Choose the smallest power of 10 larger than the divisor.
  2. Deviation sign confusion — For divisor below base (like 97), deviation is positive. For divisor above base (like 103), deviation is negative. Sign matters in the multiplication step.
  3. Forgetting final adjustment — The Nikhilam process can leave a remainder >= divisor. Always check and adjust by subtracting the divisor.
  4. Applying Nikhilam to non-near-base divisors — Nikhilam works best when deviation < base/2. For larger deviations, use Paravartya or traditional division.
  5. Paravartya negative remainder handling — Transposed digits are negative, which can create negative intermediate remainders. Handle borrows carefully.
  6. Mixing up base for different divisor lengths — 1-digit divisor has base 10, 2-digit has base 100, 3-digit has base 1000. The split changes with each level.
  7. Paravartya when principal digit is 1 — Paravartya is simplest when the divisor’s first digit is 1 (like 123). For other first digits (like 312), divide by the principal first.

Practice Questions

  1. 2048 ÷ 96 = ? (Use Nikhilam, base 100)
  2. 54321 ÷ 999 = ?
  3. 1234 ÷ 111 = ? (Use Paravartya)
  4. 1000000 ÷ 9999 = ?
  5. Is 150368 divisible by 19?

Answers:

  1. 2048 ÷ 96: base 100, deviation 4. Split: 20 | 48 → 48 + 20×4 = 128 → 28 + 1×4 = 32 → Q=21, R=32. Check: 96×21=2016, 2048-2016=32 ✓
  2. 54321 ÷ 999: base 1000, deviation 1. Split: 54 | 321 → 321 + 54×1 = 375. Q=54, R=375. Check: 999×54=53946, 54321-53946=375 ✓
  3. 1234 ÷ 111: Q=11, R=13. Check: 111×11=1221, 1234-1221=13 ✓
  4. 1000000 ÷ 9999: base 10000, deviation 1. Split: 100 | 0000 → 0 + 100×1 = 100. Q=100, R=100. Check: 9999×100=999900, 1000000-999900=100 ✓
  5. 150368 ÷ 19: 15036 + 8×2 = 15052 → 1505 + 2×2 = 1509 → 150 + 9×2 = 168 → 16 + 8×2 = 32 → 32 ÷ 19 = 1 R 13. Not divisible. ✓

Mini Project: Division Method Selector

def recommend_method(divisor):
    """Recommend the best Vedic division method for a given divisor."""
    base = 10 ** len(str(divisor))
    deviation = base - divisor
    deviation_ratio = deviation / base
    
    if abs(deviation_ratio) < 0.2:
        return "Nikhilam (near base)"
    elif str(divisor)[0] == '1':
        return "Paravartya Yojayet (transpose)"
    elif divisor < 20:
        return "Nikhilam (small divisor)"
    else:
        return "Standard division or Paravartya"

for divisor in [9, 97, 123, 312, 998, 101, 45]:
    print(f"divisor {divisor}: → {recommend_method(divisor)}")

Expected output:

divisor 9: → Nikhilam (near base)
divisor 97: → Nikhilam (near base)
divisor 123: → Paravartya Yojayet (transpose)
divisor 312: → Standard division or Paravartya
divisor 998: → Nikhilam (near base)
divisor 101: → Nikhilam (near base)
divisor 45: → Standard division or Paravartya

FAQ

When should I use Nikhilam vs Paravartya for division?
Nikhilam when the divisor is near a power of 10 (deviation < 20% of base). Paravartya when the divisor’s first digit is 1. Use standard division for general cases.
How is Vedic division faster than long division?
Long division requires testing each digit of the quotient through multiplication and subtraction. Vedic methods convert this to addition of pre-computed products — eliminating the trial-and-error step.
Can I get decimal places with Vedic division?
Yes. After finding the quotient and remainder, append zeros to the remainder and continue the same process. The code example above shows how to get any number of decimal places.
What’s the flag method in Vedic division?
The flag method (Dhvajanka) is another Vedic division technique where the divisor’s digits are treated as “flags” — reducing the divisor to one effective digit. It’s useful for divisors with many digits.
Do these methods work for large numbers (10+ digits)?
Yes. Both Nikhilam and Paravartya scale to any digit length. The number of iterations equals the number of digit-groups, so a 15-digit ÷ 3-digit problem completes in 5 iterations.

Related Tutorials


Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro. Updated 2026-06-20.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro