Mathwords logoMathwords

Harshad Number — Definition, Formula & Examples

A Harshad number is a whole number that is evenly 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.

A positive integer nn is called a Harshad number (or Niven number) if nn is divisible by s(n)s(n), where s(n)s(n) denotes the sum of the digits of nn in base 10. That is, s(n)ns(n) \mid n.

How It Works

To check whether a number is a Harshad number, add up all of its digits, then divide the original number by that sum. If the result is a whole number with no remainder, you have a Harshad number. Every single-digit number (1 through 9) is automatically a Harshad number, since any number divided by itself equals 1. The name comes from the Sanskrit word "harsha," meaning joy.

Worked Example

Problem: Is 171 a Harshad number?
Step 1: Find the sum of the digits of 171.
1+7+1=91 + 7 + 1 = 9
Step 2: Divide the original number by the digit sum.
171÷9=19171 \div 9 = 19
Step 3: Since 19 is a whole number (no remainder), 171 is divisible by its digit sum.
Answer: Yes, 171 is a Harshad number because it is evenly divisible by the sum of its digits (9).

Why It Matters

Harshad numbers appear in recreational mathematics and number theory competitions. Checking them is great practice for divisibility skills and digit manipulation, which are useful throughout algebra and standardized math tests.

Common Mistakes

Mistake: Forgetting to use the original number in the division step and instead dividing the digit sum by something else.
Correction: Always divide the original number by its digit sum. For 171, compute 171 ÷ 9, not 9 ÷ 171.