Harshad (Niven) Number Checker
Check whether a number is divisible by the sum of its digits using this Harshad Number Checker.
Share
https://www.solvezi.com/number-theory/harshad-number-checker
Check whether a number is divisible by the sum of its digits using this Harshad Number Checker.
https://www.solvezi.com/number-theory/harshad-number-checker
A Harshad number (also known as a Niven number) is an integer that is divisible by the sum of its digits.
For example, 18 is a Harshad number because 1 + 8 = 9 and 18 ÷ 9 = 2 with no remainder. The word "Harshad" comes from Sanskrit meaning "joy-giver".
The term "Harshad" was coined by the Indian mathematician D. R. Kaprekar from Sanskrit: harṣa (joy) + da (giving).
18 ÷ (1 + 8) = 2
✓ No remainder → Joy-giver!
All numbers 1 through 9 are Harshad numbers.
1729 is both a taxicab number AND a Harshad number!
Numbers 1-10 are all consecutive Harshad numbers!
1Digits: 1, 8
2Division Check:
1Digits: 1, 9
2Division Check:
1Digits: 1, 7, 2, 9
2Division Check:
1Digits: 7
2Division Check:
| Number | Digit Sum | Quotient | Reason |
|---|---|---|---|
| 1 | 1 | 1 | Smallest Harshad number |
| 10 | 1 | 10 | First two-digit Harshad |
| 18 | 9 | 2 | Classic example |
| 21 | 3 | 7 | 21 ÷ (2+1) = 7 |
| 111 | 3 | 37 | 111 ÷ (1+1+1) = 37 |
| 1729 | 19 | 91 | Hardy-Ramanujan taxicab number |
| Property | Description | Example |
|---|---|---|
| Single Digits | All numbers 1-9 are Harshad | 1,2,3,4,5,6,7,8,9 |
| Base Dependence | Harshad property depends on base | 10 in base 10 is Harshad |
| Niven Numbers | Also called Niven numbers | Named after Ivan M. Niven |
| Consecutive Harshads | Consecutive Harshad numbers exist | 1-10 are all Harshad |
| Infinite Sequence | There are infinitely many Harshad numbers | They become rarer but continue |
| Sanskrit Origin | Harshad = 'joy-giver' | harṣa (joy) + da (giving) |
Yes! There are infinitely many Harshad numbers in base 10. However, they become rarer as numbers get larger.
They are the same! Harshad is the Sanskrit name, while Niven numbers are named after mathematician Ivan M. Niven.
Usually not, because division by zero (digit sum of 0) is undefined. Harshad numbers are typically defined for positive integers.
Indian mathematician D. R. Kaprekar (famous for Kaprekar's constant 6174) coined the term "Harshad" in the 20th century.
n ÷ sum_of_digits(n) = integer
A number n is Harshad if it is divisible by the sum of its digits.