Runs

(which self-describe their sizes)

A few sequences, based on the same idea, which are not in the OEIS at the present moment (Augustus 24th, 2010)

The sequence P is made of successive runs of increasing integers (for instance 1,4,7). A run is completed when the next integer is too small to fit (example 1,4,7,6 – this 6 is not part of the run; thus the run has only three elements, its size is 3). Last remark: a run can be of size 1 (it then has only one element; according to the rule, this single element can not be seen as part of the previous run nor the next one):

P = 2, 3, 1, 4, 7, 6, 5, 8, 9, 11, 10, 12, 13, 14, 15, 16, 18, 17, 19, 20, 21, 22, 24, 23, 25, 26, 27, 29, 28, 30, 31, 32, 33, 34, 35, 37, 36, 38, 39, 40, 41, 42, 43, 44, 46, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 56, ...

This sequence shows two nice things:

- first, all natural numbers are present, and there are no duplicates. P is a permutation of N.

- second, the successive sizes of the runs re-design P itself!

The second point is clearly visible below.

First we copy/paste P:

P = 2, 3, 1, 4, 7, 6, 5, 8, 9, 11, 10, 12, 13, 14, 15, 16, 18, 17, 19, 20, 21, 22, 24, 23, 25, 26, 27, 29, 28, 30, 31, 32, 33, 34, 35, 37, 36, 38, 39, 40, 41, 42, 43, 44, 46, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 56, ...

Then we systematically insert a star * between two integers, when the second integer is smaller than the previous one:

P = 2, 3,*1, 4, 7,*6,*5, 8, 9, 11,*10, 12, 13, 14, 15, 16, 18,*17, 19, 20, 21, 22, 24,*23, 25, 26, 27, 29,*28, 30, 31, 32, 33, 34, 35, 37,*36, 38, 39, 40, 41, 42, 43, 44, 46,*45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57,*56, ...

We now count the quantity of integers which are placed between two stars; we get (in red):

P = 2, 3,*1, 4, 7,*6,*5, 8, 9, 11,*10, 12, 13, 14, 15, 16, 18,*17, 19, 20, 21, 22, 24,*23, 25, 26, 27, 29,*  ...

2      3     1       4                    7                         6                     5  ...

We see that the succession of the red figures re-design P itself: 2, 3, 1, 4, 7, 6, 5, ...

P is easy to self-construct, as one will quickly understand, looking at the successive chunks of P.

----------

The sequence Q deals with the same idea -- but we handle here decreasing runs of integers:

Q = 2, 1, 3, 6, 5, 4, 12, 11, 10, 9, 8, 7, 17, 16, 15, 14, 13, 21, 20, 19, 18, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, ...

Again, by construction, all natural numbers are present with no duplicates.

To see if Q correctly self-describes its own runs, we apply the star technique (we insert a star when we notice that the second integer is larger than the previous one):

Q = 2, 1,*3,*6, 5, 4,*12, 11, 10, 9, 8, 7,*17, 16, 15, 14, 13,*21, 20, 19, 18,*33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22,*44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34,*54, 53, 52, 51, 50, 49, 48, 47, 46, 45,*63, ...

We measure the size of the runs:

Q = 2, 1,*3,*6, 5, 4,*12, 11, 10, 9, 8, 7,*17, 16, 15, 14, 13,*21, 20, 19, 18,*33, 32, 31, 30, 29, 28, 27, 26, ...

2   1     3               6                   5                 4                              12 ...

Indeed, we get Q again (in red)...

----------

To produce more sequences of this type, we only need our imagination! We must find a suitable characteristic to define a run, and... let it go!

Some ideas to define a run:

- a p-run is a sub-sequence (made of consecutive terms) which contains only one prime;

- a c-run is a sub-sequence (made of consecutive terms) which contains only one non-prime;

- a t-run is a sub-sequence (made of consecutive terms) which contains only one triangular number;

- an o-run is a sub-sequence (made of consecutive terms) which contains only one odd integer;

- an e-run is a sub-sequence (made of consecutive terms) which contains only one even integer;

...

Let’s try to use the first definition (the p-run) in order to build a sequence of the same type as above (that is: a permutation of N and a self-description);

Can we start with “1”? No, this would mean that the first run, which contains a single prime, is of size 1 – but this 1 is not a prime... We then try to start with 2 – and the rest comes smoothly!

R = 2, 1, 3, 5, 4, 6, 7, 8, 9, 10, 12, 11, 14, 15, 16, 13, 18, 20, 21, 22, 24, 17, 25, 26, 27, 28, 30, 32, 19, 33, 34, 35, 36, 38, 39, 40, 23, 42, 44, 45, 46, 48, 49, 50, 51, 29, 54, 55, 56, 57, 58, 60, 62, 63, ...

This is (again, by construction) a permutation of N. To check if R does self-describe its p-runs sizes, we will replace the star technique with a simpler one: the carriage-return technique!

First we copy/paste R:

R = 2, 1, 3, 5, 4, 6, 7, 8, 9, 10, 12, 11, 14, 15, 16, 13, 18, 20, 21, 22, 24, 17, 25, 26, 27, 28, 30, 32, 19, 33, 34, 35, 36, 38, 39, 40, 23, 42, 44, 45, 46, 48, 49, 50, 51, 29, 54, 55, 56, 57, 58, 60, 62, 63, ...

We then push “carriage return” immediately BEFORE every prime of R, starting from the left; we get:

R =

2, 1,

3,

5, 4, 6,

7, 8, 9, 10, 12,

11, 14, 15, 16,

13, 18, 20, 21, 22, 24,

17, 25, 26, 27, 28, 30, 32,

19, 33, 34, 35, 36, 38, 39, 40,

23, 42, 44, 45, 46, 48, 49, 50, 51,

29, 52, 54, 55, 56, 57, 58, 60, 62, 63, ...

(We see that the first column is the succession of the primes. And we understand that the length of each line is dictated by the reading, left to right and top to bottom, of the elements of the array).

We now measure the quantity of integers in every line (in red):

R =

2  2, 1,

1  3,

3  5, 4, 6,

5  7, 8, 9, 10, 12,

4  11, 14, 15, 16,

6  13, 18, 20, 21, 22, 24,

7  17, 25, 26, 27, 28, 30, 32,

8  19, 33, 34, 35, 36, 38, 39, 40,

9  23, 42, 44, 45, 46, 48, 49, 50, 51,

10 29, 52 54, 55, 56, 57, 58, 60, 62, 63, ...

Yes, the red figures re-design R.

----------

Here is S, where the runs contain only one odd number:

S = 1, 3, 2, 4, 5, 6, 7, 8, 10, 12, 9, 14, 16, 18, 20, 11, 22, 24, 26, 28, 30, 13, 32, 34, 36, 38, 40, 42, 15, 44, 46, 48, 50, 52, 54, 56, 17, 58, 60, 62, 64, 66, 68, 70, 72, 74, 19, 76, 78, ...

Carriage-return check:

S =

1,

3, 2, 4,

5, 6,

7, 8, 10, 12,

9, 14, 16, 18, 20,

11, 22, 24, 26, 28, 30,

13, 32, 34, 36, 38, 40, 42,

15, 44, 46, 48, 50, 52, 54, 56,

17, 58, 60, 62, 64, 66, 68, 70, 72, 74, ,

19, 76, 78, ...

Measure of the o-runs (in red):

S =

1  1,

3  3, 2, 4,

2  5, 6,

4  7, 8, 10, 12,

5  9, 14, 16, 18, 20,

6  11, 22, 24, 26, 28, 30,

7  13, 32, 34, 36, 38, 40, 42,

8  15, 44, 46, 48, 50, 52, 54, 56,

10 17, 58, 60, 62, 64, 66, 68, 70, 72, 74,

12 19, 76, 78, ...

----------

Here is T, where the e-runs must contain only one even number (a quick check is done by underlining the runs):

T = 2, 1, 4, 6, 3, 5, 7, 8, 9, 11, 13, 15, 17, 10, 19, 21,  12, 23, 25, 27, 29,  14, 31, 33, 35, 37, 39, 41, ...

2    1      4                6                 3                5                         7

Hope this technique is now clear – and will be used by others!

__________

Latest news (September 8th, 2010), by Neil Sloane:

> Eric, I'm adding these 5 seqs to the OEIS - see A171083-A171087

Thank you, Neil!

Best,

É.