# your code goes here
def from_base_ten(arb, base):
    # Special cases
    if arb == 0:
        return [0]
    if abs(base) == 1:
        return [0] * arb
    # Main routine
    base_list = []
    it = reversed(from_base_ten(arb, base * base) if abs(arb) >= abs(base) else [arb])
    digit = next(it)
    clock = 0
    work = 0
    while clock >= 0 or work != 0:
        if clock == 0:
            work += digit
            try:
                digit = next(it)
                clock = 2
            except StopIteration:
                digit = 0
        clock -= 1
        work, remainder = divmod(work, base)
        if remainder < 0:
            work += 1
            remainder -= base
        if work == -1 and base > 0:
            work = 0
            remainder -= base
        base_list.append(remainder)
    return base_list[::-1]

from_base_ten(1,0)