Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Digital root

From Wikipedia, the free encyclopedia
Repeated sum of a number's digits
"Digital roots" redirects here. For the Deltarune Chapter 2 track, seeMusic of Deltarune § Deltarune Chapter 2 OST.
This article includes alist of references,related reading, orexternal links,but its sources remain unclear because it lacksinline citations. Please helpimprove this article byintroducing more precise citations.(January 2016) (Learn how and when to remove this message)

Thedigital root (alsorepeated digital sum) of anatural number in a givenradix is the (single digit) value obtained by an iterative process ofsumming digits, on each iteration using the result from the previous iteration to compute a digit sum. The process continues until a single-digit number is reached. For example, in base 10, the digital root of the number 12345 is 6 because the sum of the digits in the number is 1 + 2 + 3 + 4 + 5 = 15, then the addition process is repeated again for the resulting number 15, so that the sum of 1 + 5 equals 6, which is the digital root of that number. In base 10, this is equivalent to taking the remainder upon division by 9 (except when the digital root is 9, where the remainder upon division by 9 will be 0), which allows it to be used as adivisibility rule.

Formal definition

[edit]

Letn{\displaystyle n} be a natural number. For baseb>1{\displaystyle b>1}, we define thedigit sumFb:NN{\displaystyle F_{b}:\mathbb {N} \rightarrow \mathbb {N} } to be the following:

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

wherek=logbn+1{\displaystyle k=\lfloor \log _{b}{n}\rfloor +1} is 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. A natural numbern{\displaystyle n} is adigital root if it is afixed point forFb{\displaystyle F_{b}}, which occurs ifFb(n)=n{\displaystyle F_{b}(n)=n}.

All natural numbersn{\displaystyle n} arepreperiodic points forFb{\displaystyle F_{b}}, regardless of the base. This is because ifnb{\displaystyle n\geq b}, then

n=i=0k1dibi{\displaystyle n=\sum _{i=0}^{k-1}d_{i}b^{i}}

and therefore

Fb(n)=i=0k1di<i=0k1dibi=n{\displaystyle F_{b}(n)=\sum _{i=0}^{k-1}d_{i}<\sum _{i=0}^{k-1}d_{i}b^{i}=n}

becauseb>1{\displaystyle b>1}.Ifn<b{\displaystyle n<b}, then trivially

Fb(n)=n{\displaystyle F_{b}(n)=n}

Therefore, the only possible digital roots are the natural numbers0n<b{\displaystyle 0\leq n<b}, and there are no cycles other than the fixed points of0n<b{\displaystyle 0\leq n<b}.

Example

[edit]

Inbase 12, 8 is the additive digital root of thebase 10 number 3110, as forn=3110{\displaystyle n=3110}

d0=3110mod120+13110mod120120=3110mod123110mod11=201=21=2{\displaystyle d_{0}={\frac {3110{\bmod {12^{0+1}}}-3110{\bmod {1}}2^{0}}{12^{0}}}={\frac {3110{\bmod {12}}-3110{\bmod {1}}}{1}}={\frac {2-0}{1}}={\frac {2}{1}}=2}
d1=3110mod121+13110mod121121=3110mod1443110mod1212=86212=8412=7{\displaystyle d_{1}={\frac {3110{\bmod {12^{1+1}}}-3110{\bmod {1}}2^{1}}{12^{1}}}={\frac {3110{\bmod {144}}-3110{\bmod {1}}2}{12}}={\frac {86-2}{12}}={\frac {84}{12}}=7}
d2=3110mod122+13110mod122122=3110mod17283110mod144144=138286144=1296144=9{\displaystyle d_{2}={\frac {3110{\bmod {12^{2+1}}}-3110{\bmod {1}}2^{2}}{12^{2}}}={\frac {3110{\bmod {1728}}-3110{\bmod {1}}44}{144}}={\frac {1382-86}{144}}={\frac {1296}{144}}=9}
d3=3110mod123+13110mod123123=3110mod207363110mod17281728=311013821728=17281728=1{\displaystyle d_{3}={\frac {3110{\bmod {12^{3+1}}}-3110{\bmod {1}}2^{3}}{12^{3}}}={\frac {3110{\bmod {20736}}-3110{\bmod {1}}728}{1728}}={\frac {3110-1382}{1728}}={\frac {1728}{1728}}=1}
F12(3110)=i=041di=2+7+9+1=19{\displaystyle F_{12}(3110)=\sum _{i=0}^{4-1}d_{i}=2+7+9+1=19}

This process shows that 3110 is 1972 inbase 12. Now forF12(3110)=19{\displaystyle F_{12}(3110)=19}

d0=19mod120+119mod120120=19mod1219mod11=701=71=7{\displaystyle d_{0}={\frac {19{\bmod {12^{0+1}}}-19{\bmod {1}}2^{0}}{12^{0}}}={\frac {19{\bmod {12}}-19{\bmod {1}}}{1}}={\frac {7-0}{1}}={\frac {7}{1}}=7}
d1=19mod121+119mod121121=19mod14419mod1212=19712=1212=1{\displaystyle d_{1}={\frac {19{\bmod {12^{1+1}}}-19{\bmod {1}}2^{1}}{12^{1}}}={\frac {19{\bmod {144}}-19{\bmod {1}}2}{12}}={\frac {19-7}{12}}={\frac {12}{12}}=1}
F12(19)=i=021di=1+7=8{\displaystyle F_{12}(19)=\sum _{i=0}^{2-1}d_{i}=1+7=8}

shows that 19 is 17 inbase 12. And as 8 is a 1-digit number inbase 12,

F12(8)=8{\displaystyle F_{12}(8)=8}.

Direct formulas

[edit]

We can define the digit root directly for baseb>1{\displaystyle b>1}drb:NN{\displaystyle \operatorname {dr} _{b}:\mathbb {N} \rightarrow \mathbb {N} } in the following ways:

Congruence formula

[edit]

The formula in baseb{\displaystyle b} is:

drb(n)={0if n=0,b1if n0, n 0(mod(b1)),nmod(b1)if n0(mod(b1)){\displaystyle \operatorname {dr} _{b}(n)={\begin{cases}0&{\mbox{if}}\ n=0,\\b-1&{\mbox{if}}\ n\neq 0,\ n\ \equiv 0{\pmod {(b-1)}},\\n{\bmod {(b-1)}}&{\mbox{if}}\ n\not \equiv 0{\pmod {(b-1)}}\end{cases}}}

or,

drb(n)={0if n=0,1 + ((n1)mod(b1))if n0.{\displaystyle \operatorname {dr} _{b}(n)={\begin{cases}0&{\mbox{if}}\ n=0,\\1\ +\ ((n-1){\bmod {(b-1)}})&{\mbox{if}}\ n\neq 0.\end{cases}}}

Inbase 10, the corresponding sequence is (sequenceA010888 in theOEIS).

The digital root is the value modulo(b1){\displaystyle (b-1)} becauseb1(mod(b1)),{\displaystyle b\equiv 1{\pmod {(b-1)}},} and thusbi1i1(mod(b1)).{\displaystyle b^{i}\equiv 1^{i}\equiv 1{\pmod {(b-1)}}.} So regardless of the positioni{\displaystyle i} of digitdi{\displaystyle d_{i}},dibidi(mod(b1)){\displaystyle d_{i}b^{i}\equiv d_{i}{\pmod {(b-1)}}}, which explains why digits can be meaningfully added. Concretely, for a three-digit numbern=d2b2+d1b1+d0b0{\displaystyle n=d_{2}b^{2}+d_{1}b^{1}+d_{0}b^{0}},

drb(n)d2b2+d1b1+d0b0d2(1)+d1(1)+d0(1)d2+d1+d0(mod(b1)).{\displaystyle \operatorname {dr} _{b}(n)\equiv d_{2}b^{2}+d_{1}b^{1}+d_{0}b^{0}\equiv d_{2}(1)+d_{1}(1)+d_{0}(1)\equiv d_{2}+d_{1}+d_{0}{\pmod {(b-1)}}.}

To obtain the modular value with respect to other numbersm{\displaystyle m}, one can takeweighted sums, where the weight on thei{\displaystyle i}-th digit corresponds to the value ofbimodm{\displaystyle b^{i}{\bmod {m}}}. Inbase 10, this is simplest form=2,5, and 10{\displaystyle m=2,5,{\text{ and }}10}, where higher digits except for the unit digit vanish (since 2 and 5 divide powers of 10), which corresponds to the familiar fact that the divisibility of a decimal number with respect to 2, 5, and 10 can be checked by the last digit.

Also of note is the modulusm=b+1{\displaystyle m=b+1}. Sinceb1(mod(b+1)),{\displaystyle b\equiv -1{\pmod {(b+1)}},} and thusb2(1)21(mod(b+1)),{\displaystyle b^{2}\equiv (-1)^{2}\equiv 1{\pmod {(b+1)}},} taking thealternating sum of digits yields the value modulo(b+1){\displaystyle (b+1)}.

Using the floor function

[edit]

It helps to see the digital root of a positive integer as the position it holds with respect to the largest multiple ofb1{\displaystyle b-1} less than the number itself. For example, inbase 6 the digital root of 11 is 2, which means that 11 is the second number after61=5{\displaystyle 6-1=5}. Likewise, in base 10 the digital root of 2035 is 1, which means that20351=2034|9{\displaystyle 2035-1=2034|9}. If a number produces a digital root of exactlyb1{\displaystyle b-1}, then the number is a multiple ofb1{\displaystyle b-1}.

With this in mind the digital root of a positive integern{\displaystyle n} may be defined by usingfloor functionx{\displaystyle \lfloor x\rfloor }, as

drb(n)=n(b1)n1b1.{\displaystyle \operatorname {dr} _{b}(n)=n-(b-1)\left\lfloor {\frac {n-1}{b-1}}\right\rfloor .}

Properties

[edit]

Additive persistence

[edit]

Theadditive persistence counts how many times we mustsum its digits to arrive at its digital root.

For example, the additive persistence of 2718 inbase 10 is 2: first we find that 2 + 7 + 1 + 8 = 18, then that 1 + 8 = 9.

There is no limit to the additive persistence of a number in a number baseb{\displaystyle b}. Proof: For a given numbern{\displaystyle n}, the persistence of the number consisting ofn{\displaystyle n} repetitions of the digit 1 is 1 higher than that ofn{\displaystyle n}. The smallest numbers of additive persistence 0, 1, ... in base 10 are:

0, 10, 19, 199, 19 999 999 999 999 999 999 999, ... (sequenceA006050 in theOEIS)

The next number in the sequence (the smallest number of additive persistence 5) is 2 × 102×(1022 − 1)/9 − 1 (that is, 1 followed by 2 222 222 222 222 222 222 222 nines). For any fixed base, the sum of the digits of a number is proportional to itslogarithm; therefore, the additive persistence is proportional to theiterated logarithm.[1]

Programming example

[edit]

The example below implements the digit sum described in the definition above to search for digital roots and additive persistences inJava.

importjava.util.HashSet;publicclassDigitFunctions{// Sum of digits in base bstaticintdigitSum(intx,intb){inttotal=0;while(x>0){total+=x%b;x/=b;}returntotal;}// Digital root in base bstaticintdigitalRoot(intx,intb){HashSet<Integer>seen=newHashSet<>();while(!seen.contains(x)){seen.add(x);x=digitSum(x,b);}returnx;}// Additive persistence in base bstaticintadditivePersistence(intx,intb){HashSet<Integer>seen=newHashSet<>();while(!seen.contains(x)){seen.add(x);x=digitSum(x,b);}returnseen.size()-1;}// Example usagepublicstaticvoidmain(String[]args){intx=9876;intb=10;System.out.println("Digit Sum: "+digitSum(x,b));System.out.println("Digital Root: "+digitalRoot(x,b));System.out.println("Additive Persistence: "+additivePersistence(x,b));}}

In popular culture

[edit]

Digital roots are used in Westernnumerology, but certain numbers deemed to have occult significance (such as 11 and 22) are not always completely reduced to a single digit.

Digital roots form an important mechanic in the visual novel adventure gameNine Hours, Nine Persons, Nine Doors.

See also

[edit]

References

[edit]
  1. ^Meimaris, Antonios (2015),On the additive persistence of a number in base p, Preprint

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=Digital_root&oldid=1335910043"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp