Monday 15 May 2023

Base-2 Harshad Numbers

I've written explicitly about Harshad numbers in two previous posts: Harshad Numbers on Saturday, 11 February 2017 and Harshad Numbers Revisited on Saturday, 30 June 2018. However, I've only mentioned Base-\(n\) Harshad numbers in passing and so this post will be about them, although the focus will be on the value of \(n=2\).

I was reminded of them because the number associated with my diurnal age today, 27070, has a property that affords it membership in OEIS A330932. Let's remember that Niven numbers are another name for Harshad numbers.


  A330932

Starts of runs of 3 consecutive Niven numbers in base 2 (A049445).          


What characterises a Harshad or Niven number is that it's divisible by the sum of its digits. For example, 12 has a sum of digits of 3 and 3 divides evenly into 12. Hence 12 is a Harshad number in base 10 but what about in base 2? The binary representation of 12 is 1100 and its sum of digits is then 2 which also divides 12 and thus 12 is also a Harshad number in base 2. 

As it turns out, 12 is a Harshad number in all bases but octal where it is represented as 14. The sum of digits, 5, does not divide into 12. There are only four all-harshad numbers and they are 1, 2, 4, and 6. However, let's get back to  27070, 27071 and 27072 and check that they are indeed Harshad numbers:$$\begin{align} 27070 &= 110100110111110_2\\ \text{sum of digits }&=10\\ \frac{27070}{10} &= 2707 \\ \\27071 &= 110100110111111_2\\ \text{sum of digits }&=11\\ \frac{27071 }{11}&=2461 \\ \\ 27072 &= 110100111000000_2\\ \text{sum of digits } &= 6\\ \frac{27072}{6} &= 4512 \end{align}$$So sure enough, 27070 does begin a run of three Harshad numbers in base 2. The other members of the sequence, up to 40000, are (permalink): 623, 846, 2358, 4206, 4878, 6127, 6222, 6223, 12438, 16974, 21006, 27070, 31295, 33102, 33103, 35343, 37134, 37630, 37638.

To quote from Wikipedia:
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 \(10^{44363342786} \).

H. G. Grundman (1994) extended the Cooper and Kennedy result to show that there are \(2b\) but not \(2b + 1\) consecutive \(b\)-harshad numbers for any base \(b\). This result was strengthened to show that there are infinitely many runs of \(2b\) consecutive b-harshad numbers for \(b = 2\) or \(3\) by T. Cai (1996) 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.

Runs of four consecutive base-2 Harshad numbers occur for very large numbers. I checked and there were none in the range up to one million and, I suspect, far beyond this.

No comments:

Post a Comment