Skip to content

Instantly share code, notes, and snippets.

@ghais
Created December 11, 2012 20:43
Show Gist options
  • Save ghais/4261968 to your computer and use it in GitHub Desktop.
Save ghais/4261968 to your computer and use it in GitHub Desktop.
Generate a sequence of N characters, chosen from an alphabet of three elements (e.g., 1, 2, 3), such that no two immediately adjacent subsequences are equal.
For instance, the sequence of length N = 5 with the characters “12321″ is acceptable, but neither “12323″ nor “12123″ are.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment