Hi all, >From wikipedia:
*In mathematics, in the areas of combinatorics and computer science, a Lyndon word is a string that is strictly smaller in lexicographic order than all of its rotations. Lyndon words are named after mathematician Roger Lyndon, who introduced them in 1954, calling them standard lexicographic sequences* For example [1,1,2,1,3] is a Lyndon word, but [1,3,1,1,2] is not. I need to check as efficiently as possible if a given integer sequence is a Lyndon word or not. Is there such an option in sage? I check the section for Lyndon words in the manual<http://www.sagemath.org/doc/reference/combinat/sage/combinat/lyndon_word.html>but apparently the only way one can check something like that, is in a situation like so: sage: LyndonWord([2,1,2,3])Traceback (most recent call last):...ValueError: Not a Lyndon word > > Is this my only option for checking if something is a Lyndon word? This suggests that there is inherently some check in this function, but I do not want to use a ValueError for that.. Any advice? Thank you in advance -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
