You are viewing a single comment's thread. Return to all comments →
Amazing, but using recursive function, it could be written in Python as
def superDigit(n, k): if len(str(n)) == 1: return n return superDigit(sum([int(i) for i in list(str(n))])*k,1)
def superDigit(n, k):
if len(str(n)) == 1: return n return superDigit(sum([int(i) for i in list(str(n))])*k,1)
Seems like cookies are disabled on this browser, please enable them to open this website
Recursive Digit Sum
You are viewing a single comment's thread. Return to all comments →
Amazing, but using recursive function, it could be written in Python as