Jump to content

Digital root

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Prova-nome (talk | contribs) at 14:59, 11 October 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The digital root (also repeated digital sum) of a natural number in a given number base is the (single digit) value obtained by an iterative process of summing 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 65,536 is 7, because 6 + 5 + 5 + 3 + 6 = 25 and 2 + 5 = 7.

Digital roots can be calculated with congruences in modular arithmetic rather than by adding up all the digits, a procedure that can save time in the case of very large numbers.

Digital roots can be used as a sort of checksum, to check that a sum has been performed correctly. If it has, then the digital root of the sum of the given numbers will equal the digital root of the sum of the digital roots of the given numbers. This check, which involves only single-digit calculations, can catch many errors in calculation.

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

The number of times the digits must be summed to reach the digital root is called a number's additive persistence; in the above example, the additive persistence of 65,536 in base 10 is 2.

Formal definition

Let be a natural number. We define the digit sum for base to be the following:

where is the number of digits in the number in base , and

is the value of each digit of the number. A natural number is a digital root if it is a fixed point for , which occurs if .

For example, in base , 8 is the multiplicative digital root of 1853, as

All natural numbers are preperiodic points for , regardless of the base. This is because if , then

and therefore

because . If , then trivially

Therefore, the only possible digital roots are the natural numbers , and there are no cycles other than the fixed points of .

Direct formulas

Congruence formula

The formula in base is:

or,

In base 10, the corresponding sequence is (sequence A010888 in the OEIS).

The digital root is the value modulo because and thus so regardless of position, the value is the same – – which is why digits can be meaningfully added. Concretely, for a three-digit number

.

To obtain the modular value with respect to other numbers , one can take weighted sums, where the weight on the -th digit corresponds to the value of modulo . In base 10, this is simplest for 2, 5, and 10, where higher digits vanish (since 2 and 5 divide 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 (even numbers end in 0, 2, 4, 6, or 8).

Also of note is the modulus : since and thus taking the alternating sum of digits yields the value modulo .

Using the floor function

It helps to see the digital root of a positive integer as the position it holds with respect to the largest multiple of less than the number itself. For example, in base 6 the digital root of 11 is 2, which means that 11 is the second number after . Likewise, in base 10 the digital root of 2035 is 1, which means that . If a number produces a digital root of exactly , then the number is a multiple of .

With this in mind the digital root of a positive integer may be defined by using floor function , as

Additive persistence

The additive persistence counts how many times we must sum its digits to arrive at its digital root.

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

There is no limit to the additive persistence of a number. (proof: For a given number , the persistence of the number consisting of repetitions of the digit 1 is 1 higher than that of ). The smallest numbers of additive persistence 0, 1, ... are:

0, 10, 19, 199, 19999999999999999999999, ... (sequence A006050 in the OEIS)

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 2222222222222222222222 9's). For any fixed base, the sum of the digits of a number is proportional to its logarithm; therefore, the additive persistence is proportional to the iterated logarithm.[1]

Some properties of digital roots

The digital root of a number is zero if and only if the number is itself zero.

The digital root of a number is a positive integer if and only if the number is itself a positive integer.

The digital root of is itself if and only if the number has exactly one digit.

The digital root of is less than if and only if the number is greater than or equal to 10.

The digital root of + is digital root of the sum of the digital root of and the digital root of .

The digital root of - is congruent with the difference of the digital root of and the digital root of modulo 9.

Especially, we can define the digital root of minus as follows:

The digital root of nonzero single digit numbers is given by the Vedic Square.

1 2 3 4 5 6 7 8 9
1 1 2 3 4 5 6 7 8 9
2 2 4 6 8 1 3 5 7 9
3 3 6 9 3 6 9 3 6 9
4 4 8 3 7 2 6 1 5 9
5 5 1 6 2 7 3 8 4 9
6 6 3 9 6 3 9 6 3 9
7 7 5 3 1 8 6 4 2 9
8 8 7 6 5 4 3 2 1 9
9 9 9 9 9 9 9 9 9 9

The digital root of is digital root of the product of the digital root of and the digital root of .

  • The digital root of a nonzero number is 9 if and only if the number is itself a multiple of 9.
  • The digital root of a nonzero number is a multiple of 3 if and only if the number is itself a multiple of 3.
  • The digital root of a square is 1, 4, 7, or 9. Digital roots of square numbers progress in the sequence 1, 4, 9, 7, 7, 9, 4, 1, 9.
  • The digital root of a perfect cube is 1, 8 or 9, and digital roots of perfect cubes progress in that exact sequence.
  • The digital root of integers raised to integer powers greater than 3 is 1, 2, 4, 5, 7, 8 or 9.
  • The digital root of a prime number (except 3) is 1, 2, 4, 5, 7, or 8.
  • The digital root of a power of 2 is 1, 2, 4, 5, 7, or 8. Digital roots of the powers of 2 progress in the sequence 1, 2, 4, 8, 7, 5. This even applies to negative powers of 2; for example, 2 to the power of 0 is 1; 2 to the power of -1 (minus one) is .5, with a digital root of 5; 2 to the power of -2 is .25, with a digital root of 7; and so on, ad infinitum in both directions. This is because negative powers of 2 share the same digits (after removing leading zeroes) as corresponding positive powers of 5, whose digital roots progress in the sequence 1, 5, 7, 8, 4, 2.
  • The digital root of a power of 5 is 1, 2, 4, 5, 7 or 8. Digital roots of the powers of 5 progress in the sequence 1, 5, 7, 8, 4, 2. This even applies to negative powers of 5; for example, 5 to the power of 0 is 1; 5 to the power of -1 (minus one) is .2, with a digital root of 2; 5 to the power of -2 is .04, with a digital root of 4; and so on, ad infinitum in both directions. This is because the negative powers of 5 share the same digits (after removing leading zeroes) as corresponding positive powers of 2, whose digital roots progress in sequence 1, 2, 4, 8, 7, 5.
  • The digital roots of powered numbers progress in sequence (only certain for positive powers, although in for some exceptions it also may occur for negative powers), and this is because of one of the previously shown properties. As the digital root of a b is congruent with the multiple of the digital root of a and the digital root of b modulo 9, the digital root of a a will also do it. So, for example, as shown above, powers of 2 will follows the sequence 1, 2, 4, 8, 7, 5; Powers of 47 (whose digital root is 2) will also follow this sequence. The very sequence follows this rule, and is applicable to any other number. Hence, it is easy to demonstrate that an integer raised to a positive integer power will never have a digital root of 3 or 6.
  • The digital root of an even perfect number (except 6) is 1.
  • The digital root of a centered hexagram, or star number is 1 or 4. Digital roots of star numbers progress in the sequence 1, 4, 1.
  • The digital root of a centered hexagonal number is 1 or 7, their digital roots progressing in the sequence 1, 7, 1.
  • The digital root of a triangular number is 1, 3, 6 or 9. Digital roots of triangular numbers progress in the sequence 1, 3, 6, 1, 6, 3, 1, 9, 9, which is palindromic after the first eight terms.
  • The digital root of Fibonacci numbers is a repeating pattern of 1, 1, 2, 3, 5, 8, 4, 3, 7, 1, 8, 9, 8, 8, 7, 6, 4, 1, 5, 6, 2, 8, 1, 9.
  • The digital root of Lucas numbers is a repeating pattern of 2, 1, 3, 4, 7, 2, 9, 2, 2, 4, 6, 1, 7, 8, 6, 5, 2, 7, 9, 7, 7, 5, 3, 8.
  • The digital root of the product of twin primes, other than 3 and 5, is 8. The digital root of the product of 3 and 5 (twin primes) is 6.

In other bases

This article is about the digital root in decimal or base ten, hence it is the number mod 9. It is nothing different as the number converted to base 9 and then only the last digit taken. In other radixes the digital root is number mod (base-1) so in base 12 a digital root of a number is the number mod 11 (Ɛduod), for example, 1972duod is 1 + 9 + 7 + 2 = 19 = 17duod which is 1 + 7 = 8, while in decimal the root of the same number (3110) is 5; and in base 16 a digital root of a number is the number mod 15 (0xF), for example, 0x7DF is 7 + 13 + 15 = 35 = 0x23 which is 2 + 3 = 5, while in decimal the root of the same number (2015) is 8.

Programming example

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

def digit_sum(x, b):
    if x == 0:
      return 0
    total = 1
    while x > 0:
        total = total + (x % b)
        x = x // b
    return total

def digital_root(x, b):
    seen = []
    while x not in seen:
        seen.append(x)
        x = digit_sum(x, b)
    return x

def additive_persistence(x, b):
    seen = []
    while x not in seen:
        seen.append(x)
        x = digit_sum(x, b)
    return len(seen) - 1

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

See also

References

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