-4
$\begingroup$

In one of my programs I have a function I call reduce(n) which associates to n the recursive sum of n's digits until this sum is one digit long. For example:

  • 12 -> [1, 2] => 3
  • 149 -> [1, 4, 9} -> 14 -> [1, 4] => 5
  • and so on

Is there an official name for this operation ?

$\endgroup$
3
  • 3
    $\begingroup$ Digital root: en.wikipedia.org/wiki/Digital_root $\endgroup$ Aug 1 at 16:08
  • 2
    $\begingroup$ Also called "casting out nines" en.wikipedia.org/wiki/Casting_out_nines $\endgroup$ Aug 2 at 12:39
  • 1
    $\begingroup$ As @GeraldEdgar comments: definitely "casting out nines"... is the name this procedure (and extensions) has and has had for more than 100 years in the U.S. My grandparents (fairly literate, born c. 1890) knew this procedure (as a way to check accuracy of arithmetic... since this process gives a ring homomorphism of the integers to the integers mod 9). $\endgroup$ Aug 4 at 21:18
4
$\begingroup$

A 5 second Google (is your friend) shows the operation referred to as digit sum or sum of digits. WA even has an operator that performs this.

https://www.google.com/search?&q=sum+of+digits

Tangentially related, you might also look at the concept of the checksum. I'm familiar with that from military navigation/targeting, but the wiki article discusses a lot of other uses. It's tangential, I guess since, per wiki, the checksum is not forced down recursively to a single digit. (Although I've seen some military use where it was, because the field had a defined digit size of 1.)

https://en.wikipedia.org/wiki/Checksum

$\endgroup$
2
  • 2
    $\begingroup$ I glanced at your answer for maybe 2 seconds, then clicked away to other questions, assuming your search was for "digital sum" (term I know it by). A few seconds later I wondered how difficult it might be to find this term if one didn't know the term "digital sum" to begin with, and the very first phrase I tried was "sum of digits", which worked like a charm. I returned to write a comment to your answer, for the OP, saying that while it might appear that one would have to know the term before searching for it, the first thing I tried worked perfectly. Then I saw what your search was for . . . $\endgroup$ Aug 1 at 14:14
  • 1
    $\begingroup$ --Add up digits-- works also. $\endgroup$
    – guest
    Aug 1 at 15:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.