Recursive Digit Sum

  • + 4 comments

    Totally agree with you. Here's what I did in Python:

    def superDigit(n, k):
        if len(n)==1:
            return n
        return superDigit(str(sum(map(int, n))*k),1)