* Lucas, Stephen K - lucassk <lucassk@jmu.edu> [Apr 28. 2018 09:09]:
Joerg,
Yes, you have the reference correct to Katai & Szabo. If you read their proof carefully, you discover that they essentially use a carry rule to represent a Gaussian integer in base -n+i, and prove existence and uniqueness. But explicitly writing things in terms of a carry rule makes number conversion and arithmetic much easier to deal with.
Thanks!
I must admit, after looking back at your list of representations in base 2+i using {1,-1,i,-1,0}, I’m intrigued at how you came up with the digits. It is far from obvious, and the number of digits going up then down is bizarre!
I am doing this in a truly brain-dead way: testing every possible digit! Here is my (UGLY) pari/gp code to do this: ----------- to_rdx(n, rx, dg)= /* convert n into radix rx expansion using digits given in dg[] */ { my(d, t, v, ct, i); i = 1; v = vector(30); /* vector of digits, must be long enough */ while ( n != 0, for (j=1, #dg, \\ for each digit d... \\ test whether denom((n-d)/rx)==1: d = dg[j]; t = (n - d) / rx; dt = denominator(t); if ( dt == 1, v[i] = d; i += 1; n = t; break(); ); \\ no digit worked: if ( j==#dg, error(" radix rx and digit set dg[] are not compatible") ); ); ); v = vector(i-1, k, v[k]); /* reverse digits */ return(v); } /* ----- */ from_rdx(v, rx, dg)= /* inverse of to_rdx(), for testing */ { return( sum(j=1, #v, v[j] * rx^(j-1) ) ); } \\ Our parameters: rx=+2+I; dg=[0,+1,-1,+I,-I]; { for (n=-33, 125, x = n; v=to_rdx(x, rx, dg); m=from_rdx(v, rx, dg); print(x,": ",v); if ( x!=m, error("Epic fail!") ); ); } ----------- Oh, there is s reference in that file: \\ From: rcs@xmission.com \\ To: math-fun@mailman.xmission.com \\ Subject: Re: [math-fun] Converting numbers with complex bases \\ cf. Message-ID: <20110713000524.2e83jckd4cgw400g@webmail.xmission.com> The message my code seems to refer to is this one: -----------
Date: Tue, 12 Jul 2011 12:51:50 -0400 From: Andy Latto <andy.latto@pobox.com> To: math-fun <math-fun@mailman.xmission.com> Reply-To: math-fun <math-fun@mailman.xmission.com> Subject: Re: [math-fun] Converting numbers with complex bases X-Spam-Score: -3.3 (---)
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
Best regards, jj
Steve
[...]