cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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, 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, 5, 7, 9, 11, 6, 10, 12, 8, 4, 2, 1, 3, 5, 7, 9, 11, 13, 6, 10, 12, 8, 4, 2, 1
Offset: 1

Views

Author

Luc Rousseau, Jan 19 2019

Keywords

Examples

			Array begins:
  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  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  5  7  9 11  6 10 12  8  4  2  1
		

Crossrefs

Cf. A323608.

Programs

  • Mathematica
    lt[x_, y_] := Module[
      {c, d, xx, yy, u, v},
      {c, d} = IntegerExponent[#, 2] & /@ {x, y};
      xx = x/2^c;
      yy = y/2^d;
      u = If[xx == 1, \[Infinity], c];
      v = If[yy == 1, \[Infinity], d];
      If[u != v, u < v, If[u == \[Infinity], c > d, xx < yy]]]
    row[n_] := Sort[Range[n], lt]
    row /@ Range[13] // Flatten