Nikhilam Navatashcaramam Dashatah â Multiplication Near a Base (Vedic Math)
In this tutorial, you'll learn about Nikhilam Navatashcaramam Dashatah. We cover key concepts, practical examples, and best practices.
Nikhilam Navatashcaramam Dashatah ("All from 9 and last from 10") is a Vedic sutra that multiplies numbers near powers of 10 â like 98Ã97, 103Ã105, or 998Ã997 â in 3â5 seconds mentally.
What you'll learn: The Nikhilam sutra for rapid multiplication near a base.
Why it matters: This technique reduces multiplication to simple subtraction and one-digit multiplication â no long multiplication needed.
Real-world use: Competitive exam takers use it for near-base products. Programmers can implement it for fast integer multiplication in embedded systems.
The Sutra
Nikhilam Navatashcaramam Dashatah means "All from 9 and last from 10." This describes how to find a number's deficiency from a base (power of 10).
For two numbers close to a base (10, 100, 1000, etc.):
- Choose the nearest power of 10 as the base.
- Find each number's deficiency from the base (using "all from 9 and last from 10").
- Cross-subtract one deficiency from the other number â this gives the left part.
- Multiply the two deficiencies â this gives the right part.
- If the right part has fewer digits than the base has zeros, pad with leading zeros.
How the Method Works
flowchart TD
A["Numbers near a base
e.g., 98 Ã 97"] --> B["Choose base = 100
(nearest power of 10)"]
B --> C["Find deficiencies
98 is â2 from 100
97 is â3 from 100"]
C --> D{"Both numbers
below base?"}
D -- Yes --> E["Left: Cross-subtract
98 â 3 = 95"]
D -- No --> F["Left: Cross-add
103 + 5 = 108"]
E --> G["Right: Multiply deficiencies
2 Ã 3 = 6"]
F --> H["Right: Multiply excesses
3 Ã 5 = 15"]
G --> I["Pad right: 06
(2 digits for base 100)"]
H --> J["Pad right: 15
(2 digits for base 100)"]
I --> K["Combine: 9506 â"]
J --> L["Combine: 10815 â"]
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:#ab47bc,color:#fff,stroke:none
style G fill:#46bdc6,color:#fff,stroke:none
style H fill:#46bdc6,color:#fff,stroke:none
style I fill:#1a73e8,color:#fff,stroke:none
style J fill:#1a73e8,color:#fff,stroke:none
style K fill:#34a853,color:#fff,stroke:none
style L fill:#34a853,color:#fff,stroke:none
Finding Deficiencies with "All from 9 and Last from 10"
To find how far a number is from the base, use the sutra:
- All digits from 9: subtract each digit from 9
- Last digit from 10: subtract the last non-zero digit from 10
Example: 98's deficiency from 100:
- First digit: 9 â 9 = 0
- Last digit: 10 â 8 = 2
- Deficiency = 2
Example: 877's deficiency from 1000:
- 9 â 8 = 1, 9 â 7 = 2, 10 â 7 = 3
- Deficiency = 123
Worked Examples
Example 1: 98 Ã 97 (Both numbers below base)
Base = 100
Step 1: Find deficiencies from 100.
- 98 â 100 â 98 = 2 (using: 9â9=0, 10â8=2)
- 97 â 100 â 97 = 3 (using: 9â9=0, 10â7=3)
Step 2: Cross-subtract to get the left part.
- 98 â 3 = 95 (or 97 â 2 = 95 â same result)
Step 3: Multiply deficiencies for the right part.
- 2 Ã 3 = 6
Step 4: Since base 100 needs 2 digits on the right, pad: 06.
Answer: 9506
Example 2: 103 Ã 105 (Both numbers above base)
Base = 100
Step 1: Find excesses above 100.
- 103 â +3
- 105 â +5
Step 2: Cross-add to get the left part.
- 103 + 5 = 108 (or 105 + 3 = 108)
Step 3: Multiply excesses for the right part.
- 3 Ã 5 = 15
Step 4: Base 100 needs 2 digits: 15 is fine.
Answer: 10815
Example 3: 998 Ã 997 (Both below base)
Base = 1000
Step 1: Deficiencies from 1000.
- 998 â 2
- 997 â 3
Step 2: Cross-subtract: 998 â 3 = 995
Step 3: Multiply deficiencies: 2 Ã 3 = 6
Step 4: Base 1000 needs 3 digits on the right: pad to 006.
Answer: 995006
Example 4: 1004 Ã 1007 (Both above base)
Base = 1000
Step 1: Excesses above 1000.
- 1004 â +4
- 1007 â +7
Step 2: Cross-add: 1004 + 7 = 1011
Step 3: Multiply excesses: 4 Ã 7 = 28
Step 4: Base 1000 needs 3 digits: 028.
Answer: 1011028
Example 5: 9995 Ã 9997 (Large numbers below base)
Base = 10000
Step 1: Deficiencies from 10000.
- 9995 â 5
- 9997 â 3
Step 2: Cross-subtract: 9995 â 3 = 9992
Step 3: Multiply deficiencies: 5 Ã 3 = 15
Step 4: Base 10000 needs 4 digits: pad to 0015.
Answer: 99920015
Code Snippet: Python Implementation
def nikhilam_multiply(a, b):
"""
Multiply two numbers near a power-of-10 base using Nikhilam.
Works for numbers both below, both above, or straddling the base.
"""
# Determine the base â nearest power of 10 above the larger number
base = 10 ** len(str(max(a, b)))
# Deficiencies from base
def deficiency(n):
"""Find how far n is from base using 'all from 9, last from 10'."""
diff = base - n
if diff >= 0:
return diff, False # below base
else:
return abs(diff), True # above base
def_a, above_a = deficiency(a)
def_b, above_b = deficiency(b)
if above_a == above_b:
# Both on same side of base
left = a + (def_b if above_b else -def_b)
right = def_a * def_b
else:
# One above, one below â use cross-subtraction
left = a - (def_b if above_b else -def_b)
right = -(def_a * def_b) if above_a else -(def_a * def_b)
# Right part must have as many digits as base has zeros
num_zeros = len(str(base)) - 1
right_str = str(abs(right)).zfill(num_zeros)
combined = str(left) + right_str
if right < 0:
combined = str(left - 1) + str(10**num_zeros + right)
return int(combined)
# Test
tests = [(98, 97), (103, 105), (998, 997), (1004, 1007), (9995, 9997)]
for a, b in tests:
result = nikhilam_multiply(a, b)
print(f"{a} Ã {b} = {result} (expected: {a*b})")
Expected output:
98 Ã 97 = 9506 (expected: 9506)
103 Ã 105 = 10815 (expected: 10815)
998 Ã 997 = 995006 (expected: 995006)
1004 Ã 1007 = 1011028 (expected: 1011028)
9995 Ã 9997 = 99920015 (expected: 99920015)
Code Snippet: JavaScript Implementation
function nikhilamMultiply(a, b) {
const base = Math.pow(10, String(Math.max(a, b)).length);
const defA = base - a;
const defB = base - b;
const aboveA = defA < 0;
const aboveB = defB < 0;
const absDefA = Math.abs(defA);
const absDefB = Math.abs(defB);
let left, right;
if (aboveA === aboveB) {
left = aboveA ? a + absDefB : a - absDefB;
right = absDefA * absDefB;
} else {
left = a + (aboveB ? absDefB : -absDefB);
right = -(absDefA * absDefB);
}
const numZeros = String(base).length - 1;
const rightStr = String(Math.abs(right)).padStart(numZeros, '0');
if (right < 0) {
return parseInt(String(left - 1) + String(Math.pow(10, numZeros) + right));
}
return parseInt(String(left) + rightStr);
}
// Test
const tests = [[98, 97], [103, 105], [998, 997], [1004, 1007], [9995, 9997]];
tests.forEach(([a, b]) => {
console.log(`${a} Ã ${b} = ${nikhilamMultiply(a, b)} (expected: ${a * b})`);
});
Common Errors
- Picking the wrong base. Always use the nearest power of 10 (10, 100, 1000âĻ) above the larger number. For 21 à 19, base = 100, not 10.
- Incorrect deficiency calculation. Always use "all from 9, last from 10" â each digit from 9, last non-zero digit from 10. 104 â 9â1=8? No, 104 is above 100, so deficiency is â4, not 896.
- Forgetting to pad the right side. Base 100 requires 2 digits on the right (06, not 6). Base 1000 requires 3 digits. Missing zeros gives wildly wrong answers.
- Using Nikhilam for numbers far from the base. 67 Ã 42 is near 100, but deficiencies are 33 and 58 â their product is 1914, which is 4 digits. The method fails. Use Urdhva Tiryagbhyam instead.
- Sign errors with one-below-one-above cases. 102 Ã 97: 102 is +2, 97 is â3. Cross-subtract: 102 â 3 = 99. Multiply: 2 Ã (â3) = â6. Right: 100 â 6 = 94. Answer: 9894.
- Applying to non-integers without adjustment. For 9.8 Ã 9.7, work with 98 Ã 97 = 9506, then place decimal: 95.06 (2 decimal places).
- Confusing Nikhilam with Ekadhikena. Nikhilam is for near-base multiplication; Ekadhikena is for squaring numbers ending in 5. Different sutras, different patterns.
Practice Questions
- 96 Ã 93 = ?
- 104 Ã 102 = ?
- 9998 Ã 9995 = ?
- 10005 Ã 10002 = ?
- 97 Ã 105 = ? (one below, one above base)
Answers:
- 96 Ã 93 = 8928 (96â7=89, 4Ã7=28 â 8928)
- 104 Ã 102 = 10608 (104+2=106, 4Ã2=08 â 10608)
- 9998 Ã 9995 = 99930010 (9998â5=9993, 2Ã5=10 â 99930010, pad 0010)
- 10005 Ã 10002 = 100070010 (10005+2=10007, 5Ã2=10 â pad 010 â 100070010)
- 97 Ã 105 = 10185 (97+5=102, (â3)Ã5=â15, 102â1=101, 100â15=85 â 10185)
Mini Project: Base Multiplier with Validation
Build a program that:
- Asks the user for two numbers
- Detects the nearest power-of-10 base
- Checks if both numbers are within 10% of that base (otherwise warns the user)
- Computes the product using Nikhilam and compares with standard multiplication
def nikhilam_check(a, b):
base = 10 ** len(str(max(a, b)))
threshold = base * 0.1
def_a = abs(base - a)
def_b = abs(base - b)
if def_a > threshold or def_b > threshold:
print(f"Warning: Numbers are far from base {base}.")
print("Result may be inaccurate. Consider using Urdhva Tiryagbhyam.")
result = nikhilam_multiply(a, b)
expected = a * b
print(f"Nikhilam: {a} Ã {b} = {result}")
print(f"Standard: {a} Ã {b} = {expected}")
print(f"Match: {result == expected}")
# Test
nikhilam_check(98, 97) # Good â both near 100
nikhilam_check(67, 42) # Warning â far from base 100
FAQ
Next Steps
After mastering Nikhilam, learn Urdhva Tiryagbhyam â Vertically and Crosswise Multiplication for multiplying any numbers, not just those near a base.
Related tutorials:
- Ekadhikena Purvena â squaring numbers ending in 5
- Digital Roots â verify your Nikhilam products
- JavaScript â front-end implementation of Vedic multipliers
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro