Harshad Number Calculator
Check if a number is a Harshad (Niven) number by testing if it is divisible by the sum of its digits.
Enter any positive integer (up to 1000 digits) to check if it is a Harshad number
A Harshad number is a positive integer that is divisible by the sum of its digits. The term comes from Sanskrit "harsha" (joy) and "da" (give), meaning "joy-giver."
Definition:
n is Harshad if n mod (sum of digits of n) = 0
Algorithm:
- Calculate the sum of all digits of the number
- Check if the original number is divisible by this sum
- If the remainder is 0, it is a Harshad number
Example 1: Is 18 a Harshad number?
- Digit sum: 1 + 8 = 9
- 18 / 9 = 2 (no remainder)
- Yes, 18 is a Harshad number
Example 2: Is 19 a Harshad number?
- Digit sum: 1 + 9 = 10
- 19 / 10 = 1 remainder 9
- No, 19 is not a Harshad number
Interesting Properties:
- All single-digit numbers (1-9) are Harshad numbers
- 10 is a Harshad number (1+0=1, and 10/1=10)
- 11 is NOT a Harshad number (1+1=2, and 11/2 has remainder 1)
- There are infinitely many Harshad numbers, but they become less frequent as numbers grow larger
Applications: Harshad numbers appear in recreational mathematics and have connections to divisibility rules. They are also studied in the context of self-describing numbers and digit-related number theory.
What is a Harshad number?
A Harshad number (also called a Niven number) is a positive integer that is divisible by the sum of its digits. The name "Harshad" comes from Sanskrit, meaning "joy-giver." For example, 18 is a Harshad number because 1+8=9, and 18 is divisible by 9.
What is the difference between Harshad numbers and digital roots?
While both concepts involve digit sums, they are fundamentally different. The digital root repeatedly sums digits until a single digit remains. A Harshad number checks if the original number is divisible by its digit sum (calculated only once). For example, 18 has a digit sum of 9 and is divisible by 9, making it a Harshad number. Its digital root is also 9, but these are separate properties.
Are all single-digit numbers Harshad numbers?
Yes! Every single-digit positive integer (1-9) is a Harshad number because each is divisible by itself (its digit sum equals the number itself). For example, 7 has a digit sum of 7, and 7 / 7 = 1.
What are some examples of Harshad numbers?
The first several Harshad numbers are: 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. Notice that 11 is not a Harshad number because 1+1=2, and 11 is not divisible by 2.
Who discovered Harshad numbers?
Harshad numbers were defined by Indian mathematician D. R. Kaprekar. The term "Niven number" honors Canadian mathematician Ivan M. Niven, who presented a paper on these numbers at a conference in 1977. Both names are commonly used in mathematical literature.