Abstract

A signed binary representation (SBR) of an integer $N$ is a string $a_b\cdots a_2a_1a_0$ over the alphabet $\{-1,0,1\}$ such that $N = \sum_{i=0}^b a_i2^i$. An SBR of an integer $N$ is said to be minimal if the number of nonzero digits is minimum. In this paper, we describe a simple 3-close Gray code for listing all minimal SBRs of an integer $N$. The algorithm is implemented to run in constant amortized time. In addition, we identify the values for $N$ that have the maximum number of minimal SBRs given the length of the binary representation of $N$.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call