Algorithm for digit summing?

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2010-04-21T22:05:11Z Indexed on 2010/04/21 22:13 UTC
Read the original article Hit count: 450

Filed under:
|
|

I'm searching for an algorithm for Digit summing. Let me outline the basic principle:

Say you have a number: 18268.

1 + 8 + 2 + 6 + 8 = 25

2 + 5 = 7

And 7 is our final number. It's basically adding each number of the whole number until we get down to a single (also known as a 'core') digit. It's often used by numerologists.

I'm searching for an algorithm (doesn't have to be language in-specific) for this. I have searched Google for the last hour with terms such as digit sum algorithm and whatnot but got no suitable results.

Any help would be great, thanks.

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about digit