# Thread: sequences

1. ## sequences

Hello,

I was wondering if anyone knows how to generate 256 different sequences from 256 numbers [0:255], where no number is repeated within the same row of numbers, at the same time no two consecutive numbers exist more than once in the different 256 sequences.

Can anyone help me with this please ?

Dina

2. You description is not very clear.
What do you mean be ‘row’? How many numbers in a row? How many rows?
Can you give an example?

3. Sorry for not being clear, here is what I meant by a simple example of fewer numbers.

if n = 4, then we have a matrix of 4 by 4

1 2 3 4
2 4 1 3
3 1 4 2
4 3 2 1

where numbers from 1 to 4 are represented in 4 different sequences where no two consecutive numbers exist more than once in the different sequences.

So I needed to do the same thing with n=256 i.e a matrix of 256 by 256.

Thank you very much in advance.

Dina

4. Originally Posted by dinaheidar
Sorry for not being clear, here is what I meant by a simple example of fewer numbers.

if n = 4, then we have a matrix of 4 by 4

1 2 3 4
2 4 1 3
3 1 4 2
4 3 2 1

where numbers from 1 to 4 are represented in 4 different sequences where no two consecutive numbers exist more than once in the different sequences.

So I needed to do the same thing with n=256 i.e a matrix of 256 by 256.

Thank you very much in advance.

Dina
These are known as Latin Squares.

One such square can be obtained as follows:

Write the first row 1,2,3, .. , 256
The second row 2,3,4, .. , 256,1
Third row 3,4, .. , 256,1,2

and so on.

It is "where no two consecutive numbers exist more than once in the different sequences" that I do not understand the meaning of, But would this be satisfied by interchanging columns 2 and 3, 4 and 5, ... 254 and 255, so now no row contains any consecutive numbers pairs?

RonL

5. Hi CB,
Originally Posted by CaptainBlack
These are known as Latin Squares.

One such square can be obtained as follows:

Write the first row 1,2,3, .. , 256
The second row 2,3,4, .. , 256,1
Third row 3,4, .. , 256,1,2

and so on.

RonL
where no two consecutive numbers exist more than once in the different sequences.
It's not satisfying this condition, huh ?

6. Hi,

Thank you very much for your reply.

unfortunately it's not satisfying the condition " where no two consecutive numbers exist more than once in the different sequences".

7. Originally Posted by Moo
Hi CB,

It's not satisfying this condition, huh ?
You really need to wait a couple of minutes after I first hit the submit button before quoting. I was in the midst of adding that I did not understand what that meant, ...

RonL

8. Originally Posted by dinaheidar
Hi,

Thank you very much for your reply.

unfortunately it's not satisfying the condition " where no two consecutive numbers exist more than once in the different sequences".
As I said "I don't understand what this means" please clarify, and looking at the time stamps I must have posted the last part of my post well before you typed this.

RonL