Figuring out a sequence/pattern of numbers

98 Views Asked by At

Let's assume that we have a number sequence which starts as

1# -1 2 3 4 5 6 7 8 9
2# -1 2 3 4 5 6 7 9 8
3# -1 2 3 4 5 6 8 7 9

n# -9 8 7 6 5 4 3 2 1

There could be approximately 3000 such occurrences in between, What would be the pattern to generate these numbers...

Regards!

1

There are 1 best solutions below

0
On

If you notice carefully, this is what is going on apparently:

In each case, we shift the entries $e_n, \cdots, e_8$ one place to the right and put $e_9$ in the $n$-th position. We do this with $n$ starting from $8$ and going down all the way to $1$, and repeat the loop till we get the sequence $9, 8, 7, \cdots, 1$.