Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Digit sum

From Wikipedia, the free encyclopedia
Sum of a number's digits

Inmathematics, thedigit sum of anatural number in a givennumber base is the sum of all itsdigits. For example, the digit sum of thedecimal number9045{\displaystyle 9045} would be9+0+4+5=18.{\displaystyle 9+0+4+5=18.}

Definition

[edit]

Letn{\displaystyle n} be a natural number. We define thedigit sum for baseb>1{\displaystyle b>1},Fb:NN{\displaystyle F_{b}:\mathbb {N} \rightarrow \mathbb {N} } to be the following:

Fb(n)=i=0kdi{\displaystyle F_{b}(n)=\sum _{i=0}^{k}d_{i}}

wherek=logbn{\displaystyle k=\lfloor \log _{b}{n}\rfloor } is one less than the number of digits in the number in baseb{\displaystyle b}, and

di=nmodbi+1nmodbibi{\displaystyle d_{i}={\frac {n{\bmod {b^{i+1}}}-n{\bmod {b}}^{i}}{b^{i}}}}

is the value of each digit of the number.

For example, inbase 10, the digit sum of 84001 isF10(84001)=8+4+0+0+1=13.{\displaystyle F_{10}(84001)=8+4+0+0+1=13.}

For any two bases2b1<b2{\displaystyle 2\leq b_{1}<b_{2}} and for sufficiently large natural numbersn,{\displaystyle n,}

k=0nFb1(k)<k=0nFb2(k).{\displaystyle \sum _{k=0}^{n}F_{b_{1}}(k)<\sum _{k=0}^{n}F_{b_{2}}(k).}[1]

The sum of the base 10 digits of theintegers 0, 1, 2, ... is given byOEISA007953 in theOn-Line Encyclopedia of Integer Sequences.Borwein & Borwein (1992) use thegenerating function of thisinteger sequence (and of the analogous sequence forbinary digit sums) to derive several rapidlyconvergingseries withrational andtranscendental sums.[2]

Extension to negative integers

[edit]

The digit sum can be extended to the negative integers by use of asigned-digit representation to represent each integer.

Properties

[edit]

The amount of n-digit numbers with digit sum q can be calculated using:

f(n,q)={1if n=1f(n,9nq+1)if q>9n2i=max(q9,1)qf(n1,i)otherwise{\displaystyle f(n,q)={\begin{cases}1&{\text{if }}n=1\\f(n,9n-q+1)&{\text{if }}q>\lceil {\frac {9n}{2}}\rceil \\\sum _{i=\max(q-9,1)}^{q}f(n-1,i)&{\text{otherwise}}\end{cases}}}

Applications

[edit]

The concept of a decimal digit sum is closely related to, but not the same as, thedigital root, which is the result of repeatedly applying the digit sum operation until the remaining value is only a single digit. The decimal digital root of any non-zero integer will be a number in the range 1 to 9, whereas the digit sum can take any value. Digit sums and digital roots can be used for quickdivisibility tests: a natural number isdivisible by 3 or 9if and only if its digit sum (or digital root) is divisible by 3 or 9, respectively. For divisibility by 9, this test is called therule of nines and is the basis of thecasting out nines technique for checking calculations.

Digit sums are also a common ingredient inchecksum algorithms to check the arithmetic operations of early computers.[3] Earlier, in an era of hand calculation,Edgeworth (1888) suggested using sums of 50 digits taken from mathematicaltables of logarithms as a form ofrandom number generation; if one assumes that each digit is random, then by thecentral limit theorem, these digit sums will have a random distribution closely approximating aGaussian distribution.[4]

The digit sum of thebinary representation of a number is known as itsHamming weight or population count; algorithms for performing this operation have been studied, and it has been included as a built-in operation in some computer architectures and someprogramming languages. These operations are used in computing applications includingcryptography,coding theory, andcomputer chess.

Harshad numbers are defined in terms of divisibility by their digit sums, andSmith numbers are defined by the equality of their digit sums with the digit sums of theirprime factorizations.

See also

[edit]

References

[edit]
  1. ^Bush, L. E. (1940), "An asymptotic formula for the average sum of the digits of integers",American Mathematical Monthly,47 (3), Mathematical Association of America:154–156,doi:10.2307/2304217,JSTOR 2304217.
  2. ^Borwein, J. M.;Borwein, P. B. (1992),"Strange series and high precision fraud"(PDF),American Mathematical Monthly,99 (7):622–640,doi:10.2307/2324993,hdl:1959.13/1043650,JSTOR 2324993, archived fromthe original(PDF) on 2016-05-09, retrieved2009-03-02.
  3. ^Bloch, R. M.; Campbell, R. V. D.; Ellis, M. (1948), "The Logical Design of the Raytheon Computer",Mathematical Tables and Other Aids to Computation,3 (24), American Mathematical Society:286–295,doi:10.2307/2002859,JSTOR 2002859.
  4. ^Edgeworth, F. Y. (1888),"The Mathematical Theory of Banking"(PDF),Journal of the Royal Statistical Society,51 (1):113–127, archived fromthe original(PDF) on 2006-09-13.

External links

[edit]
Classes ofnatural numbers
Powers and related numbers
Of the forma × 2b ± 1
Other polynomial numbers
Recursively defined numbers
Possessing a specific set of other numbers
Expressible via specific sums
2-dimensional
centered
non-centered
3-dimensional
centered
non-centered
pyramidal
4-dimensional
non-centered
Combinatorial numbers
Divisor functions
Prime omega functions
Euler's totient function
Aliquot sequences
Primorial
Otherprime factor ordivisor related numbers
Numeral system-dependent numbers
Arithmetic functions
anddynamics
Digit sum
Digit product
Coding-related
Other
P-adic numbers-related
Digit-composition related
Digit-permutation related
Divisor-related
Other
Generated via asieve
Sorting related
Graphemics related
Retrieved from "https://en.wikipedia.org/w/index.php?title=Digit_sum&oldid=1315450799"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp