• + 0 comments

    JS

    function superDigit(n, k) {
        let sum = n.split('').reduce((a, s) => a + Number(s), 0);
        let next = (sum * k) + "";
        return (next.length == 1) 
            ? Number(next) : superDigit(next, 1);
    }