Indeed, primitive_length only consider periods that are
integer divisors of the total length. If you want other
periods you can use the (very slow)

sage: Word(S).periods()
[3, 6, 9]

Vincent

Le 17/12/2018 à 09:52, pc.chandr...@gmail.com a écrit :

Thank you. However if S=[1,2,3,1,2,3,1,2,3,1,2], it is showing 11 although
period is 3.


On Monday, December 10, 2018 at 1:26:50 PM UTC+5:30, vdelecroix wrote:

You can use

sage: w = Word(S)
sage: w.primitive_length()
[3]
sage: w.primitive()
word: 123

Le 09/12/2018 à 11:57, chandra chowdhury a écrit :
I have a sequence which I stored in an array.
I want to find the period of the sequence.
But the following code gives error.

S=[1,2,3,1,2,3]
S=Sequence(S)
print S.period()




--
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 sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to