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
- \([n,n-1,2]\) Single parity-check (SPC) code— SPCs are the mod-two version of the casting-out-nines code [4,5].
Member of code lists
Primary Hierarchy
References
- [1]
B. Datta and A. N. Singh, History of Hindu Mathematics: A Source Book, Part 1 (Asia Publishing House, 1962) URL
- [2]
L. Sigler, Fibonacci’s Liber Abaci (Springer New York, 2002) DOI
- [3]
E. Burattini, “Fibonacci’s Computation Methods vs Modern Algorithms”, Reti Medievali Rivista 14, 211 (2013) DOI
- [4]
W. W. Peterson, “Error-Correcting Codes”, Scientific American 206(2), 96–111 (1962) URL
- [5]
J. H. Conway and R. K. Guy, The Book of Numbers (Springer New York, 1996) DOI
Page edit log
- Victor V. Albert (2026-11-11) — most recent
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