Saturday 11 February 2017

Harshad Numbers

Today I turned 24786 days old and one of the occurrences of this number in the OEIS was in A097569: right-truncatable Harshad numbers (zeros not permitted). Of course, I needed to ask myself the inevitable question: what is a Harshad number? Here is what Wikipedia had to say about it:
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 \(\displaystyle n\) are also known as \(\displaystyle n\)-harshad (or \(\displaystyle n\)-Niven) numbers. 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. 
Stated mathematically, let \(\displaystyle X\) be a positive integer with \(\displaystyle m\) digits when written in base \(\displaystyle n\), and let the digits be \(\displaystyle a_{i}\) ( \(\displaystyle i\) = 0, 1, ..., \(\displaystyle m\) − 1). (It follows that \(\displaystyle a_{i}\) must be either zero or a positive integer up to \(\displaystyle n\) − 1.) \(\displaystyle X\) can be expressed as \[\displaystyle X=\sum _{i=0}^{m-1}a_{i}n^{i}\]
If there exists an integer \(\displaystyle A\) such that the following holds, then \(\displaystyle X\) is a harshad number in base \(\displaystyle n\): \[\displaystyle X=A\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).

So, getting back to 24786, it can be seen that it is a Harshad number because 2+4+7+8+6 = 27 and 24786/27 = 918. Truncating the last digit on the right gives 2478, so that 2+4+7+8 = 21 and 2478/21 = 118. Truncating again gives 247, so that 2+4+7 = 13 and 247/13 = 19. Truncating again gives 24, so that 2+4=6 and 24/6=4. Finally, 2 itself is of course a Harshad number.

Furthermore, it is asserted in the OEIS entry that 24786 is the final such number in the sequence of right-truncatable Harshad numbers. The full sequence is then given by:

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 18, 21, 24, 27, 36, 42, 45, 48, 54, 63, 72, 81, 84, 126, 216, 243, 247, 364, 423, 481, 486, 846, 2478, 8463, 24786

2 comments:

  1. why 15 is not hurshad number i not understand
    but 3 and 5 from divisible

    ReplyDelete
    Replies
    1. The sum of the digits of 15 is 6 and 6 does not divide 15, so 15 can't be a Harshad number (at least not in base 10).

      Delete