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.

Previous Showing 11-12 of 12 results.

A368158 Irregular triangular array T, read by rows: T(n,k) = number of sums |x-y| + |y-z| = k, where x,y,z are in {1,2,...,n} and x <= y.

Original entry on oeis.org

2, 3, 1, 3, 6, 6, 2, 1, 4, 9, 11, 9, 4, 2, 1, 5, 12, 16, 16, 13, 6, 4, 2, 1, 6, 15, 21, 23, 22, 17, 9, 6, 4, 2, 1, 7, 18, 26, 30, 31, 28, 22, 12, 9, 6, 4, 2, 1, 8, 21, 31, 37, 40, 39, 35, 27, 16, 12, 9, 6, 4, 2, 1, 9, 24, 36, 44, 49, 50, 48, 42, 33, 20, 16
Offset: 1

Views

Author

Clark Kimberling, Jan 20 2024

Keywords

Comments

Row n consists of 2n+1 positive integers.

Examples

			First six rows:
  2   3   1
  3   6   6   2   1
  4   9  11   9   4   2   1
  5  12  16  16  13   6   4   2  1
  6  15  21  23  22  17   9   6  4  2  1
  7  18  26  30  31  28  22  12  9  6  4  2  1
For n=2, there are 6 triples (x,y,z) having x <= y:
  111:  |x-y| + |y-z| = 0
  112:  |x-y| + |y-z| = 1
  121:  |x-y| + |y-z| = 2
  122:  |x-y| + |y-z| = 1
  221:  |x-y| + |y-z| = 1
  222:  |x-y| + |y-z| = 0,
so row 1 of the array is (2,3,1), representing two 0s, three 1s, and one 1.
		

Crossrefs

Cf. A002411 (row sums), A002620 (limiting reverse row), A368434, A368437, A368515, A368516, A368517, A368519, A368520, A368521, A368522.

Programs

  • Mathematica
    t1[n_] := t1[n] = Tuples[Range[n], 3];
    t[n_] := t[n] = Select[t1[n], #[[1]] < #[[2]] &];
    a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
    u = Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}];
    v = Flatten[u]  (* sequence *)
    Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 0, 2 n - 2}]]  (* array *)

A368608 Irregular triangular array T, read by rows: T(n,k) = number of sums |x-y| + |y-z| = k, where x,y,z are in {1,2,...,n} and x != y and y <= z.

Original entry on oeis.org

2, 1, 4, 5, 2, 1, 6, 9, 8, 4, 2, 1, 8, 13, 14, 12, 6, 4, 2, 1, 10, 17, 20, 20, 16, 9, 6, 4, 2, 1, 12, 21, 26, 28, 26, 21, 12, 9, 6, 4, 2, 1, 14, 25, 32, 36, 36, 33, 26, 16, 12, 9, 6, 4, 2, 1, 16, 29, 38, 44, 46, 45, 40, 32, 20, 16, 12, 9, 6, 4, 2, 1, 18, 33
Offset: 1

Views

Author

Clark Kimberling, Jan 25 2024

Keywords

Comments

Row n consists of 2n positive integers.

Examples

			First six rows:
   2   1
   4   5   2   1
   6   9   8   4   2   1
   8  13  14  12   6   4   2  1
  10  17  20  20  16   9   6  4  2  1
  12  21  26  28  26  21  12  9  6  4  2  1
For n=2, there are 3 triples (x,y,z) having x != y and y <= z:
  122:  |x-y| + |y-z| = 1
  211:  |x-y| + |y-z| = 1
  212:  |x-y| + |y-z| = 2
so row 2 of the array is (2,1), representing two 1s and one 2.
		

Crossrefs

Cf. A005443 (column 1), A027480 (row sums), A002620 (limiting reversed row), A368434, A368437, A368515, A368516, A368517, A368518, A368519, A368520, A368521, A368522, A368604, A368605, A368606, A368607, A368609.

Programs

  • Mathematica
    t1[n_] := t1[n] = Tuples[Range[n], 3];
    t[n_] := t[n] = Select[t1[n], #[[1]] != #[[2]] <= #[[3]] &];
    a[n_, k_] := Select[t[n], Abs[#[[1]] - #[[2]]] + Abs[#[[2]] - #[[3]]] == k &];
    u = Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}];
    v = Flatten[u]  (* sequence *)
    Column[Table[Length[a[n, k]], {n, 2, 15}, {k, 1, 2 n - 2}]]  (* array *)
Previous Showing 11-12 of 12 results.