Thanks to Andy and the others for their help! I was able to implement a routine for the problem I was working on; I'll address that in another post. Kerry -- lkmitch@gmail.com www.kerrymitchellart.com On Tue, Jul 12, 2011 at 9:51 AM, Andy Latto <andy.latto@pobox.com> wrote:
On Tue, Jul 12, 2011 at 11:22 AM, Kerry Mitchell <lkmitch@gmail.com> wrote:
Hi,
Using the digits {0, 1} and the complex base -1+i, it's straightforward to show that 1010 = 1+3i. Is there an easy way to go backward? That is, given a complex number in the form a+bi, recover its "binary" representation? I'm immediately interested in the case for bases -1+i and -1-i (digits {0, 1}), but also interested in the general case.
The standard procedure for converting a number to another base works fine. If we want to express a number N in base B, divide N by B, finding Q and R such that
(*) N = B.Q + R
where R is a digit. Then find the base-B representation of Q, and add an R on the end. If (*) always has a solution, then any number can be represented in that base with that digit set. If the solution of (*) is always unique, the representation is unique.
Andy