how to calculate decimal expansion in a different base. found the period just not sure how to find the actual decimal expansion
let's take a number a in base 10:
if is a base ten expansion of a, then we may right a like so:
Now if we want to express a in terms of a base b expansion. we express a in terms of powers of b. This can be done by either brute force or modular exponentiation.
then we get
Haven's answer is the basic idea. Here's a short cut:
To write the number N in base b, divide N by b. The remainder will be a non-negative number less than b and will be the "ones place" in the expansion of N in base b. Divide that quotient by b. Again, the remainder is the next place in the expansion. Continue untill the quotient is itself less than b. That is the leading "digit" ("bigit"?) in the expansion.
For example, to write 10323 in base 7:
Divide 10323 by 7. That gives quotient 1474 with remainder 5. Divide 1474 by 7. That gives quotient 210 with remainder 4. Divide 210 by 7. That gives quotient 30 with remainder 0. Divide 30 by 7. That gives quotient 4 with remainder 2. Since that quotient is less than 7, we are done. We only need to put those numbers together. .
That works because saying that "10323 divided by 7 gives quotient 1474 with remainder 5" means that 10323= 7(1474)+ 5. And "dividing 1474 by 7 gives quotient 210 with remainder 4" means that 1474= 7(210)+ 4. Putting that into the previous equation, 10323= 7(7(210)+ 4)+ 5. "Dividing 210 by 7 gives quotient 30 with remainder 0" means that 210= 7(30)+ 0. Putting that into the previous equation gives 10323= 7(7(7(30)+0)+4)+ 5. "Dividing 30 by 7 gives quotient 4 with remainder 2" means that 30= 7(4)+ 2. Putting that into the previous equation gives 10323= 7(7(7(7(4)+2)+0)+4)+ 5 and that is the same as exactly what Haven said and exactly what "base 7" means.