Ekadhikena Purvena — Squaring Numbers Ending in 5 (Vedic Math)
Ekadhikena Purvena (“By one more than the previous one”) is a Vedic sutra that lets you square any number ending in 5 in under 2 seconds — mentally, without a calculator.
Why it matters: Squaring numbers appears in area calculations, statistics, physics, and competitive exams. Doing it mentally saves 10–20 seconds per problem.
Real-world use: CAT, GMAT, and banking exam aspirants use this daily. Programmers can implement it as a fast integer square function.
The Sutra
Ekadhikena Purvena translates to “By one more than the previous one.”
For a number ending in 5 (like 35, 85, 125, or 1005):
- Take the digit(s) before the final 5 — call this the previous part.
- Add 1 to it — this is ekadhikena (one more).
- Multiply the previous part by this result.
- Append 25 to the product.
That’s the square.
How the Method Works
flowchart TD
A["Number ending in 5<br/>e.g., 85"] --> B["Split: remove last 5<br/>Previous part = 8"]
B --> C["Add 1: 8 + 1 = 9<br/>(Ekadhikena — one more)"]
C --> D["Multiply: 8 × 9 = 72"]
D --> E["Append 25: 7225"]
E --> F["85² = 7225 ✓"]
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:#1a73e8,color:#fff,stroke:none
Worked Examples
Example 1: 35²
Step 1: Identify the previous part — the digits before the last 5.
- Number: 35 → Previous part = 3
Step 2: One more than the previous: 3 + 1 = 4
Step 3: Multiply: 3 × 4 = 12
Step 4: Append 25 → 1225
Answer: 35² = 1225
Example 2: 85²
Step 1: Previous part = 8
Step 2: One more: 8 + 1 = 9
Step 3: Multiply: 8 × 9 = 72
Step 4: Append 25 → 7225
Answer: 85² = 7225
Example 3: 125²
Step 1: Previous part = 12 (the digits before the 5)
Step 2: One more: 12 + 1 = 13
Step 3: Multiply: 12 × 13 = 156
Step 4: Append 25 → 15625
Answer: 125² = 15625
Example 4: 1005²
Step 1: Previous part = 100
Step 2: One more: 100 + 1 = 101
Step 3: Multiply: 100 × 101 = 10100
Step 4: Append 25 → 1010025
Answer: 1005² = 1,010,025
Example 5: 9995²
Step 1: Previous part = 999
Step 2: One more: 999 + 1 = 1000
Step 3: Multiply: 999 × 1000 = 999000
Step 4: Append 25 → 99900025
Answer: 9995² = 99,900,025
Example 6: 3.5² (Decimal Extension)
The sutra works for decimals too if the last digit of the whole part is 5:
3.5² = ?
Treat 35² = 1225, then place decimal: 12.25.
Alternatively: 3.5 × 3.5 = 3 × 4 + 0.25 = 12.25.
Why Does This Work? — Algebraic Proof
Let a number ending in 5 be written as (10n + 5):
[ (10n + 5)^2 = 100n^2 + 100n + 25 = 100n(n + 1) + 25 ]
(n(n+1)) is “previous part × (previous part + 1)”, and multiplying by 100 shifts it two places before appending 25. The sutra is algebraically exact.
Code Snippet: Python Implementation
Here’s a Python function that squares any number ending in 5 using Ekadhikena Purvena:
def ekadhikena_square(n):
"""
Square a number ending in 5 using Ekadhikena Purvena.
Works for integers and floats.
"""
# Handle floats like 3.5
if isinstance(n, float):
str_n = str(n)
# Count decimal places
decimal_places = len(str_n.split('.')[1])
integer_part = str_n.replace('.', '')
# Square using sutra, then adjust decimal
result = ekadhikena_square(int(integer_part))
return result / (10 ** (2 * decimal_places))
# Integer path
str_n = str(n)
if str_n[-1] != '5':
raise ValueError("Number must end with 5")
previous = int(str_n[:-1]) # digits before the 5
one_more = previous + 1 # Ekadhikena
product = previous * one_more
return int(f"{product}25")
# Test cases
tests = [15, 25, 35, 85, 125, 1005, 9995]
for t in tests:
result = ekadhikena_square(t)
print(f"{t}² = {result}")
print(f"3.5² = {ekadhikena_square(3.5)}")Expected output:
15² = 225
25² = 625
35² = 1225
85² = 7225
125² = 15625
1005² = 1010025
9995² = 99900025
3.5² = 12.25Code Snippet: JavaScript Implementation
function ekadhikenaSquare(n) {
// Handle floats
if (!Number.isInteger(n)) {
const str = n.toString();
const decimalPlaces = str.split('.')[1].length;
const integerPart = parseInt(str.replace('.', ''));
const result = ekadhikenaSquare(integerPart);
return result / Math.pow(10, 2 * decimalPlaces);
}
const str = n.toString();
if (str[str.length - 1] !== '5') {
throw new Error("Number must end with 5");
}
const previous = parseInt(str.slice(0, -1));
const oneMore = previous + 1;
const product = previous * oneMore;
return parseInt(product.toString() + '25');
}
// Test
[15, 25, 35, 85, 125, 1005, 9995, 3.5].forEach(n => {
console.log(`${n}² = ${ekadhikenaSquare(n)}`);
});Expected output:
15² = 225
25² = 625
35² = 1225
85² = 7225
125² = 15625
1005² = 1010025
9995² = 99900025
3.5² = 12.25Common Errors
- Including the 5 in the previous part. For 85, the previous part is 8, not 85. Only digits before the final 5.
- Forgetting to append 25. The sutra always ends with 25 appended. Some beginners add 25 erroneously.
- Using it on numbers not ending in 5. Ekadhikena Purvena only applies when the last digit is 5. For 36², use Urdhva Tiryagbhyam instead.
- Mis-handling carries in multiplication. When the previous part × (previous+1) is large, carry properly. For 995², previous=99, 99×100=9900, append 25 → 990025.
- Applying to negative numbers without sign handling. The sutra works for negatives too: (-35)² = 1225, but the sign becomes positive regardless.
- Decimal errors. For 3.5², beginners err by writing 1225 or 122.5 instead of 12.25. Count decimal places carefully.
- Zero-prefix confusion. 5² = 25. Previous part of 5 is 0 (not empty). 0 × 1 = 0, append 25 → 025 → 25. Correct.
Practice Questions
- 65² = ?
- 195² = ?
- 5005² = ?
- 99995² = ?
- 4.5² = ?
Answers:
- 65² = 4225 (6 × 7 = 42, append 25)
- 195² = 38025 (19 × 20 = 380, append 25)
- 5005² = 25,050,025 (500 × 501 = 250500, append 25)
- 99995² = 9,999,000,025 (9999 × 10000 = 99990000, append 25)
- 4.5² = 20.25 (45² = 2025, two decimal places → 20.25)
Mini Project: Interactive Squaring Calculator
Write a program that continuously accepts numbers from the user and squares any number ending in 5 using Ekadhikena Purvena, rejecting others with a helpful error:
def interactive_squarer():
while True:
inp = input("Enter a number ending in 5 (or 'q' to quit): ")
if inp.lower() == 'q':
break
try:
n = int(inp)
print(f"{n}² = {ekadhikena_square(n)}")
except ValueError:
print("Invalid input. Enter an integer ending in 5.")
if __name__ == "__main__":
interactive_squarer()Try it: Enter 125 → outputs 15625. Enter 33 → outputs error message.
Extend this to generate a practice quiz with random numbers ending in 5, timing each answer.
FAQ
Next Steps
Now that you’ve mastered squaring numbers ending in 5, move on to Nikhilam — Multiplication Near a Base to multiply numbers close to 100, 1000, etc. in seconds.
Related tutorials:
- Urdhva Tiryagbhyam — general multiplication for any number
- Digital Roots — verify your squares with casting out nines
- Python — build more math utilities
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro