In recreational mathematics, a Harshad number (or Niven 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 n are also known as n-harshad (or n-Niven) numbers. Because being a harshad number is determined according to the base the number is expressed in, a number can be a Harshad number many times over. So-called Trans-harshad numerals are sequences of the digits 0-9 which, in every base which uses all their digits, represent a Harshad number in that base. Harshad numbers were defined by D. R. Kaprekar, a mathematician from India. The word "harshad" comes from the Sanskrit harṣa (joy) + da (give), meaning joy-giver. The term "Niven number" arose from a paper delivered by Ivan M. Niven at a conference on number theory in 1977.
Definition Stated mathematically, let X be a positive integer with m digits when written in base n, and let the digits be a i {\displaystyle a_{i}} ( i = 0 , 1 , … , m − 1 {\displaystyle i=0,1,\ldots ,m-1} ). (It follows that a i {\displaystyle a_{i}} must be either zero or a positive integer up to n − 1 {\displaystyle n-1} .) X can be expressed as
X = ∑ i = 0 m − 1 a i n i . {\displaystyle X=\sum _{i=0}^{m-1}a_{i}n^{i}.}
X is a Harshad number in base n if:
X ≡ 0 mod ∑ i = 0 m − 1 a i . {\displaystyle X\equiv 0{\bmod {\sum _{i=0}^{m-1}a_{i}}}.}
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. The number 12 is a Harshad number in all bases except octal.
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 (1729) is a Harshad number in base 10, since it is divisible by 19, the sum of its digits (1729 = 19 × 91). 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. In base 10, every natural number expressible in the form 9Rnan, where the number Rn consists of n copies of the single digit 1, n > 0, and an is a positive integer less than 10n and multiple of n, is a Harshad number. (R. D’Amico, 2019). The number 9R3a3 = 521478, where R3 = 111, n = 3 and a3 = 3×174 = 522, is a Harshad number; in fact, we have: 521478/(5+2+1+4+7+8) = 521478/27 = 19314. Harshad numbers in base 10 form the sequence: 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, 102, 108, 110, 111, 112, 114, 117, 120, 126, 132, 133, 135, 140, 144, 150, 152, 153, 156, 162, 171, 180, 190, 192, 195, 198, 200, ... (sequence A005349 in the OEIS). All integers between zero and n are n-Harshad numbers.
Properties 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 n, the digits of n can only be added up once and n 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 (and furthermore, its powers) 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 b digit 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 “B”, the sum of whose digits is also B. Since B is divisible by itself, it is Harshad in base 12. Every number with a single digit in a base will be a Harshad number in said base. This is because the sum of the number's digits will be the number itself, and every number regardless of base or digits is divisible by themselves. 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. (432! has digit sum 3897 = 32 × 433 in base 10, thus not dividing 432!) The smallest k such that k ⋅ n {\displaystyle k\cdot n} is a Harshad number are
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 9, 3, 2, 3, 6, 1, 6, 1, 1, 5, 9, 1, 2, 6, 1, 3, 9, 1, 12, 6, 4, 3, 2, 1, 3, 3, 3, 1, 10, 1, 12, 3, 1, 5, 9, 1, 8, 1, 2, 3, 18, 1, 2, 2, 2, 9, 9, 1, 12, 6, 1, 3, 3, 2, 3, 3, 3, 1, 18, 1, 7, 3, 2, 2, 4, 2, 9, 1, ... (sequence A144261 in the OEIS). The smallest k such that k ⋅ n {\displaystyle k\cdot n} is not a Harshad number are
11, 7, 5, 4, 3, 11, 2, 2, 11, 13, 1, 8, 1, 1, 1, 1, 1, 161, 1, 8, 5, 1, 1, 4, 1, 1, 7, 1, 1, 13, 1, 1, 1, 1, 1, 83, 1, 1, 1, 4, 1, 4, 1, 1, 11, 1, 1, 2, 1, 5, 1, 1, 1, 537, 1, 1, 1, 1, 1, 83, 1, 1, 3, 1, 1, 1, 1, 1, 1, 5, 1, 68, 1, 1, 1, 1, 1, 1, 1, 2, ... (sequence A144262 in the OEIS).
Other bases The Harshad numbers in base 12 are:
… excerpt ends here. Continue reading the full article.
