TOPICS

Harshad Number


A Harshad number is a positive integer which is divisible by the sum of its decimal digits, also called a Niven number (Kennedy et al. 1980) or a multidigital number (Kaprekar 1955). The first few are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, ... (OEIS A005349). Cooper and Kennedy (1993) proved that there is no sequence of more than 20 consecutive Harshad numbers and constructed a sequence of 20 consecutive Harshad numbers whose members have 4436342786 digits. Wilson (1996) constructed a smaller example with 1788 digits per member.

A constructive family is given by

 nk(10^n-1)

for positive integers n and k satisfying nk<10^n (D'Amico 2019, p. 22). Each such number has digit sum 9n, which divides it. Indeed, for an integer m with 1<=m<10^n,

 m(10^n-1)=(m-1)10^n+(10^n-m),

and the two blocks of n decimal digits, including leading zeros, have corresponding digits summing to 9. Taking m=nk gives the stated family.

Grundman (1994) defined an n-Harshad (or n-Niven) number to be a positive integer which is divisible by the sum of its digits in base n, where n>=2 is an integer. Cai (1996) showed that for n=2 or 3, there exists an infinite family of sequences of consecutive n-Harshad numbers of length 2n.

An all-Harshad (or all-Niven) number is a positive integer which is divisible by the sum of its digits in all bases n>=2. Then only 1, 2, 4, and 6 are all-Harshad numbers.


Explore with Wolfram|Alpha

References

Cai, T. "On 2-Niven Numbers and 3-Niven Numbers." Fib. Quart. 34, 118-120, 1996.Cooper, C. N. and Kennedy, R. "On Consecutive Niven Numbers." Fib. Quart. 31, 146-151, 1993.Cooper, C. N. and Kennedy, R. E. "Chebyshev's Inequality and Natural Density." Amer. Math. Monthly 96, 118-124, 1989.D'Amico, R. "A Method to Generate Harshad Numbers." Journal of Mathematical Economics and Finance 5, 19-26, 2019. https://doi.org/10.14505/jmef.v5.1(8).02.Grundman, H. G. "Sequences of Consecutive n-Niven Numbers." Fib. Quart. 32, 174-175, 1994.Kaprekar, D. R. "Multidigital Numbers." Scripta Math. 21, 27, 1955.Kennedy, R. E. and Cooper, C. N. "On the Natural Density of the Niven Numbers." Abstract 816-11-219, Abstracts Amer. Math. Soc. 6, 17, 1985.Kennedy, R.; Goodman, R.; and Best, C. "Mathematical Discovery and Niven Numbers." MATYC J. 14, 21-25, 1980.Numberphile. "2016502858579884466176." Sep. 24, 2025. https://www.youtube.com/watch?v=dgwevhEykWQ.Sloane, N. J. A. Sequence A005349/M0481 in "The On-Line Encyclopedia of Integer Sequences."Vardi, I. "Niven Numbers." §2.3 in Computational Recreations in Mathematica. Redwood City, CA: Addison-Wesley, pp. 19 and 28-31, 1991.Wells, D. The Penguin Dictionary of Curious and Interesting Numbers. Middlesex, England: Penguin Books, p. 171, 1986.Wilson, B. "Construction of Small Consecutive Niven Numbers." Fib. Quart. 34, 240-243, 1996. https://www.fq.math.ca/Scanned/34-3/wilson.pdf.

Referenced on Wolfram|Alpha

Harshad Number

Cite this as:

Weisstein, Eric W. "Harshad Number." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/HarshadNumber.html

Subject classifications