1 | initial version |
The program doesn't use any sage-specific functionality, and it doesn't have to. You can just use any correct python implementation. For instance, the algorithm on the wikipedia page https://en.wikipedia.org/wiki/De_Bruijn_sequence has probably been looked at quite a bit, so may well be correct (I didn't check completely, but its output does contain the string "hccc")
2 | No.2 Revision |
The program doesn't use any sage-specific functionality, and it doesn't have to. You can just use any correct python implementation. For instance, The routine presented seems like a verbatim copy of the algorithm one on https://en.wikipedia.org/wiki/De_Bruijn_sequence . Note that the wikipedia page https://en.wikipedia.org/wiki/De_Bruijn_sequence has probably been looked at quite definition of a bit, so may well "de bruijn sequence" includes it's a cyclic sequence. So you should be correct (I didn't check completely, but its output does contain appending the string "hccc")head of the sequence to the tail:
"hccc" in seq+seq[:3]