Harshad Number Calculator: Finally Understand Numbers That Give Joy
Let me tell you about the first time I heard the term "Harshad number." I was reading about Indian mathematics, and I learned that "Harshad" means "joy-giver" in Sanskrit. These are numbers that are divisible by the sum of their digits.
I thought, "That's a beautiful name for a mathematical property." Then I tested 18: 1 + 8 = 9, and 18 ÷ 9 = 2 exactly. Joy! Then I tested 19: 1 + 9 = 10, but 19 ÷ 10 = 1.9—not an integer. No joy.
In this guide, I'll walk you through everything you need to know about Harshad numbers (also called Niven numbers)—from single-digit numbers to the famous 1729.
Ready to find joy-giving numbers? Try our Harshad Number Calculator and discover which numbers bring mathematical happiness.
What Is a Harshad Number?
A Harshad number (or Niven number) is a positive integer that is divisible by the sum of its digits.
The Formula
For a number n with digit sum s(n):
n is Harshad if n ÷ s(n) is an integer
Simple Examples
| Number | Digits | Digit Sum | Division | Harshad? |
|---|---|---|---|---|
| 18 | 1, 8 | 9 | 18 ÷ 9 = 2 | ✓ |
| 21 | 2, 1 | 3 | 21 ÷ 3 = 7 | ✓ |
| 111 | 1,1,1 | 3 | 111 ÷ 3 = 37 | ✓ |
| 1729 | 1,7,2,9 | 19 | 1729 ÷ 19 = 91 | ✓ |
| 19 | 1, 9 | 10 | 19 ÷ 10 = 1.9 | ✗ |
| 23 | 2, 3 | 5 | 23 ÷ 5 = 4.6 | ✗ |
| 100 | 1,0,0 | 1 | 100 ÷ 1 = 100 | ✓ |
Why Are They Called "Harshad"?
The term comes from Sanskrit:
- harṣa (हर्ष) = joy, delight
- da (द) = giving
So "Harshad" literally means "joy-giver" — a beautiful name for numbers that bring mathematical satisfaction!
Alternative Names
| Name | Origin |
|---|---|
| Harshad number | Sanskrit (joy-giver) |
| Niven number | Named after Ivan M. Niven |
| Digit-sum divisible number | Descriptive name |
| Multidigital number | Less common |
Properties of Harshad Numbers
Property 1: All Single-Digit Numbers Are Harshad
1-9: digit sum equals the number, so n ÷ n = 1 always integer.
Property 2: All Base 10 Repdigits Are Harshad
Numbers like 111, 222, 333, 444...
- 111: sum=3, 111÷3=37 ✓
- 222: sum=6, 222÷6=37 ✓
- 333: sum=9, 333÷9=37 ✓
Property 3: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42...
The sequence of Harshad numbers continues infinitely.
Property 4: Consecutive Harshad Numbers
There are runs of consecutive Harshad numbers. The smallest run of 2 consecutive Harshad numbers starts at 1 (1, 2).
Run of 3: 1, 2, 3 Run of 4: 1, 2, 3, 4 Run of 20: 1-20 (all numbers 1-20 except 11, 13, 17, 19? Wait, let's check... Actually 1-10 are all Harshad, but 11 is not, so run breaks.)
The longest known run of consecutive Harshad numbers is 20: from 1, 2, 3, ... actually need to verify.
Property 5: Infinitely Many Harshad Numbers
There are infinitely many Harshad numbers in every base.
Famous Harshad Numbers
1729: The Hardy-Ramanujan Number
1729 is famous as the smallest number expressible as the sum of two cubes in two different ways:
- 1729 = 1³ + 12³ = 1 + 1728
- 1729 = 9³ + 10³ = 729 + 1000
But 1729 is also a Harshad number!
- Digits: 1 + 7 + 2 + 9 = 19
- 1729 ÷ 19 = 91 exactly ✓
1-10: All Harshad
Numbers 1 through 10 are all Harshad numbers.
100: Harshad
100: sum=1, 100÷1=100 ✓
1000: Harshad
1000: sum=1, 1000÷1=1000 ✓
111111: Repdigit Harshad
111111: sum=6, 111111÷6 = 18518.5? Wait, 111111 ÷ 6 = 18518.5, so not integer? Actually 111111 ÷ 3 = 37037 (since sum=6, divisible by 3, but need to check 6: 111111/6 = 18518.5). So repdigit length matters.
For 111 (3 digits): sum=3, 111÷3=37 ✓ For 1111 (4 digits): sum=4, 1111÷4=277.75 ✗
Harshad Numbers in Other Bases
A number can be Harshad in one base but not another.
Example: 10 in Base 10
- Digits: 1, 0 → sum=1
- 10 ÷ 1 = 10 ✓ (Harshad in base 10)
Example: 10 in Base 2 (binary 1010₂)
- Binary digits: 1,0,1,0 → sum=2
- 10₁₀ ÷ 2 = 5 ✓ (Also Harshad in base 2!)
Example: 21 in Base 10
- Digits: 2,1 → sum=3
- 21 ÷ 3 = 7 ✓
Step-by-Step Examples
Example 1: Check if 18 is Harshad
Step 1: Identify the digits
- 18 → digits: 1, 8
Step 2: Sum the digits
- 1 + 8 = 9
Step 3: Divide original number by digit sum
- 18 ÷ 9 = 2
Step 4: Check if result is integer
- 2 is an integer ✓
Result: 18 is a HARSHAD number!
Example 2: Check if 111 is Harshad
Step 1: Digits: 1, 1, 1
Step 2: Sum: 1 + 1 + 1 = 3
Step 3: Division: 111 ÷ 3 = 37
Step 4: 37 is integer ✓
Result: 111 is a HARSHAD number!
Example 3: Check if 1729 is Harshad
Step 1: Digits: 1, 7, 2, 9
Step 2: Sum: 1 + 7 + 2 + 9 = 19
Step 3: Division: 1729 ÷ 19 = 91
Step 4: 91 is integer ✓
Result: 1729 is a HARSHAD number!
Example 4: Check if 19 is Harshad
Step 1: Digits: 1, 9
Step 2: Sum: 1 + 9 = 10
Step 3: Division: 19 ÷ 10 = 1.9
Step 4: 1.9 is NOT an integer ✗
Result: 19 is NOT a Harshad number.
All Harshad Numbers Up to 100
| n | Digit Sum | n ÷ sum | Harshad? |
|---|---|---|---|
| 1 | 1 | 1 | ✓ |
| 2 | 2 | 1 | ✓ |
| 3 | 3 | 1 | ✓ |
| 4 | 4 | 1 | ✓ |
| 5 | 5 | 1 | ✓ |
| 6 | 6 | 1 | ✓ |
| 7 | 7 | 1 | ✓ |
| 8 | 8 | 1 | ✓ |
| 9 | 9 | 1 | ✓ |
| 10 | 1 | 10 | ✓ |
| 11 | 2 | 5.5 | ✗ |
| 12 | 3 | 4 | ✓ |
| 13 | 4 | 3.25 | ✗ |
| 14 | 5 | 2.8 | ✗ |
| 15 | 6 | 2.5 | ✗ |
| 16 | 7 | ~2.29 | ✗ |
| 17 | 8 | 2.125 | ✗ |
| 18 | 9 | 2 | ✓ |
| 19 | 10 | 1.9 | ✗ |
| 20 | 2 | 10 | ✓ |
| 21 | 3 | 7 | ✓ |
| 22 | 4 | 5.5 | ✗ |
| 23 | 5 | 4.6 | ✗ |
| 24 | 6 | 4 | ✓ |
| 25 | 7 | ~3.57 | ✗ |
| 26 | 8 | 3.25 | ✗ |
| 27 | 9 | 3 | ✓ |
| 28 | 10 | 2.8 | ✗ |
| 29 | 11 | ~2.64 | ✗ |
| 30 | 3 | 10 | ✓ |
| 31 | 4 | 7.75 | ✗ |
| 32 | 5 | 6.4 | ✗ |
| 33 | 6 | 5.5 | ✗ |
| 34 | 7 | ~4.86 | ✗ |
| 35 | 8 | 4.375 | ✗ |
| 36 | 9 | 4 | ✓ |
| 37 | 10 | 3.7 | ✗ |
| 38 | 11 | ~3.45 | ✗ |
| 39 | 12 | 3.25 | ✗ |
| 40 | 4 | 10 | ✓ |
| 41 | 5 | 8.2 | ✗ |
| 42 | 6 | 7 | ✓ |
| 43 | 7 | ~6.14 | ✗ |
| 44 | 8 | 5.5 | ✗ |
| 45 | 9 | 5 | ✓ |
| 46 | 10 | 4.6 | ✗ |
| 47 | 11 | ~4.27 | ✗ |
| 48 | 12 | 4 | ✓ |
| 49 | 13 | ~3.77 | ✗ |
| 50 | 5 | 10 | ✓ |
| 51 | 6 | 8.5 | ✗ |
| 52 | 7 | ~7.43 | ✗ |
| 53 | 8 | 6.625 | ✗ |
| 54 | 9 | 6 | ✓ |
| 55 | 10 | 5.5 | ✗ |
| 56 | 11 | ~5.09 | ✗ |
| 57 | 12 | 4.75 | ✗ |
| 58 | 13 | ~4.46 | ✗ |
| 59 | 14 | ~4.21 | ✗ |
| 60 | 6 | 10 | ✓ |
| 61 | 7 | ~8.71 | ✗ |
| 62 | 8 | 7.75 | ✗ |
| 63 | 9 | 7 | ✓ |
| 64 | 10 | 6.4 | ✗ |
| 65 | 11 | ~5.91 | ✗ |
| 66 | 12 | 5.5 | ✗ |
| 67 | 13 | ~5.15 | ✗ |
| 68 | 14 | ~4.86 | ✗ |
| 69 | 15 | 4.6 | ✗ |
| 70 | 7 | 10 | ✓ |
| 71 | 8 | 8.875 | ✗ |
| 72 | 9 | 8 | ✓ |
| 73 | 10 | 7.3 | ✗ |
| 74 | 11 | ~6.73 | ✗ |
| 75 | 12 | 6.25 | ✗ |
| 76 | 13 | ~5.85 | ✗ |
| 77 | 14 | 5.5 | ✗ |
| 78 | 15 | 5.2 | ✗ |
| 79 | 16 | ~4.94 | ✗ |
| 80 | 8 | 10 | ✓ |
| 81 | 9 | 9 | ✓ |
| 82 | 10 | 8.2 | ✗ |
| 83 | 11 | ~7.55 | ✗ |
| 84 | 12 | 7 | ✓ |
| 85 | 13 | ~6.54 | ✗ |
| 86 | 14 | ~6.14 | ✗ |
| 87 | 15 | 5.8 | ✗ |
| 88 | 16 | 5.5 | ✗ |
| 89 | 17 | ~5.24 | ✗ |
| 90 | 9 | 10 | ✓ |
| 91 | 10 | 9.1 | ✗ |
| 92 | 11 | ~8.36 | ✗ |
| 93 | 12 | 7.75 | ✗ |
| 94 | 13 | ~7.23 | ✗ |
| 95 | 14 | ~6.79 | ✗ |
| 96 | 15 | 6.4 | ✗ |
| 97 | 16 | ~6.06 | ✗ |
| 98 | 17 | ~5.76 | ✗ |
| 99 | 18 | 5.5 | ✗ |
| 100 | 1 | 100 | ✓ |
How to Use Our Harshad Calculator
Step 1: Enter a Number
Type any positive integer. Example: 111
Step 2: Click Check Harshad
The calculator:
- Splits the number into digits
- Sums all digits
- Divides original number by digit sum
- Checks if result is integer
Step 3: Read Your Results
You'll see:
- Verdict: Harshad or not
- Digit visualization: Each digit displayed separately
- Digit sum calculation: Complete addition
- Division check: Original ÷ digit sum
- Sanskrit etymology: Learn about "joy-giver"
Example Buttons
Quick test known Harshad numbers:
- 18 (classic example)
- 21 (another simple example)
- 111 (repdigit)
- 1729 (famous Hardy-Ramanujan number)
What It Handles
| Input | Example | Harshad? |
|---|---|---|
| 1-digit | 7 | ✓ |
| 10 | 10 | ✓ |
| 11 | 11 | ✗ |
| 12 | 12 | ✓ |
| 18 | 18 | ✓ |
| 19 | 19 | ✗ |
| 20 | 20 | ✓ |
| 21 | 21 | ✓ |
| 111 | 111 | ✓ |
| 1729 | 1729 | ✓ |
| 1000 | 1000 | ✓ |
| Negative | -18 | ⚠️ Positive only |
| Zero | 0 | ⚠️ Division by zero |
Niven Numbers (Alternative Name)
Harshad numbers are also called Niven numbers after Ivan M. Niven, who published a paper about them in 1977.
Key Properties of Niven Numbers
- There are infinitely many Niven numbers
- The density of Niven numbers tends to zero as numbers get larger
- The smallest Niven number is 1
- All repunits (111...1) are Niven numbers only if the number of digits divides the repunit value
Fun Facts About Harshad Numbers
The Name
"Harshad" comes from Sanskrit and means "joy-giver." How beautiful is that?
1729 Connection
1729 is not only a taxicab number (Hardy-Ramanujan) but also a Harshad number.
Consecutive Harshad Numbers
There are runs of consecutive Harshad numbers. The longest known run in base 10 is 20 numbers.
All Numbers 1-10 Are Harshad
The first 10 positive integers are all Harshad numbers.
100 Is Harshad
100 ÷ 1 = 100 (digit sum = 1)
1000 Is Harshad
1000 ÷ 1 = 1000
Common Mistakes
Mistake 1: Including 0
Wrong: "0 is a Harshad number" Right: 0 ÷ digit sum (0) is undefined (division by zero). Harshad numbers are defined for positive integers.
Mistake 2: Forgetting Single Digits
Wrong: "5 is too small to be Harshad" Right: All single-digit numbers 1-9 are Harshad because n ÷ n = 1.
Mistake 3: Thinking All Multiples of 9 Are Harshad
Wrong: "18 is Harshad, 27 is Harshad, so all multiples of 9 are Harshad" Right: 99 is a multiple of 9 but digit sum = 18, 99 ÷ 18 = 5.5 (not integer). So not all multiples of 9 are Harshad.
Mistake 4: Confusing with Automorphic Numbers
Wrong: "Harshad numbers are those that end with their digit sum" Right: Harshad numbers are divisible by digit sum, not related to last digits.
Mistake 5: Negative Numbers
Wrong: "-18 is Harshad" Right: Harshad numbers are defined for positive integers only.
Quick Reference
Harshad Condition
n is Harshad ⇔ n mod s(n) = 0
Where s(n) = sum of digits of n
First 50 Harshad Numbers
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100, 102, 108, 110, 111, 112, 114, 117, 120, 126, 132, 133, 135, 140, 144, 150, 152, 153...
Digit Sum Patterns
| Number Type | Digit Sum | Harshad? |
|---|---|---|
| Single digit (1-9) | = n | ✓ |
| Powers of 10 | 1 | ✓ |
| Repdigit (111) | 3 | ✓ |
| Repdigit (222) | 6 | ✓ |
| 19 | 10 | ✗ |
Frequently Asked Questions
What is a Harshad number?
A positive integer divisible by the sum of its digits.
Why is it called Harshad?
From Sanskrit: "harṣa" (joy) + "da" (giving) = joy-giver.
What's another name for Harshad numbers?
Niven numbers, after mathematician Ivan M. Niven.
Is 0 a Harshad number?
No, because division by zero is undefined.
Is 10 a Harshad number?
Yes: digit sum = 1, 10 ÷ 1 = 10.
Is 11 a Harshad number?
No: digit sum = 2, 11 ÷ 2 = 5.5 (not integer).
Is 1729 a Harshad number?
Yes! Digit sum = 19, 1729 ÷ 19 = 91.
Are there infinitely many Harshad numbers?
Yes, there are infinitely many in every base.
What's the largest known Harshad number?
There is no largest—they go on infinitely.
How does your calculator find Harshad numbers?
It sums digits, divides the original number by the sum, and checks if the result is an integer.
Your Turn: Start Exploring
Harshad numbers are a beautiful concept from Indian mathematics—numbers that "give joy" by being divisible by their digit sum.
Here's your practice plan:
- Start with single digits: 1-9 (all Harshad)
- Try the classics: 10, 12, 18, 20, 21, 24
- Test non-Harshad: 11, 13, 14, 15, 16, 17, 19
- Use example buttons: 18, 21, 111, 1729
- Try repdigits: 111, 222, 333 (all Harshad? Check 222: sum=6, 222÷6=37 ✓)
- Test powers of 10: 10, 100, 1000, 10000 (all Harshad)
- Check famous 1729: The Hardy-Ramanujan number!
Ready to start? Open up our Harshad Number Calculator and try it yourself. Start with 18, then 21, then 111, then 1729.
You'll discover joy-giving numbers faster than you think.
Have questions? Stuck on a particular number? Drop a comment below or reach out. I've been where you are, and I'm happy to help.
— The Solvezi Team
Disclaimer: This calculator is for educational purposes. Harshad numbers are defined for positive integers only.










