P310: Enumeration of all circular $k$-ary strings of length $n$ that have no substring equal to $f$

P310: Enumeration of all circular $k$-ary strings of length $n$ that have no substring equal to $f$
Input:
A $k$-ary string $f$ with length $m$, and a positive integer $n$.
Output:
All circular $k$-ary strings of length $n$ that have no substring equal to $f$.
Complexity:
$O(1)$ time per string.
Comment:
Reference:
[Ruskey2000a] (Bibtex)