• LeFrog
    link
    fedilink
    English
    arrow-up
    29
    ·
    edit-2
    1 month ago

    Wow I never thought about that.

    But it is always like this:

    let there be any base "b"
    That can represent a number by the sum of their positional digits:
    
    number = sum(d_i * b ^ i)
       where i is the position index and d_i is the digit at this position. (note: index starts with 0, from the least digit farthest to the right)
    

    So the (decimal) number 4 in base 4 is then

    1×4¹ + 0×4^0 = 10
    

    And (decimal) number 8 in base 8 is

    1×8¹ + 0×8^0 = 10
    

    And 10 in base 10:

    1×10¹ + 0×10^0 = 10