• + 0 comments

    The multiple sought belongs to the list: {9x1, 9x10, 9x11, 9x100, 9x101, ...} We notice that {1, 10, 11, 100, 101, ...} are the binary writings of the numbers {1, 2, 3, 4, 5, ...}

    def solve(n):
        i = 1
        res = 9*int(bin(i)[2:])
        while res % n:
            i = i + 1
            res = 9*int(bin(i)[2:])
        return str(res)