Minimal Redundant Digit Expansions in the Gaussian Integers

Demonstration of the Mathematica Package

Package of Mathematica Routines related to the paper of same title by C. Heuberger, to appear in J. Theor. Nombres Bordeaux.
http://finanz.math.tu-graz.ac.at/~cheub/publications/minimalredundantgauss/
clemens.heuberger@tugraz.at

Read Package

Note: You may have to include a path in the following line; for instance, << "/home/thue/cheub/papers/digitopt-gauss/MinimalRedundantGauss.m"

<< MinimalRedundantGauss`

Standard Expansion

?StandardCNS

e1 = StandardCNS[5 + I, -1 + I]

?CNS

?ExpandCNS

e1 /. CNS -> ExpandCNS[-1 + I]

Minimum Expansion

?MinimumCNS

MinimumCNS[5 + I, -1 + I]

MinimumCNS[1000, -1 + I]  // Timing

MinimumCNS[1000, -1 + I] // Timing

MinimumCNS[1000, -2 + I] // Timing

MinimumCNS[1000, -1 + I] // Timing

Shortest Expansion

?ShortestCNS

ShortestCNS[100, -1 + I]

MinimumCNS[100, -1 + I]

Lemma 4, Rules

?FindRule

FindRule[CNS[1, 0, 0, 0], -1 + I]

Table 1

candidates = {CNS[0],  CNS[1, 0, 0, 0],  CNS[1, 0, 1, 1],  
          CNS[1, 1, 0],  CNS[1, 1, 1]};

rules = Map[{#, FindRule[#, -1 + I]} &, candidates]; 
    rules // TableForm

Table 2

candidates = {CNS[0], CNS[1, 0], CNS[1, 1],  CNS[1, 3], CNS[2, 1, 3], 
        CNS[2, 4, 4, 1],  CNS[3, 1, 0, 1],  CNS[3, 1, 1],  
        CNS[4, 4]}

rules = Map[{#, FindRule[#, -2 + I]} &, candidates];  
    rules // TableForm