I want to find 4655 in base -3. Does this mean I would first find it in base 10 or is that already in that? In that case I have tried to find out what it is and I got this as my number "-64". Is my number correct or did I get the wrong one?
Asked
Active
Viewed 58 times
2 Answers
2
Just find the remainder of division by $3$, taking the positive or negative remainder, alternatively at each steps :
- $4655=3\cdot1551+2$
- $1551=3.517-0$
- $517=3\cdot 172+1$
- $172=3\cdot58-2$
- $58=3\cdot19+1$
- $19=3\cdot7-2$
- $7=3\cdot2+1$
- $2=3\cdot1-1$
- $1=3\cdot0+1$
Hence $4655_{10}=111212102_{-3}$
(If your first number $x$ is negative, use $-x$ and begins with the negative remainder instead of the positive one)
Xoff
- 10,310
-
Smart approach. I didn't know you could jut do that for base conversion. – Newb Dec 10 '13 at 23:34
1
If there are no other assuptions or notations the number 4655 is in base 10. If the digits in base -3 are required to be 0,1,2 the number 4655 can be written as $111212102_{-3}$ because
$$4655 = 2(-3)^0 + 0(-3)^1 + 1(-3)^2+ 2(-3)^3+ 1(-3)^4+ 2(-3)^5+ 1(-3)^6+ 1(-3)^7 +1(-3)^8$$ $$4655 = 2 + 9 - 54 + 81 - 486 + 729 -2187 +6561$$ In Ch. 4.1 of Knuth's Seminumerical algorithms there a few statements about positional number systems with negative base (even to base $2i$).
gammatester
- 18,827