The math behind converting from any base to any base without going through base 10?
This seems a very basic question to me, so excuse me if I lecture you a bit. The most important point for you to learn here is that a number is not its digit representation. A number is an abstract mathematical object, whereas its digit representation is a concrete thing, namely a sequence of symbols on a paper (or a sequence of bits in compute memory, or a sequence of sounds which you make when you communicate a number). What is confusing you is the fact that you never see a number but always its digit representation. So you end up thinking that the number is the representation.
Therefore, the correct question to ask is not &quot;how do I convert from one base to another&quot; but rather &quot;how do I find out which number is represented by a given string of digits&quot; and &quot;how do I find the digit representation of a given number&quot;.
So let us produce two functions in Python, one for converting a digit representation to a number, and another for doing the opposite. Note: when we run the function Python will of course print on the screen the number it got in base 10. But this does not mean that the computer is keeping numbers in base 10 (it isn't). It is irrelevant how the computer represents the numbers.
def toDigits(n, b):
    &quot;&quot;&quot;Convert a positive number n to its digit representation in base b.&quot;&quot;&quot;
    digits = []
    while n &gt; 0:
        digits.insert(0, n % b)
        n  = n // b
    return digits

def fromDigits(digits, b):
    &quot;&quot;&quot;Compute the number given by digits in base b.&quot;&quot;&quot;
    n = 0
    for d in digits:
        n = b * n + d
    return n

Let us test these:
&gt;&gt;&gt; toDigits(42, 2)
[1, 0, 1, 0, 1, 0]
&gt;&gt;&gt; toDigits(42, 3)
[1, 1, 2, 0]
&gt;&gt;&gt; fromDigits([1,1,2,0],3)
42

Armed with conversion functions, your problem is solved easily:
def convertBase(digits, b, c):
    &quot;&quot;&quot;Convert the digits representation of a number from base b to base c.&quot;&quot;&quot;
    return toDigits(fromDigits(digits, b), c)

A test:
&gt;&gt;&gt; convertBase([1,1,2,0], 3, 2) 
[1, 0, 1, 0, 1, 0]

Note: we did not pass through base 10 representation! We converted the base $b$ representation to the number, and then the number to base $c$. The number was not in any representation. (Actually it was, the computer had to represent it somehow, and it did represent it using electrical signals and funky stuff that happens in chips, but certainly those were not 0's and 1's.)