Recursive Digit Sum

  • + 4 comments

    PHP Solution

    return bcmod(bcmul($n,$k),'9')?:9;