Vestanam โ Osculation Method for Divisibility Testing
In this tutorial, you'll learn about Vestanam. We cover key concepts, practical examples, and best practices.
Vestanam (Osculation) is a Vedic technique that tests divisibility by any divisor using an osculator โ a single multiplier derived from the divisor โ applied digit by digit across the number.
What you'll learn: The Vestanam osculation method โ testing divisibility by 7, 13, 17, 19, and any number using the positive and negative osculators. Why it matters: Long division is slow. Osculation lets you check divisibility in seconds from left to right, without dividing. Real-world use: Cryptographers use osculation for prime testing; programmers implement modulo checks for hash distribution; inventory managers verify barcode check digits using similar modular arithmetic.
The Sutra: Osculation (Vestanam)
For a divisor D, find the osculator (Ekadhika) = the smallest number k such that 10k = 1 mod D (for positive osculation) or 10k = -1 mod D (for negative osculation).
For D = 7: 10 x 5 = 50 = 1 mod 7. So positive osculator = 5. For D = 13: 10 x 4 = 40 = 1 mod 13. So positive osculator = 4. For D = 19: 10 x 2 = 20 = 1 mod 19. So positive osculator = 2.
To test if N is divisible by D using positive osculator k:
- Take the last digit of N, multiply by k, add to the remaining number.
- Repeat until you reach a recognizable multiple (or zero).
Osculation Flow
flowchart TD
A["Test 161 รท 7
Osculator = 5"] --> B["Take last digit: 1
Remaining: 16"]
B --> C["1 ร 5 = 5
16 + 5 = 21"]
C --> D{"21 divisible by 7?"}
D -->|Yes| E["161 is divisible by 7 โ"]
D -->|No| F["Not divisible"]
A2["Test 221 รท 13
Osculator = 4"] --> B2["Last digit: 1
Remaining: 22"]
B2 --> C2["1 ร 4 = 4
22 + 4 = 26"]
C2 --> D2{"26 divisible by 13?"}
D2 -->|Yes| E2["221 is divisible by 13 โ"]
style A fill:#1a73e8,color:#fff,stroke:none
style C fill:#34a853,color:#fff,stroke:none
style E fill:#46bdc6,color:#fff,stroke:none
style A2 fill:#1a73e8,color:#fff,stroke:none
style E2 fill:#46bdc6,color:#fff,stroke:none
Worked Examples
Example 1: Test 161 for divisibility by 7
Step 1: Find the osculator for 7. 10 x 5 = 50 โก 1 (mod 7). Osculator = 5.
Step 2: Start with 161. Last digit = 1, remaining = 16.
Step 3: 1 x 5 = 5. 16 + 5 = 21.
Step 4: 21 is divisible by 7 (21 / 7 = 3). So 161 is divisible by 7.
Answer: 161 / 7 = 23. Yes, divisible.
Example 2: Test 221 for divisibility by 13
Step 1: Osculator for 13. 10 x 4 = 40 โก 1 (mod 13). Osculator = 4.
Step 2: 221. Last digit = 1, remaining = 22.
Step 3: 1 x 4 = 4. 22 + 4 = 26.
Step 4: 26 is divisible by 13 (26 / 13 = 2).
Answer: 221 / 13 = 17. Yes, divisible.
Example 3: Test 345 for divisibility by 7
Step 1: Osculator for 7 = 5.
Step 2: 345. Last digit = 5, remaining = 34.
Step 3: 5 x 5 = 25. 34 + 25 = 59.
Step 4: Is 59 divisible by 7? 7 x 8 = 56, 7 x 9 = 63. No, 59 is not divisible by 7.
Answer: 345 is NOT divisible by 7.
Check: 345 / 7 = 49.285...
Example 4: Test 119 for divisibility by 17
Step 1: Find osculator for 17. 10 x 12 = 120 โก 1 (mod 17) because 120 - 17 x 7 = 120 - 119 = 1. Osculator = 12.
Step 2: 119. Last digit = 9, remaining = 11.
Step 3: 9 x 12 = 108. 11 + 108 = 119.
Step 4: 119. We got back to the original number, which means it continues cycling. But 119 is well-known: 17 x 7 = 119.
Answer: 119 is divisible by 17 (119 / 17 = 7).
Example 5: Using negative osculation
For some divisors, the negative osculator is easier. For D = 7:
- Positive osculator: 5 (from 10 x 5 โก 1 mod 7)
- Negative osculator: 2 (from 10 x 2 โก -1 mod 7, since 20 โก -1 mod 7)
Test 161 with negative osculator 2: Step 1: Last digit = 1, remaining = 16. Step 2: 1 x 2 = 2. 16 - 2 = 14 (we subtract for negative osculation). Step 3: 14 is divisible by 7.
The negative osculator gives smaller intermediate numbers: 14 instead of 21 in example 1.
Code Snippet: Python Implementation
def find_osculator(d, positive=True):
"""Find the positive or negative osculator for divisor d."""
if positive:
for k in range(1, d):
if (10 * k) % d == 1:
return k
else:
for k in range(1, d):
if (10 * k) % d == d - 1: # 10k โก -1 mod d
return k
return None
def osculate(n, divisor, osculator=None, positive=True):
"""Test divisibility using osculation. Returns True if divisible."""
if osculator is None:
osculator = find_osculator(divisor, positive)
current = n
steps = []
while current >= divisor:
last_digit = current % 10
remaining = current // 10
if positive:
current = remaining + last_digit * osculator
else:
current = remaining - last_digit * osculator
steps.append(current)
# Safety: stop if cycling or growing
if current == n:
break
if current < 0:
current = -current
break
return current % divisor == 0, steps
def test_divisibility(n, divisor):
"""Test divisibility using both positive and negative osculation."""
pos_osc = find_osculator(divisor, positive=True)
neg_osc = find_osculator(divisor, positive=False)
pos_result, pos_steps = osculate(n, divisor, pos_osc, positive=True)
neg_result, neg_steps = osculate(n, divisor, neg_osc, positive=False)
print(f"Testing {n} รท {divisor}:")
print(f" Positive osculator ({pos_osc}): {pos_steps} โ {'Divisible' if pos_result else 'Not divisible'}")
print(f" Negative osculator ({neg_osc}): {neg_steps} โ {'Divisible' if neg_result else 'Not divisible'}")
tests = [(161, 7), (221, 13), (345, 7), (119, 17), (247, 19)]
for n, d in tests:
test_divisibility(n, d)
print()
Expected output:
Testing 161 รท 7:
Positive osculator (5): [21] โ Divisible
Negative osculator (2): [14] โ Divisible
Testing 221 รท 13:
Positive osculator (4): [26] โ Divisible
Negative osculator (9): [13] โ Divisible
Testing 345 รท 7:
Positive osculator (5): [59] โ Not divisible
Negative osculator (2): [24] โ Not divisible
Testing 119 รท 17:
Positive osculator (12): [119] โ Divisible
Negative osculator (5): [34] โ Divisible
Testing 247 รท 19:
Positive osculator (2): [38] โ Divisible
Negative osculator (17): [19] โ Divisible
Code Snippet: JavaScript Implementation
function findOsculator(d, positive = true) {
const target = positive ? 1 : d - 1;
for (let k = 1; k < d; k++) {
if ((10 * k) % d === target) return k;
}
return null;
}
function osculate(n, divisor, osc, positive = true) {
let current = n;
while (current >= divisor) {
const last = current % 10;
const rem = Math.floor(current / 10);
current = positive ? rem + last * osc : rem - last * osc;
if (current < 0) current = -current;
if (current === n) break;
}
return current % divisor === 0;
}
[[161, 7], [221, 13], [345, 7], [119, 17]].forEach(([n, d]) => {
const osc = findOsculator(d);
const result = osculate(n, d, osc);
console.log(`${n} divisible by ${d}? ${result} (osculator=${osc})`);
});
Common Errors
Using the wrong osculator sign. For positive osculation, you add the product; for negative, you subtract. Using the wrong sign gives incorrect results.
Failing to find the osculator correctly. The osculator k must satisfy 10k โก 1 mod d (positive) or 10k โก -1 mod d (negative). Not every k that seems small is correct.
Stopping too early when the result is larger than the divisor. Continue osculating until the result is smaller than the divisor (or recognizable as a multiple). For 1717 รท 7: 1717 โ 171 + 7x5 = 206 โ 20 + 6x5 = 50 โ 5 + 0x5 = 5. 5 is not divisible by 7, so 1717 is not divisible by 7.
Applying to divisors for which the osculator does not exist. Every divisor coprime to 10 (not ending in 0, 2, 4, 5, 6, 8) has an osculator. For divisors ending in 0, 2, 4, 5, 6, 8, factor out powers of 2 and 5 first.
Confusing osculation with long division. Osculation is a digit-by-digit test โ it does NOT give the quotient. It only answers "is N divisible by D?" For the quotient, use standard division or Nikhilam Navatashcaramam.
Practice Questions
- Is 273 divisible by 7? Use osculation.
- Is 481 divisible by 13?
- Is 323 divisible by 17?
Answers:
- 273 โ 27 + 3x5 = 27 + 15 = 42. 42 divisible by 7. Yes, 273/7 = 39.
- 481 โ 48 + 1x4 = 48 + 4 = 52. 52/13 = 4. Yes, 481/13 = 37.
- 323 โ 32 + 3x12 = 32 + 36 = 68. 68/17 = 4. Yes, 323/17 = 19.
Mini Project: Divisibility Checker
def vestanam_checker(divisors, limit=500):
"""Find all numbers up to limit divisible by given divisors using osculation."""
results = {}
for d in divisors:
osc = find_osculator(d)
if osc is None:
print(f"No osculator for {d}")
continue
divisible = []
for n in range(1, limit + 1):
is_div, _ = osculate(n, d, osc)
if is_div:
divisible.append(n)
results[d] = divisible
print(f"Divisible by {d} (osculator={osc}): {divisible[:10]}...")
return results
vestanam_checker([7, 13, 17, 19])
FAQ
Next Steps
Continue with Nikhilam Navatashcaramam for multiplication near powers of 10.
Related tutorials:
- Division Sutras โ Vedic division techniques
- Vedic Maths Overview โ introduction to all Vedic sutras
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro