The only algorithm I'm aware of is :
digitsum(N,base) :
sum = 0
while N != 0
sum = N % base
N = N / base
return sum
which obviously isn't efficient.
On Sep 26, 2:12 am, Mgccl <[EMAIL PROTECTED]> wrote:
> is there a known, efficient digit sum algorithm exist for any base.
> Input any number and base, it will return the digit sum in that base?
> please tell if you know anything about this :)
> thxhttp://mathworld.wolfram.com/DigitSum.html
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---