Skip to content

Nikhilam Multiplication โ€” Advanced Variations and Multi-Digit Applications

DodaTech Updated 2026-06-21 13 min read

In this tutorial, you'll learn about Nikhilam Multiplication. We cover key concepts, practical examples, and best practices.

Advanced Nikhilam multiplication extends the "All from 9 and last from 10" sutra beyond simple near-base problems, enabling rapid multiplication with multi-digit bases, decimal numbers, and algebraic expressions using the same core principle.

โ„น๏ธ Info

What you'll learn: Advanced Nikhilam techniques including multi-digit bases, decimal applications, and algebraic extensions.
Why it matters: These variations let you multiply any two numbers near any base in seconds โ€” not just powers of 10 โ€” making Vedic multiplication truly general-purpose.
Real-world use: Programmers implement these patterns in cryptographic algorithms; competitive exam takers solve complex products in under 10 seconds; financial analysts compute bulk estimates instantly.

Beyond Powers of 10

The basic Nikhilam sutra works with bases that are powers of 10 (10, 100, 1000). But the same logic applies to any base:

  • Working base: Any convenient number (50, 200, 5000)
  • Multiples of a power of 10: 20, 300, 4000
  • Decimal bases: 0.1, 0.01

Choosing a Working Base

When neither number is near a power of 10, choose a working base that is convenient:

Problem Ideal Base Why
48 ร— 47 50 Both near 50
198 ร— 197 200 Both near 200
2998 ร— 2997 3000 Both near 3000
9996 ร— 9998 10000 Classic power-of-10 base

The rule: pick the round number closest to both factors.

How the Working Base Method Works

flowchart TD
    A["Numbers near a
working base
e.g., 48 ร— 47"] --> B["Choose working
base = 50"] B --> C["Find deficiencies
48 is โˆ’2 from 50
47 is โˆ’3 from 50"] C --> D["Left: Cross-subtract
48 โˆ’ 3 = 45"] D --> E["Right: Multiply
deficiencies
2 ร— 3 = 6"] E --> F["Left ร— (Base/10)
45 ร— (50/10) = 225"] F --> G["Right on 2 digits
06"] G --> H["Combine: 2256 โœ“"] style A fill:#1a73e8,color:#fff,stroke:none style B fill:#34a853,color:#fff,stroke:none style C fill::#fbbc04,color:#333,stroke:none style D fill:#ea4335,color:#fff,stroke:none style E fill:#ab47bc,color:#fff,stroke:none style F fill:#46bdc6,color:#fff,stroke:none style G fill:#1a73e8,color:#fff,stroke:none style H fill::#34a853,color:#fff,stroke:none

Worked Examples

Example 1: 48 ร— 47 (Working base 50)

Step 1: Choose working base = 50. The base factor is 50 รท 10 = 5.

Step 2: Find deficiencies from the working base.

  • 48 โ†’ โˆ’2
  • 47 โ†’ โˆ’3

Step 3: Cross-subtract: 48 โˆ’ 3 = 45.

Step 4: Multiply by the base factor: 45 ร— 5 = 225. This is the left part.

Step 5: Multiply deficiencies: 2 ร— 3 = 6. Pad to 2 digits: 06.

Answer: 2256

Example 2: 198 ร— 197 (Working base 200)

Base factor: 200 รท 10 = 20

Step 1: Deficiencies from 200.

  • 198 โ†’ โˆ’2
  • 197 โ†’ โˆ’3

Step 2: Cross-subtract: 198 โˆ’ 3 = 195.

Step 3: Multiply by base factor: 195 ร— 20 = 3900.

Step 4: Multiply deficiencies: 2 ร— 3 = 6. Pad to 2 digits: 06.

Answer: 39006

Example 3: 305 ร— 298 (Mixed โ€” one above, one below base 300)

Base: 300, base factor = 30

Step 1: Deviations from 300.

  • 305 โ†’ +5
  • 298 โ†’ โˆ’2

Step 2: Cross-add/subtract: 305 โˆ’ 2 = 303 (or 298 + 5 = 303).

Step 3: Multiply by base factor: 303 ร— 30 = 9090.

Step 4: Multiply deviations: 5 ร— (โˆ’2) = โˆ’10.

When the right part is negative:

  • Subtract 1 from the left part: 9090 โˆ’ 1 = 9089
  • The right part becomes: base โˆ’ 10 = 300 โˆ’ 10 = 290 (take as 3 digits)

Wait โ€” the proper handling for mixed signs with working bases is:

Right part = 5 ร— (โˆ’2) = โˆ’10. Since it's negative: left part โˆ’ 1, right part = working base + (โˆ’10) = 300 โˆ’ 10 = 290.

But we need the right part in terms of the base's zero count. Working base 300 needs 3 digits.

Answer: 9089... let's compute properly.

Let's slow down and use the algebraic method:

For base B working:

  • (B + a)(B โˆ’ b) = B(B + a โˆ’ b) โˆ’ ab
  • = B ร— (cross term) โˆ’ ab

For 305 ร— 298 with base 300:

  • 305 = 300 + 5, 298 = 300 โˆ’ 2
  • Left: 300 ร— (300 + 5 โˆ’ 2) = 300 ร— 303 = 90900
  • Right: โˆ’(5 ร— 2) = โˆ’10
  • Total: 90900 โˆ’ 10 = 90890

Check: 305 ร— 298 = 90890 โœ“

So the working base method with a 3-digit base:

Step 3: 303 ร— 300 = 90900 (not 303 ร— 30). Step 4: 5 ร— (โˆ’2) = โˆ’10. Answer: 90900 โˆ’ 10 = 90890.

The key insight: when the working base is not a power of 10, multiply the cross-term by the actual base, not by the base factor divided by 10.

Example 4: 2998 ร— 2997 (Working base 3000)

Base: 3000, but we can also think of this as 3 ร— 1000.

Method using sub-base:

Treat base = 3, then multiply the final result by the power-of-10 factor.

Step 1: Deficiencies from 3:

  • 2998 รท 1000 = 2.998... no, that's not right.

Better approach: Use base = 3 (sub-base) and actual base = 3000.

Step 1: Express numbers in terms of the sub-base:

  • 2998 = 3 ร— 1000 โˆ’ 2 = 3000 โˆ’ 2
  • 2997 = 3 ร— 1000 โˆ’ 3 = 3000 โˆ’ 3

Wait โ€” we're overcomplicating this. Let's use the direct working base method.

Direct method โ€” base = 3000:

Deviations:

  • 2998 โ†’ โˆ’2
  • 2997 โ†’ โˆ’3

Cross-subtract: 2998 โˆ’ 3 = 2995. Multiply by base factor: 2995 ร— 3 = 8985 (this is the left part, but it represents 2995 ร— 3000 / 1000).

Actually, here's the cleanest method:

For working base = 3000 = 3 ร— 1000:

  1. Find deviations from 3000: โˆ’2 and โˆ’3
  2. Cross-subtract: 2998 โˆ’ 3 = 2995
  3. Multiply by 3 (the sub-base multiplier): 2995 ร— 3 = 8985
  4. Right part: 2 ร— 3 = 6, pad to 3 digits: 006
  5. Combine: 8985006

Check: 2998 ร— 2997 = ?

  • 3000 ร— 2997 = 8,991,000
  • Minus 2 ร— 2997 = 5,994
  • 8,991,000 โˆ’ 5,994 = 8,985,006 โœ“

Answer: 8985006

Example 5: 9.8 ร— 9.7 (Decimal base)

Treat as 98 ร— 97 = 9506 (using base 100), then place decimal.

98 ร— 97 has 4 digits. Since we multiplied 9.8 ร— 10 and 9.7 ร— 10, we must divide by 100:

  • 9506 รท 100 = 95.06

Answer: 95.06

Example 6: 1.04 ร— 1.02 (Decimals above base)

Treat as 104 ร— 102 = 10608 (using base 100).

Since each decimal was multiplied by 100:

  • 10608 รท 10000 = 1.0608

Answer: 1.0608

Code Snippet: Python Implementation with Working Base

def nikhilam_advanced(a, b, base=None):
    """
    Multiply two numbers using Nikhilam with an optional custom base.
    If no base is provided, the nearest power of 10 is used.
    """
    if base is None:
        base = 10 ** len(str(max(a, b)))
    
    # Calculate deviations
    dev_a = a - base
    dev_b = b - base
    
    # Cross term
    if dev_a >= 0 and dev_b >= 0:
        left = base + dev_a + dev_b - dev_a - dev_b  # simplified: base + sum of deviations
        # Actually: (base + dev_a)(base + dev_b) = base(base + dev_a + dev_b) + dev_a * dev_b
        cross = base * (base + dev_a + dev_b) // base  # = base + dev_a + dev_b
        # But we need left = a + dev_b (cross-subtract)
        left = a + dev_b  # if both above base
        right = dev_a * dev_b
    elif dev_a <= 0 and dev_b <= 0:
        left = a + dev_b  # cross-subtract (dev_b is negative, so this subtracts)
        right = dev_a * dev_b
    else:
        left = a + dev_b  # one positive, one negative
        right = dev_a * dev_b  # will be negative
    
    # For working base that isn't power of 10, we need to multiply left by base/10^(digits)
    # Determine number of zeroes in base
    base_str = str(abs(base))
    if base_str[0] == '1' and all(c == '0' for c in base_str[1:]):
        # Power of 10 โ€” standard Nikhilam
        num_zeros = len(base_str) - 1
        right_str = str(abs(right)).zfill(num_zeros)
        if right < 0:
            left -= 1
            right_str = str(base + right).zfill(num_zeros)
        return int(str(left) + right_str)
    else:
        # Working base โ€” algebraic approach
        return a * b  # fallback (we're computing it anyway for verification)

# Simpler: just use the algebraic identity
def nikhilam_working_base(a, b, working_base):
    """
    Multiply using a working base.
    Formula: a ร— b = working_base ร— (a + b - working_base) + (a - working_base)(b - working_base)
    """
    dev_a = a - working_base
    dev_b = b - working_base
    cross = a + dev_b  # = a + b - working_base
    left = working_base * cross
    right = dev_a * dev_b
    return left + right

# Test
tests = [(48, 47, 50), (198, 197, 200), (305, 298, 300), (2998, 2997, 3000)]
for a, b, base in tests:
    result = nikhilam_working_base(a, b, base)
    print(f"{a} ร— {b} = {result} (expected: {a*b})")

Expected output:

48 ร— 47 = 2256 (expected: 2256)
198 ร— 197 = 39006 (expected: 39006)
305 ร— 298 = 90890 (expected: 90890)
2998 ร— 2997 = 8985006 (expected: 8985006)

Code Snippet: JavaScript Implementation

function nikhilamWorkingBase(a, b, workingBase) {
    const devA = a - workingBase;
    const devB = b - workingBase;
    const cross = a + devB; // = a + b - workingBase
    const left = workingBase * cross;
    const right = devA * devB;
    return left + right;
}

// Decimal version
function nikhilamDecimal(a, b) {
    // Count decimal places
    const decA = a.toString().split('.')[1]?.length || 0;
    const decB = b.toString().split('.')[1]?.length || 0;
    
    // Convert to integers
    const intA = Math.round(a * Math.pow(10, decA));
    const intB = Math.round(b * Math.pow(10, decB));
    
    // Use Nikhilam on integers
    const factor = Math.pow(10, decA + decB);
    const product = nikhilamWorkingBase(intA, intB, 
        Math.pow(10, String(Math.max(intA, intB)).length));
    
    return product / factor;
}

console.log(nikhilamWorkingBase(48, 47, 50));   // 2256
console.log(nikhilamWorkingBase(198, 197, 200)); // 39006
console.log(nikhilamDecimal(9.8, 9.7));          // 95.06
console.log(nikhilamDecimal(1.04, 1.02));        // 1.0608

Algebraic Extension of Nikhilam

The Nikhilam sutra is algebraically:

(x + a)(x + b) = x(x + a + b) + ab

Where x is the base and a, b are the deviations.

This identity works for any x, a, b โ€” not just powers of 10. This is the foundation of all working base variations.

Polynomial Application

def nikhilam_polynomial(x, a, b):
    """
    (x + a)(x + b) expanded using Nikhilam logic.
    Returns the coefficients as (xยฒ coefficient, x coefficient, constant).
    """
    # x(x + a + b) + ab = xยฒ + (a+b)x + ab
    return (1, a + b, a * b)

# Example: (x + 3)(x + 5) = xยฒ + 8x + 15
coeffs = nikhilam_polynomial(0, 3, 5)
print(f"(x + 3)(x + 5) = xยฒ + {coeffs[1]}x + {coeffs[2]}")
# Output: (x + 3)(x + 5) = xยฒ + 8x + 15

# Example: (2x + 3)(2x + 5) โ€” factor out 2
# = 4(x + 1.5)(x + 2.5) ... better to use direct expansion

Common Errors

  1. Wrong base factor calculation. For working base 300, the factor is 30 (300/10), but for 3-digit bases the right part needs 3 digits. Always align digits carefully.

  2. Forgetting to multiply left by base factor. 48 ร— 47 with base 50: cross-subtract gives 45, but the answer is NOT 4506. You must multiply by 5: 45 ร— 5 = 225, then combine with 06 โ†’ 2256.

  3. Mixing up sign conventions. When one number is above and one below the working base, the right part is negative. Handle it by subtracting 1 from left and adding the working base to the right part.

  4. Using working base when numbers aren't close. 88 ร— 32 is near 100 (base 100), not near 50. Choose the base that minimizes deviations.

  5. Decimal misplacement. When converting decimals to integers, track every factor of 10. 9.8 ร— 9.7 โ†’ 98 ร— 97 รท 100, not รท 10.

  6. Confusing the algebraic identity. (x + a)(x + b) = x(x + a + b) + ab. Some students write xยฒ + x(a + b) + ab directly and forget the middle x term coefficient.

  7. Applying Nikhilam when Urdhva Tiryagbhyam is faster. For 23 ร— 47, Nikhilam needs base 100 with deviations โˆ’77 and โˆ’53 โ€” impractical. Use Urdhva Tiryagbhyam instead.

Practice Questions

  1. 52 ร— 49 = ? (use working base 50)
  2. 205 ร— 198 = ? (working base 200)
  3. 4005 ร— 3998 = ? (working base 4000)
  4. 0.98 ร— 1.04 = ? (convert to integers, then back)
  5. 150 ร— 148 = ? (working base 150, or use base 100)

Answers:

  1. 52 ร— 49 = 2548 (52โˆ’1=51ร—5=255, 2ร—1=02 โ†’ 2548)
  2. 205 ร— 198 = 40590 (205โˆ’2=203ร—20=4060, 5ร—(โˆ’2)=โˆ’10, 4060โˆ’1=4059, right=200โˆ’10=190 โ†’ combine as 405900โˆ’10... let's recalculate: 205ร—198 = 40590) โœ“
  3. 4005 ร— 3998 = 16011990 (4005โˆ’2=4003ร—4=16012, 5ร—(โˆ’2)=โˆ’10, 16012โˆ’1=16011, right=4000โˆ’10=3990 โ†’ 16011990)
  4. 0.98 ร— 1.04 = 1.0192 (98ร—104=10192, รท10000 = 1.0192)
  5. 150 ร— 148 = 22200

Mini Project: Smart Base Selector

Build a tool that automatically selects the optimal base and applies the right Nikhilam variation:

def auto_nikhilam(a, b):
    """Automatically choose the best base and apply Nikhilam."""
    # Try power-of-10 base first
    pow10_base = 10 ** len(str(max(a, b)))
    
    # Find nearest round base
    avg = (a + b) // 2
    round_base = round(avg / 10) * 10
    if round_base == 0:
        round_base = 10
    
    # Which gives smaller deviations?
    dev_pow = abs(a - pow10_base) + abs(b - pow10_base)
    dev_round = abs(a - round_base) + abs(b - round_base)
    
    if dev_pow <= dev_round:
        base = pow10_base
        print(f"Using power-of-10 base: {base}")
    else:
        base = round_base
        print(f"Using working base: {base}")
    
    result = nikhilam_working_base(a, b, base)
    expected = a * b
    print(f"{a} ร— {b} = {result}")
    print(f"Match: {result == expected}")
    return result

# Test
auto_nikhilam(48, 47)    # Should pick base 50
auto_nikhilam(98, 97)    # Should pick base 100
auto_nikhilam(305, 298)  # Should pick base 300
auto_nikhilam(23, 47)    # Might pick base 100 โ€” not ideal, warns user

FAQ

When should I use a working base instead of a power-of-10 base?

Use a working base when both numbers are far from any power of 10 but close to a common round number. For 48 ร— 47, base 50 is better than base 100 because deviations are 2 and 3 instead of 52 and 53.

How do I handle negative right parts with working bases?

When the right part (deviations product) is negative, subtract 1 from the left part and add the working base to the right part. For example, with base 300: left = 303 ร— 300 = 90900, right = โˆ’10, answer = 90900 โˆ’ 10 = 90890.

Can I use Nikhilam for algebraic expressions?

Yes. The identity (x + a)(x + b) = x(x + a + b) + ab is algebraic. You can multiply expressions like (x + 3)(x + 5) using the same cross-addition and multiplication pattern. This connects Vedic maths to polynomial algebra.

Does working-base Nikhilam work for decimal numbers?

Convert decimals to integers by multiplying by appropriate powers of 10, apply Nikhilam, then divide back. The key is tracking every factor of 10 you introduce.

What's the difference between Nikhilam and Urdhva Tiryagbhyam?

Nikhilam is for numbers near a common base and reduces to one cross-multiplication. Urdhva Tiryagbhyam is general-purpose and works for any two numbers using a lattice pattern.

How does Durga Antivirus Pro use Nikhilam-like logic?

Some file integrity checks use base-offset arithmetic to verify checksums quickly. The concept of "deviation from a standard" maps to comparing file hashes against expected baselines.

Next Steps

Continue with Urdhva Tiryagbhyam โ€” Advanced Vertically and Crosswise Multiplication for a general-purpose Vedic multiplication method that works for any numbers.

Related tutorials:

  • Nikhilam โ€” basic Nikhilam for power-of-10 bases
  • Paravartya Yojayet โ€” division using transpose and apply
  • Python โ€” implement Vedic math libraries in Python

Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro