In mathematics, a harshad number in a given number base is an integer that is divisible by the sum of its digits when written in that base. Harshad numbers in base are also known as -harshad numbers. Harshad numbers were defined by D. R. Kaprekar, a mathematician from India. The word "harshad" comes from the Sanskrit' + ', meaning joy-giver. The term "Niven number" arose from a paper delivered by Ivan M. Niven at a conference on number theory in 1977. All integers between zero and are -harshad numbers.
Definition
Stated mathematically, let be a positive integer with digits when written in base, and let the digits be . can be expressed as is a harshad number in base if: A number which is a harshad number in every number base is called an all-harshad number, or an all-Niven number. There are only four all-harshad numbers: 1, 2, 4, and 6.
Examples
The number 18 is a harshad number in base 10, because the sum of the digits 1 and 8 is 9, and 18 is divisible by 9.
The Hardy–Ramanujan number is a harshad number in base 10, since it is divisible by 19, the sum of its digits.
The number 19 is not a harshad number in base 10, because the sum of the digits 1 and 9 is 10, and 19 is not divisible by 10.
Given the divisibility test for 9, one might be tempted to generalize that all numbers divisible by 9 are also harshad numbers. But for the purpose of determining the harshadness of, the digits of can only be added up once and must be divisible by that sum; otherwise, it is not a harshad number. For example, 99 is not a harshad number, since 9 + 9 = 18, and 99 is not divisible by 18. The base number will always be a harshad number in its own base, since it will be represented as "10" and 1 + 0 = 1. All numbers whose base bdigit sum divides b−1 are harshad numbers in base b. For a prime number to also be a harshad number it must be less than or equal to the base number, otherwise the digits of the prime will add up to a number that is more than 1, but less than the prime, and will not be divisible. For example: 11 is not harshad in base 10 because the sum of its digits “11” is 1 + 1 = 2, and 11 is not divisible by 2; while in base 12 the number 11 may be represented as “Ɛ”, the sum of whose digits is also Ɛ. Since Ɛ is divisible by itself, it is harshad in base 12. Although the sequence of factorials starts with harshad numbers in base 10, not all factorials are harshad numbers. 432! is the first that is not. Smallest such that is a harshad number are Smallest such that is not a harshad number are
Other bases
The harshad numbers in base 12 are: where ᘔ represents ten and Ɛ represents eleven. Smallest such that is a base-12 harshad number are : Smallest such that is not a base-12 harshad number are : Similar to base 10, not all factorials are harshad numbers in base 12. After 7!, 1276! is the next that is not.
Consecutive harshad numbers
Maximal runs of consecutive harshad numbers
Cooper and Kennedy proved in 1993 that no 21 consecutive integers are all harshad numbers in base 10. They also constructed infinitely many 20-tuples of consecutive integers that are all 10-harshad numbers, the smallest of which exceeds 1044363342786. extended the Cooper and Kennedy result to show that there are 2b but not 2b + 1 consecutive b-harshad numbers. This result was strengthened to show that there are infinitely many runs of 2b consecutive b-harshad numbers for b = 2 or 3 by and for arbitrary b by Brad Wilson in 1997. In binary, there are thus infinitely many runs of four consecutive harshad numbers and in ternary infinitely many runs of six. In general, such maximal sequences run from N·bk − b to N·bk +, where b is the base, k is a relatively large power, and N is a constant. Given one such suitably chosen sequence, we can convert it to a larger one as follows:
Inserting zeroes into N will not change the sequence of digital sums.
If we insert n zeroes after the first digit, α, we increase the value of N by αbi.
If we can ensure that bn − 1 is divisible by all digit sums in the sequence, then the divisibility by those sums is maintained.
If our initial sequence is chosen so that the digit sums are coprime to b, we can solve bn = 1 modulo all those sums.
If that is not so, but the part of each digit sum not coprime to b divides αbi, then divisibility is still maintained.
The initial sequence is so chosen.
Thus our initial sequence yields an infinite set of solutions.
First runs of exactly consecutive 10-harshad numbers
The smallest naturals starting runs of exactly consecutive 10-harshad numbers are as follows :
By the previous section, no such exists for.
Estimating the density of harshad numbers
If we let denote the number of harshad numbers, then for any given, as shown by Jean-Marie De Koninck and Nicolas Doyon; furthermore, De Koninck, Doyon and Kátai proved that where and the term uses little o notation.
Nivenmorphic numbers
A Nivenmorphic number or harshadmorphic number for a given number base is an integer such that there exists some harshad number whose digit sum is, and, written in that base, terminates written in the same base. For example, 18 is a Nivenmorphic number for base 10: 16218 is a harshad number 16218 has 18 as digit sum 18 terminates 16218 Sandro Boscaro determined that for base 10 all positive integers are Nivenmorphic numbers except 11. In fact, for an even integer n > 1, all positive integers except n+1 are Nivenmorphic numbers for base n, and for an odd integern > 1, all positive integers are Nivenmorphic numbers for base n. e.g. the Nivenmorphic numbers in base 12 are . The smallest number with base 10 digit sum n and terminates n written in base 10 are:
Multiple harshad numbers
defines a multiple harshad number as a harshad number that, when divided by the sum of its digits, produces another harshad number. He states that 6804 is "MHN-4" on the grounds that and went on to show that 2016502858579884466176 is MHN-12. The number 10080000000000 = 1008·1010, which is smaller, is also MHN-12. In general, 1008·10n is MHN-.