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 n are also known as n-harshad (or 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 X be a positive integer with m digits when written in base n, and let the digits be ai ( i = 0, 1, ..., m − 1). (It follows that ai must be either zero or a positive integer up to n − 1.) X can be expressed as X=m1i=0aini

If there exists an integer A such that the following holds, then X is a harshad number in base n: X=Am1i=0ai
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