I have the following code to create words.
sage: M.<x,y,z> = FreeMonoid(3) sage: Word(x^3yxz^2x) word: xxxyxzzx
I want find the periodicity of a given word.
For example ababab has periodicity 3 and abcdabcde has periodicity 1.
Kindy help me with this.
Thank you.