Nice complex numbers

I will call a complex number nice if both the number and its multiplicative inverse have finite decimal representations. In other words, if $z=a+bj$, then the real and imaginary components of both $z$ and $z^{-1}$ have terminating decimal representations.

We will first consider complex numbers of the form $z=\alpha+\beta j$, where $\alpha$ and $\beta$ are relatively prime integers. We need consider only one representative with $\alpha\geq\beta\geq 0$, since swapping the real and imaginary components or independently changing their signs produces other nice complex numbers.

Now,

$$ z^{-1} = \frac{1}{\alpha+\beta j} = \frac{\alpha-\beta j}{\alpha^2+\beta^2}. $$

A rational number has a terminating decimal representation if and only if its denominator, after cancellation, has no prime factors other than $2$ and $5$. Since $\alpha$ and $\beta$ are relatively prime, no prime can divide both $\alpha$ and $\alpha^2+\beta^2$, and similarly no prime can divide both $\beta$ and $\alpha^2+\beta^2$. Consequently, no factors in the denominator can be cancelled from both components of $z^{-1}$. Therefore, $z^{-1}$ has finite decimal components precisely when

$$ |z|^2=\alpha^2+\beta^2=2^r5^s $$

for some non-negative integers $r$ and $s$.

The requirement that $\alpha$ and $\beta$ be relatively prime places a further restriction on $r$. If $r\geq 2$, then $\alpha^2+\beta^2$ is divisible by $4$. A square is congruent to either $0$ or $1$ modulo $4$, so this is possible only if both $\alpha$ and $\beta$ are even, contradicting the assumption that they are relatively prime. Thus $r$ can only be $0$ or $1$. Every primitive nice complex number therefore satisfies either

$$ \alpha^2+\beta^2=5^k $$

or

$$ \alpha^2+\beta^2=2\cdot5^k. $$

Why is there only one solution for each $k$?

This follows particularly neatly from the Gaussian integers. These are complex numbers $a+bj$ whose real and imaginary components are integers. The Gaussian integers have unique factorization, and in them

$$ 5=(2+j)(2-j). $$

Suppose first that

$$ \alpha^2+\beta^2=5^k. $$

Since

$$ \alpha^2+\beta^2 =(\alpha+\beta j)(\alpha-\beta j), $$

the prime factors of $\alpha+\beta j$ can only be $2+j$ and $2-j$, apart from multiplication by one of the Gaussian units $\pm1,\pm j$. Thus

$$ \alpha+\beta j =u(2+j)^r(2-j)^{k-r}, $$

where $u\in\{1,-1,j,-j\}$.

If both $r>0$ and $k-r>0$, then $\alpha+\beta j$ is divisible by

$$ (2+j)(2-j)=5. $$

This would make both $\alpha$ and $\beta$ divisible by $5$, contradicting the assumption that they are relatively prime. Therefore either $r=0$ or $r=k$. Hence every primitive solution must be, apart from multiplication by a Gaussian unit, either

$$ (2+j)^k \qquad\hbox{or}\qquad (2-j)^k. $$

These two numbers are complex conjugates, so they differ only in the sign of the imaginary component. Multiplication by $\pm1$ and $\pm j$ changes signs and swaps the two components. Consequently, after ignoring signs and the order of the components, there is exactly one primitive solution to

$$ \alpha^2+\beta^2=5^k $$

for every non-negative integer $k$.

The case

$$ \alpha^2+\beta^2=2\cdot5^k $$

follows in the same way. Since

$$ 2=(1+j)(1-j) $$

and $1-j=-j(1+j)$ differs from $1+j$ only by multiplication by a Gaussian unit, every primitive solution is, up to signs and swapping components, obtained from

$$ (1+j)(2+j)^k. $$

Thus there is also exactly one primitive solution, up to signs and swapping components, for each

$$ \alpha^2+\beta^2=2\cdot5^k. $$

We have therefore classified all primitive nice complex numbers. For each $k\geq0$, there is one representative arising from $5^k$ and one arising from $2\cdot5^k$. All other nice complex numbers are obtained from these by changing signs, swapping the real and imaginary components, and multiplying by a number of the form $2^m5^n$, where $m$ and $n$ are arbitrary integers. If $z$ is multiplied by $2^m5^n$, its reciprocal is correspondingly multiplied by $2^{-m}5^{-n}$.

$z$$|z|^2$$z^{-1}$
$1 + j$$2 = 2\phantom{\cdot 500}$$0.5 - 0.5j$
$2 + j$$5 = 5\phantom{\cdot 500}$$0.4 - 0.2j$
$3 + j$$10 = 2\cdot 5\phantom{^0}$$0.3 - 0.1j$
$4 + 3j$$25 = 5^2\phantom{\cdot 22}$$0.16 - 0.12j$
$7 + j$$50 = 2\cdot 5^2$$0.14 - 0.02j$
$11 + 2j$$125 = 5^3\phantom{\cdot 22}$$0.088 - 0.016j$
$13 + 9j$$250 = 2\cdot 5^3$$0.052 - 0.036j$
$24 + 7j$$625 = 5^4\phantom{\cdot 22}$$0.0384 - 0.0112j$
$31 + 17j$$1250 = 2\cdot 5^4$$0.0248 - 0.0136j$
$41 + 38j$$3125 = 5^5\phantom{\cdot 22}$$0.01312 - 0.01216j$
$79 + 3j$$6250 = 2\cdot 5^5$$0.01264 - 0.00048j$
$117 + 44j$$15625 = 5^6\phantom{\cdot 22}$$0.007488 - 0.002816j$
$161 + 73j$$31250 = 2\cdot 5^6$$0.005152 - 0.002336j$
$278 + 29j$$78125 = 5^7\phantom{\cdot 22}$$0.0035584 - 0.0003712j$
$307 + 249j$$156250 = 2\cdot 5^7$$0.0019648 - 0.0015936j$
$527 + 336j$$390625 = 5^8\phantom{\cdot 22}$$0.00134912 - 0.00086016j$
$863 + 191j$$781250 = 2\cdot 5^8$$0.00110464 - 0.00024448j$
$1199 + 718j$$1953125 = 5^9\phantom{\cdot 22}$$0.000613888 - 0.000367616j$
$1917 + 481j$$3906250 = 2\cdot 5^9$$0.000490752 - 0.000123136j$
$3116 + 237j$$9765625 = 5^{10}\phantom{\cdot 22}$$0.0003190784 - 0.0000242688j$
$3353 + 2879j$$19531250 = 2\cdot 5^{10}$$0.0001716736 - 0.0001474048j$
$6469 + 2642j$$48828125 = 5^{11}\phantom{\cdot 22}$$0.00013248512 - 0.00005410816j$
$9111 + 3827j$$97656250 = 2\cdot 5^{11}$$0.00009329664 - 0.00003918848j$
$11753 + 10296j$$244140625 = 5^{12}\phantom{\cdot 22}$$0.000048140288 - 0.000042172416j$
$22049 + 1457j$$488281250 = 2\cdot 5^{12}$$0.000045156352 - 0.000002983936j$
$33802 + 8839j$$1220703125 = 5^{13}\phantom{\cdot 22}$$0.0000276905984 - 0.0000072409088j$
$42641 + 24963j$$2441406250 = 2\cdot 5^{13}$$0.0000174657536 - 0.0000102248448j$
$76443 + 16124j$$6103515625 = 5^{14}\phantom{\cdot 22}$$0.00001252442112 - 0.00000264175616j$
$92567 + 60319j$$12207031250 = 2\cdot 5^{14}$$0.00000758308864 - 0.00000494133248j$
$136762 + 108691j$$30517578125 = 5^{15}\phantom{\cdot 22}$$0.000004481417216 - 0.000003561586688j$
$245453 + 28071j$$61035156250 = 2\cdot 5^{15}$$0.000004021501952 - 0.000000459915264j$
$354144 + 164833j$$152587890625 = 5^{16}\phantom{\cdot 22}$$0.0000023209181184 - 0.0000010802495488j$
$\vdots$$\vdots$$\vdots$
$1721764 + 922077j$$3814697265625 = 5^{18}\phantom{\cdot 22}$$0.000000451350102016 - 0.000000241716953088j$
$\vdots$$\vdots$$\vdots$
$9653287 + 1476984j$$95367431640625 = 5^{20}\phantom{\cdot 22}$$0.00000010122205069312 - 0.00000001548729974784j$
$\vdots$$\vdots$$\vdots$
$34867797 + 34182196j$$2384185791015625 = 5^{22}\phantom{\cdot 22}$$0.0000000146246140428288 - 0.00000001433705214115840j$
$\vdots$$\vdots$$\vdots$
$242017776 + 32125393j$$59604644775390625 = 5^{24}\phantom{\cdot 22}$$0.000000004060384503791616 - 0.000000000538974657445888j$
$\vdots$$\vdots$$\vdots$
$1064447283 + 597551756j$$1490116119384765625 = 5^{26}\phantom{\cdot 22}$$0.00000000071433847950016512 - 0.00000000040101019526365184j$

Nice complex numbers on the unit circle

A particularly useful subset of nice complex numbers consists of those that can be scaled onto the unit circle while retaining finite decimal representations for both components. For a primitive complex number $z = \alpha + \beta j$, this occurs when

$$ |z|^2 = \alpha^2 + \beta^2 = 5^{2n}. $$

In this case, $|z| = 5^n$, so dividing $z$ by $5^n$ produces a nice complex number on the unit circle. The first such numbers are:

$\frac{4 + 3j}{5} = 0.8 + 0.6j$

$\frac{24 + 7j}{5^2} = 0.96 + 0.28j$

$\frac{117 + 44j}{5^3} = 0.936 + 0.352j$

$\frac{527 + 336j}{5^4} = 0.8432 + 0.5376j$

$\frac{3116 + 237j}{5^5} = 0.99712 + 0.07584j$

$\frac{11753 + 10296j}{5^6} = 0.752192 + 0.658944j$

$\frac{76443 + 16124j}{5^7} = 0.9784704 + 0.2063872j$

$\frac{354144 + 164833j}{5^8} = 0.90660864 + 0.42197248j$

$\frac{1721764 + 922077j}{5^9} = 0.881543168 + 0.472103424j$

$\frac{9653287 + 1476984j}{5^{10}} = 0.9884965888 + 0.1512431616j$

$\frac{34867797 + 34182196j}{5^{11}} = 0.71409248256 + 0.70005137408j$

$\frac{242017776 + 32125393j}{5^{12}} = 0.991304810496 + 0.131585609728j$

$\frac{1064447283 + 597551756j}{5^{13}} = 0.8719952142336 + 0.4895143985152j$

Please note, the list is there for interest; in reality, only the first two or three are useful in the classroom. :-)

Changing either sign or swapping the real and imaginary components produces the corresponding nice points elsewhere on the unit circle.

Numbers to be used in class

The primitive nice complex numbers found above can be multiplied by powers of two to generate additional examples. The resulting list is then culled by removing any number that can be obtained from an earlier entry simply by multiplying or dividing by a power of ten. The remaining numbers provide a useful collection of examples for use in class.

The examples are grouped according to the number of significant digits required to represent the components of $z$ and $z^{-1}$. Numbers from the first few groups are particularly convenient for calculations on the blackboard, while the later examples are useful for written exercises and assignments.

All components with one significant digit

  1. $z = 1 + j$ with $z^{-1} = 0.5 - 0.5j$.
  2. $z = 2 + j$ with $z^{-1} = 0.4 - 0.2j$.
  3. $z = 3 + j$ with $z^{-1} = 0.3 - 0.1j$.
  4. $z = 8 + 4j$ with $z^{-1} = 0.1 - 0.05j$.
  5. $z = 8 + 6j$ with $z^{-1} = 0.08 - 0.06j$.

From these, we can also deduce that $(-5 + 5j)^{-1} = (-0.1 - 0.1j)$, $(4 + 2j)^{-1} = (0.2 - 0.1j)$ or $(-0.5 + j)^{-1} = -0.4 - 0.8j$, and $(1.5 + 0.5j)^{-1} = 0.6 - 0.2j$. We skip the third and fifth, as there the $z$ and its inverse are themsevles multiples of ten of each other following conjugation.

One component with two significant digits

  1. $z = 6 + 2j$ with $z^{-1} = 0.15 - 0.05j$.
  2. $z = 7 + j$ with $z^{-1} = 0.14 - 0.02j$.
Here we can also see that $(0.5 - 1.5j)^{-1} = 0.2 + 0.6j$ and $(-1.4 - 0.2j)^{-1} = -0.7 + 0.1j$, respectively.

Two components with two significant digits

  1. $z = 2 + 2j$ with $z^{-1} = 0.25 - 0.25j$.
  2. $z = 4 + 3j$ with $z^{-1} = 0.16 - 0.12j$.
  3. $z = 16 + 8j$ with $z^{-1} = 0.05 - 0.025j$.
  4. $z = 22 + 4j$ with $z^{-1} = 0.044 - 0.008j$.
  5. $z = 28 + 4j$ with $z^{-1} = 0.035 - 0.005j$.

As a third exmaple, we now have from this that $(2.5 - 2.5j)^{-1} = 0.2 + 0.2j$, $(1.6 + 1.2j)^{-1} = 0.4 - 0.3j$, $(1.6 + 0.8j)^{-1} = 0.5 - 0.25j$, $(0.4 - 2.2j)^{-1} = 0.08 + 0.44j$, and $(0.5 + 3.5j)^{-1} = (0.04 - 0.28j$, respectively.

Three components with two significant digits

  1. $z = 11 + 2j$ with $z^{-1} = 0.088 - 0.016j$.
  2. $z = 12 + 4j$ with $z^{-1} = 0.075 - 0.025j$.
  3. $z = 13 + 9j$ with $z^{-1} = 0.052 - 0.036j$.
  4. $z = 32 + 24j$ with $z^{-1} = 0.02 - 0.015j$.
  5. $z = 64 + 48j$ with $z^{-1} = 0.01 - 0.0075j$.

All components with two significant digits

  1. $z = 26 + 18j$ with $z^{-1} = 0.026 - 0.018j$.
  2. $z = 96 + 28j$ with $z^{-1} = 0.0096 - 0.0028j$.

One component with three significant digits

  1. $z = 32 + 16j$ with $z^{-1} = 0.025 - 0.0125j$.
  2. $z = 48 + 14j$ with $z^{-1} = 0.0192 - 0.0056j$.
  3. $z = 56 + 8j$ with $z^{-1} = 0.0175 - 0.0025j$.
  4. $z = 62 + 34j$ with $z^{-1} = 0.0124 - 0.0068j$.
  5. $z = 104 + 72j$ with $z^{-1} = 0.0065 - 0.0045j$.
  6. $z = 176 + 32j$ with $z^{-1} = 0.0055 - 0.001j$.

Two components with three significant digits

  1. $z = 4 + 4j$ with $z^{-1} = 0.125 - 0.125j$.
  2. $z = 24 + 7j$ with $z^{-1} = 0.0384 - 0.0112j$.
  3. $z = 24 + 8j$ with $z^{-1} = 0.0375 - 0.0125j$.
  4. $z = 31 + 17j$ with $z^{-1} = 0.0248 - 0.0136j$.
  5. $z = 64 + 32j$ with $z^{-1} = 0.0125 - 0.00625j$.
  6. $z = 128 + 96j$ with $z^{-1} = 0.005 - 0.00375j$.
  7. $z = 352 + 64j$ with $z^{-1} = 0.00275 - 0.0005j$.
  8. $z = 768 + 224j$ with $z^{-1} = 0.0012 - 0.00035j$.

Three components with three significant digits

  1. $z = 112 + 16j$ with $z^{-1} = 0.00875 - 0.00125j$.
  2. $z = 496 + 272j$ with $z^{-1} = 0.00155 - 0.00085j$.
  3. $z = 992 + 544j$ with $z^{-1} = 0.000775 - 0.000425j$.

All components with three significant digits

  1. $z = 208 + 144j$ with $z^{-1} = 0.00325 - 0.00225j$.

Examples

Any of the numbers above can be modified by swapping the real and imaginary components, changing either sign, or multiplying or dividing by a power of ten. For example:

  1. $5 + 2.5j$ has the inverse $0.16 - 0.08j$.
  2. $0.5 - 1.5j$ has the inverse $0.2j + 0.6j$.
  3. $-3.75 + 5j$ has the inverse $-0.096 - 0.128j$.