An Algorithm for Constructing m-ary de Bruijn Sequences

We present an algorithm for the generation of m-ary de Bruijn cycles. The algorithm generates mkg(n, k) cycles of length mn, using 3n + kg(n, k) storage, where k is a free parameter in the range 1 ≤ k ≤ m(n−4)2, and g(n, k) is of order (n − 2logmk)(1 − (1(1 + logmk))). The time required to produce the next digit from the last n digits is close to n.