Digit sum

As a cross- sum ( or sum of digits ) typically refers to the sum of the digits of a natural number values ​​. Thus, for a number n = 36036, the decimal sum of the digits q (n ) = 3 6 0 3 6 = 18 The sum of the digits is (as well as the cross product) depending on the payment system used.

In addition to the sum of the digits as the sum of the digits of values ​​we have

  • The alternating sum of digits varies ( adding and subtracting the numeric values)
  • Operations with digit pairs, triples, etc.
  • Locally weighted method
  • 3.1 -digit (or iterated ) checksum
  • 3.2 Alternating checksum
  • 3.3 Nichtalternierende k- checksum
  • 3.4 Alternating k- checksum
  • 3.5 Weighted sum of the digits

Graph History

The graph of the sum of digits function q ( n ) has a characteristic course. In the decimal he rises for ten consecutive n ending in 0-9 steadily - per step by 1 - to, to then drop a number of step length. The lowest and highest of the increase margin shift, focusing mainly on from time to time up by 1.

This behavior is repeated in each of ten. At 10, 100, 1000 and so falls q (n ) is always returned to the first result is a self-similarity of the graph.

Only for n = 0, q (n ) = 0, for all larger numbers q ( n ) ≥ 1 Upwardly is not limited q (n).

Application

For each entry and transfer of numbers technical or human errors may occur. Therefore, test methods exist to ensure data integrity. A simple checksum measure is to form the sum of the digits.

Check digit of the ISBN

The weighted with the factors ( 10,9,8,7,6,5,4,3,2,1 ) checksum of a ISBN10 ( obsolete version ) modulo 11 is always 0 ( the numeral 'X ' here has the numerical value of 10 and can occur in the last digit ). This is achieved by the first nine numbers describe the product, and a 10 digit ( check digit) is attached so that the above requirement is fulfilled.

Example: For the ISBN 3442542103

So this is a (formal) valid ISBN.

Checksum set

  • Be given the following: a place value system to the base number n 1 (where ),
  • T is a divisor of n (where ),
  • A natural number a
  • The number a is divisible by t if and only if sum of its digits (in this place value system ) is divisible by t.

For example, in the decimal system the radix of 10, ie n = 9 This is t ∈ { 1,3,9 }. Consequently, one can apply the checksum mechanism for verifying the divisibility by 3 and 9.

In the hexadecimal system, n = 15 This is t ∈ { 1,3,5,15 }. Thus one can control the checksum in hexadecimal to check the divisibility by 3, apply by 5 and 15.

In general, the sum of the digits of the representation of a number in the place value system with the base modulo leaves unchanged the rest, so

And the alternating sum of the digits of the representation in the place value system with the base modulo leaves unchanged the rest, so

Special case: nines

For the divisibility of a number by 3 or 9 can representative sum of its digits are used: A number n is represented exactly in decimal then by 3 or 9 divisible if its cross sum q (n) without remainder by 3 and 9 is divisible. Generally, it can n when divided by 3 or 9 the same remainder as the sum of the digits q (n):

( Or in other words, the difference of a number and its checksum is always divisible by 9. )

Other types

Digit (or iterated ) checksum

From the simple checksum the checksum will continue as long formed until only one digit remains.

Example:

If the sum of the digits of a number k is a multi-digit number, can the process repeated as many times until the result has only one digit in each number system. For the thus generated ( always digits ) iterated checksums (t is as above again the base of the number system - 1):

Example, in the decimal system:

And it's

In particular, a positive natural number that is divisible by 9 if and only if their cross- iterated sum in the decimal system is 9.

See also: the hash function and the method mentioned therein.

Alternating sum of the digits

The alternating sum of the digits (including cross- difference, cross- couple sum or alternating sum called ) is obtained by taking the digits of a number alternately subtracted and added. In this case, the left or right to start. In the following, starting from the right. Thus, for the number n = 36036, the alternating sum of the digits aqs (n) = 6-3 0-6 3 = 0

Equivalent to the following procedure ( the count of digits to the right start again ):

For the divisibility of a number by 11 n can representative their alternating sum of the digits aqs (s ) can be used: A number n decimal shown is divisible by 11 if and only if their alternating sum of the digits aqs ( n ) is divisible without remainder by 11.

Repeated application of the alternating sum of the digits of the number returns the remainder when divided by 11, with negative values ​​by the addition of 11 to normalize. A aqs of 11 draws a further form a aqs according to which returns 0 (ie, the remainder of the division of 11 by 11).

Example:

N = 2536874 4 8 3 2 = 17 7 6 5 = 18 17-18 = -1; -1 11 = 10 it follows: the number 2536874 when divided by 11 leaves the remainder 10, so it is not divisible by 11.

Nichtalternierende k- checksum

The nichtalternierende 2- cross sum of n = 36036, q = 3 60 36 = 99 For all divisors of 99, so for 3, 9, 11, 33 and 99, it is a divisibility: The nichtalternierende 2- cross sum of q decimal number n is divisible by these numbers if and only if n is divisible by.

The nichtalternierende 3- cross sum of n = 36036, q = 36 036 = 72 For all divisors of 999, so for 3, 9, 27, 37, 111, 333 and 999, it is a divisibility: The nichtalternierende 3- checksum q a decimal number n is divisible by these numbers if and only if n is divisible by.

Note: The nichtalternierende k- cross sum is identical to nichtalternierende checksum to the base. It provides a divisibility for all divisors of.

Alternating k- checksum

The alternating 2- cross sum of n = 36036, q = 3-60 36 = -21. For 101 it is a divisibility: The alternating sum of the digits 2- q a decimal number n is exactly divisible then by 101, if n is divisible by 101.

The alternating 3- cross sum of n = 36036 q = -36 036 = 0 for all divisors of 1001, so for 7, 11, 13, 77, 91, 143 and 1001, it is a divisibility: The alternating 3- sum of the digits of a decimal number n q if and only divisible by these numbers if n is divisible by the numbers.

Note: The alternating k- cross sum is identical to the alternating sum of the digits to the base. It provides a divisibility for all divisors of.

Weighted sum of the digits

A generalization are weighted cross- sums, where the digits multiplied only with the values ​​of a sequence of numbers and these results are then added together. It is in this case started with the least significant digit ( in the simple sum of the digits, the order does not matter). The weighting sequence can be periodic or non-periodic. An example is the periodic sequence 1, 3, 2, -1, -3, -2, ..., the weighted sum of the digits in the number 422625 is (at the lowest point started ):

The so- weighted checksum provides a divisibility for the number 7 also for other natural numbers one can find such periodic sequences, for example

  • 11 for the sequence 1, -1, ... This provides the so-called alternating sum of the digits
  • 13 for the sequence 1, -3, -4, -1, 3, 4, ...

However, for most divider it is not practical to check the divisibility by cross summation, because there are few good noticeable periodic weighting consequences.

If you want to find an appropriate divisibility for the natural number m, so if one considers the remains of the powers of 10 when divided by m. The residues corresponding to the desired weights.

Example: m = 7

The weighting sequence is thus 1, 3, 2, -1, -3, -2, ...

52934
de