ShyamalSayak
ShyamalSayak

Reputation: 101

Can I generate all possible integer sequences of a particular form using SageMath?

Let $(5,r_1,r_2,r_3,0)$ be an integer sequence. I want to generate all possible sequences of this form subject to the following two constraints:
(ii) $r_i$'s are distinct; (i) $|r_{i+1}-r_i|5$ for each $0\le i\le 3$ (where $r_0=4,r_4=0$).

I was wondering how one can use sage to develop such an algorithm.

I have not tried anything as I just started learning SageMath. The only I know how to use is the Lagrange's Interpolation polynomial. But doing things by hand is quite cumbersome.

Upvotes: 0

Views: 19

Answers (0)

Related Questions