login
Triangular array: row n is the list of numbers from 1 to n, sorted in Sharkovsky order.
2

%I #8 Jan 24 2019 02:02:33

%S 1,2,1,3,2,1,3,4,2,1,3,5,4,2,1,3,5,6,4,2,1,3,5,7,6,4,2,1,3,5,7,6,8,4,

%T 2,1,3,5,7,9,6,8,4,2,1,3,5,7,9,6,10,8,4,2,1,3,5,7,9,11,6,10,8,4,2,1,3,

%U 5,7,9,11,6,10,12,8,4,2,1,3,5,7,9,11,13,6,10,12,8,4,2,1

%N Triangular array: row n is the list of numbers from 1 to n, sorted in Sharkovsky order.

%H Luc Rousseau, <a href="/A323607/a323607.png">Array plot of the first 250 rows of the triangle</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SharkovskysTheorem.html">Sharkovsky's Theorem</a>

%e Array begins:

%e 1

%e 2 1

%e 3 2 1

%e 3 4 2 1

%e 3 5 4 2 1

%e 3 5 6 4 2 1

%e 3 5 7 6 4 2 1

%e 3 5 7 6 8 4 2 1

%e 3 5 7 9 6 8 4 2 1

%e 3 5 7 9 6 10 8 4 2 1

%e 3 5 7 9 11 6 10 8 4 2 1

%e 3 5 7 9 11 6 10 12 8 4 2 1

%t lt[x_, y_] := Module[

%t {c, d, xx, yy, u, v},

%t {c, d} = IntegerExponent[#, 2] & /@ {x, y};

%t xx = x/2^c;

%t yy = y/2^d;

%t u = If[xx == 1, \[Infinity], c];

%t v = If[yy == 1, \[Infinity], d];

%t If[u != v, u < v, If[u == \[Infinity], c > d, xx < yy]]]

%t row[n_] := Sort[Range[n], lt]

%t row /@ Range[13] // Flatten

%Y Cf. A323608.

%K nonn,tabl

%O 1,2

%A _Luc Rousseau_, Jan 19 2019