The digit sum
of a nonnegative integer
is the sum of its base-
digits, where the base
is an integer.
The base-10 digit sum of the integer
is implemented in the Wolfram
Language as DigitSum[n],
and the base-
digit sum as DigitSum[n, b].
The following table gives
for
, 2, ... and small
.
| OEIS | ||
| 2 | A000120 | 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, ... |
| 3 | A053735 | 1, 2, 1, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 4, 3, ... |
| 4 | A053737 | 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, ... |
| 5 | A053824 | 1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, ... |
| 6 | A053827 | 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 2, 3, 4, 5, ... |
| 7 | A053828 | 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 2, 3, ... |
| 8 | A053829 | 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, ... |
| 9 | A053830 | 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, ... |
| 10 | A007953 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, ... |
Plots of the digit sums of first thousand positive integers are illustrated above for bases 2 to 10.
Plotting
versus
and
gives the plot shown above.
The digit sum
satisfies the congruence
|
(1)
|
In base 10, this congruence is the basis of casting out nines and of fast divisibility tests such as those for 3 and 9.
For integers and
,
|
(2)
|
Indeed,
splits the product into two digit blocks of length
, including leading zeros, whose corresponding digits
sum to
(Carfì 2026, pp. 19-20).
This identity underlies a construction of Harshad numbers
in base
.
satisfies the following unexpected
identity
|
(3)
|
the case of which was given in the 1981
Putnam competition (Allouche 1992). In addition,
|
(4)
| |||
|
(5)
|
(OEIS A100044 and A100045; Allouche 1992, Allouche and Shallit 1992).
Let be the number of digit
blocks of 11 in the binary expansion of
, then
|
(6)
|
(OEIS A100046; Allouche 1992).
Sondow (2006) noted the unexpected identity
|
(7)
|
The special case of
corresponds to a Thue-Morse sequence product
(J. Sondow, pers. comm., Oct. 31, 2006).
The numbers 1, 81, 1458 and 1729 (OEIS A110921) are each the product of their own digit sum and its reversal, for example ,
and
. These are the only four numbers with
this property, as proved by Fujiwara (Fujiwara and Ogawa 2005).
For a fixed integer base , an integer
can be the digit sum of a square
number only if
for some integer
. Call such a
admissible. For every sufficiently large admissible
, vibefrtz (2026) proved that there are at least
positive
integers
satisfying
,
, and
; the stated bound holds whenever
.
The construction and the lower bound
were formally verified in Lean.