[Jump to code hierarchy]

Casting-out-nines code

Alternative Names: Check of nines, Proof by nines.

Description

Arithmetic residue code with check base nine for decimal integers, whose residue is the repeated sum of their decimal digits [1; pp. 180-181]. Since \(10\equiv 1\) modulo nine, a number and its digit sum leave the same remainder [1; pp. 181-183].

The Mahasiddhanta of Aryabhata II (c. 950) checked multiplication, division, and root extraction by digit sums [1; pp. 180-184]. This is the earliest available description of a check of both direct and inverse arithmetical operations [1; pp. 180-181]. Avicenna (c. 1020) gave a complete set of rules for testing all operations by nines [1; p. 184]. Fibonacci’s Liber Abaci (1202) checked sums and products by casting out nines [3][2; Chs. 2 and 3].

Protection

A mismatch of digit sums proves an error, but a match does not prove that a result is correct [3]. Transposed digits and a digit changed between 0 and 9 preserve the digit sum modulo nine and go undetected.

Cousin

Primary Hierarchy

Parents
The casting-out-nines code is the arithmetic residue code with check base nine for decimal integers, whose residue is the digit sum modulo nine [1; pp. 181-183].
Casting-out-nines code

References

  1. [1]

    B. Datta and A. N. Singh, History of Hindu Mathematics: A Source Book, Part 1 (Asia Publishing House, 1962) URL

  2. [2]

    L. Sigler, Fibonacci’s Liber Abaci (Springer New York, 2002) DOI

  3. [3]

    E. Burattini, “Fibonacci’s Computation Methods vs Modern Algorithms”, Reti Medievali Rivista 14, 211 (2013) DOI

  4. [4]

    W. W. Peterson, “Error-Correcting Codes”, Scientific American 206(2), 96–111 (1962) URL

  5. [5]

    J. H. Conway and R. K. Guy, The Book of Numbers (Springer New York, 1996) DOI

Page edit log

Your contribution is welcome!

on github.com (edit & pull request)

— see instructions

Zoo Code ID: casting_out_nines

Cite as:
“Casting-out-nines code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2026. https://errorcorrectionzoo.org/c/casting_out_nines, arXiv:2606.11484
BibTeX:
@incollection{eczoo_casting_out_nines,
title={Casting-out-nines code},
booktitle={The Error Correction Zoo},
year={2026},
editor={Albert, Victor V. and Faist, Philippe},
eprint={2606.11484},
doi={10.48550/arXiv.2606.11484},
url={https://errorcorrectionzoo.org/c/casting_out_nines}
}
Share via:
Twitter | Mastodon |  | E-mail
Permanent link:
https://errorcorrectionzoo.org/c/casting_out_nines

Cite as:

“Casting-out-nines code”, The Error Correction Zoo (V. V. Albert & P. Faist, eds.), 2026. https://errorcorrectionzoo.org/c/casting_out_nines, arXiv:2606.11484

Github: https://github.com/errorcorrectionzoo/eczoo_data/edit/main/codes/classical/rings/over_zq/arithmetic/casting_out_nines.yml.