You are viewing a single comment's thread. Return to all comments →
Python one-liner with recursion:
return n if k == 1 and n < 10 else superDigit(k * sum(int(d) for d in list(str(n))), 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 →
Python one-liner with recursion:
return n if k == 1 and n < 10 else superDigit(k * sum(int(d) for d in list(str(n))), 1)