On the distribution in residue classes of integers with a fixed sum of digits

01 January 2005

New Image

Natural numbers are most commonly presented and manipulated as a sequence of digits, whether they be decimal, binary, hexadecimal, etc. A straightforward function common in elementary number theory, and used for check digits, is the sum of digits. This paper shows that in wide ranges, the integers with a fixed sum of base-g digits are distributed in residue classes as one might guess; namely uniformly except for the natural generalization of the rule-of-nines. Several applications are given, including an asymptotic formula for the distribution of integers divisible by their sum of base- g digits. In particular, this application solves a problem of Ivan Niven that had been open for 25 years.