Suppose I have the sequence {2, 4, 6, 8, 10, 12, 14, 16}
.
How could I calculate the number of tuples so that for every term save the first one, the difference from two consecutive terms is no greater than 3.
Example: Suppose we had the sequence 2, 4, 6.
The sequences that are valid would be {2,4,6}, {2,6,4}, {4,2,6}, {6,4,2}
The sequences {4,6,2}
and {6,2,4}
would not be valid because in {4,6,2}
, 6-2=4>3, and in {6,2,4}
, 6-2=4>3.
If we had a sequence such as 2, 10, 8, 6, 4, it would be valid.
However, a sequence such as 4, 6, 8, 10, 2 would not be valid because 10-2=8>3.
How can I use Mathematica to count such sequences?
the left term is no greater than 3
This is not clear and your example sheds little lite on what it means. $\endgroup$