in reply to (OT) A different kind of 'combinatorics'
It seems that De Bruijn sequences are what you are searching for. Wikipedia even lists an algorithm, albeit in Python.
Update: As I assume that this is somewhat related to your quest of finding a misaligned sequence, you might be interested in the section "De Bruijn decoding", which hints at specially constructed sequences that can be mapped back to the position/offset in O(n log(n)) if you can't use a lookup table to convert the sequence value back to an offset.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: (OT) A different kind of 'combinatorics'
by BrowserUk (Patriarch) on Mar 26, 2015 at 15:37 UTC |