# Balancing Cyclic $R$-ary Gray Codes$\,$ II

### Abstract

New cyclic $n$-digit Gray codes are constructed over $\{0, 1, \ldots, R-1 \}$ for all $R \ge 2$, $n \ge 3$. These codes have the property that the distribution of digit changes (transition counts) between two successive elements is close to uniform. For $R=2$, the construction and proof are simpler than earlier balanced cyclic binary Gray codes. For $R \ge 3$ and $n \ge 2$, every transition count is within $2$ of the average $R^n/n$. For even $R >2$, the codes are as close to uniform as possible, except when there are two anomalous transition counts for $R \equiv 2 \pmod{4}$ and $R^n$ is divisible by $n$.