I've studied binary-- a number represented by $1$'s and $0$'s. (like $1010_2=10_{10}$) i know you can represent numbers in other bases(base 3, base 16, base 36) I was wondering--is there an easy way to convert between bases? as an example, convert 12045732 to base-37 (i used a random number generator)
Asked
Active
Viewed 2,539 times
0
-
1What do you define as "easy"? There are algorithms to do this, is this what you're looking for? – Michael Burr Apr 21 '17 at 12:25
-
what method do you know/use so far for converting? – supinf Apr 21 '17 at 12:32
-
1You can use online calculators such as this one from cut-the-knot which perform common conversions or you can use WolframAlpha to perform all conversions (using this syntax and replacing the numbers with your own – lioness99a Apr 21 '17 at 12:37
1 Answers
1
To convert $12045732$ to base $37$:
Compute the remainder of $12045732$ divided by $37$. The remainder is $12$. This is your ones element.
Subtract the remainder of $12$ from $12045732$ and divide by $37$. The result is $325560$.
Go back to $1$. with this new number and continue to get the $37$'s digit, and so on.
In this case, you get $(6)(15)(29)(34)(12)$. In other words, $$ 12045732=6\cdot 37^4+15\cdot37^3+29\cdot37^2+34\cdot 37+12. $$
Michael Burr
- 32,867