[sage-support] Period of a sequence

2018-12-09 Thread chandra chowdhury
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

Re: [sage-support] Period of a sequence

2018-12-09 Thread Dima Pasechnik
On Sun, Dec 9, 2018 at 10:57 AM chandra chowdhury wrote: > > 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() What does tell you that Sequence has such a method i

[sage-support] Re: Solving recursion formula?

2018-12-09 Thread Marc Mezzarobba
Simon King wrote: > What about > a more complicated recurrence, such as the one given by > x_(n+1) = 1 + x_n*2/n > Any chances to solve those and similar recurrences automatically? You can try sympy's rsolve() or Maxima's solve_rec(). I don't know how powerful they are. -- Marc -- You receive

[sage-support] Obtaining the factors in a tensor product

2018-12-09 Thread John H Palmieri
1. Suppose I have a tensor product X = V tensor W of appropriate objects (instances of CombinatorialFreeModule, for example). How can I retrieve V and W from X? 2. Suppose I have a basic tensor x = v tenor w in V tensor W. How can retrieve v and w from x? For example, if A is your favorite Hop

Re: [sage-support] Period of a sequence

2018-12-09 Thread Vincent Delecroix
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(