Lably
Skip to content

Digit sum

Sum of a number's digits

  • 2 min read
  • 4 chapters
  • 1 lab on Lably

Learn it on Lably

Definition

Let n be a natural number. We define the digit sum for base b>1, Fb:N→N to be the following:

Fb(n)=∑i=0kdi

where k=⌊logb⁡n⌋ is one less than the number of digits in the number in base b, and

di=nmodbi+1−nmodbibi

is the value of each digit of the number.

For example, in base 10, the digit sum of 84001 is F10(84001)=8+4+0+0+1=13.

For any two bases 2≤b1<b2 and for sufficiently large natural numbers n,

∑k=0nFb1(k)<∑k=0nFb2(k).

The sum of the base 10 digits of the integers 0, 1, 2, ... is given by OEIS: A007953 in the On-Line Encyclopedia of Integer Sequences. Borwein & Borwein (1992) use the generating function of this integer sequence (and of the analogous sequence for binary digit sums) to derive several rapidly converging series with rational and transcendental sums.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication