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.

A026098 Triangular array T read by rows: T(1,1)=1, T(2,1)=3, T(2,2)=2; for n >= 3, T(n,1)=prime(n) and for k=2,3,...,n, T(n,k) = m*prime(n+1-k), where m is the least positive integer such that m*p(n+1-k) is not any T(i,j) for 1<=i<=n-1 nor any T(n,j) for j<=k-1.

Original entry on oeis.org

1, 3, 2, 5, 6, 4, 7, 10, 9, 8, 11, 14, 15, 12, 16, 13, 22, 21, 20, 18, 24, 17, 26, 33, 28, 25, 27, 30, 19, 34, 39, 44, 35, 40, 36, 32, 23, 38, 51, 52, 55, 42, 45, 48, 46, 29, 69, 57, 68, 65, 66, 49, 50, 54, 56, 31, 58, 92, 76, 85, 78, 77, 63, 60, 72, 62, 37, 93, 87, 115, 95, 102, 91, 88, 70, 75, 81, 64
Offset: 1

Views

Author

Keywords

Comments

A permutation of the natural numbers.

Examples

			1;
3, 2;
5, 6, 4;
7, 10, 9, 8;
11, 14, 15, 12, 16;
13, 22, 21, 20, 18, 24;
17, 26, 33, 28, 25, 27, 30;
19, 34, 39, 44, 35,..
		

Crossrefs

Inverse permutation: A070264.

Programs

  • Mathematica
    T[1, 1] = 1; T[2, 1] = 3; T[2, 2] = 2;
    T[n_, 1] := Prime[n];
    T[n_, k_] := T[n, k] = Module[{m, mp, jtt}, For[m = 1, True, m++, mp = m Prime[n + 1 - k]; jtt = Join[Table[T[i, j], {i, 1, n - 1}, {j, 1, i}] // Flatten, Table[T[n, j], {j, 1, k - 1}]]; If[FreeQ[jtt, mp], Return[mp]]]];
    Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 05 2019 *)
  • PARI
    getrow(n, all) = {if (n==1, return ([1])); if (n==2, return ([3, 2])); my(row = vector(n)); row[1] = prime(n); for (k=2, n, my(ok = 0, m = 1, val); until(ok, val = m*prime(n+1-k); if (!setsearch(all, val) && !setsearch(Set(row), val), ok = 1); m++;); row[k] = val;); return (row);}
    tabl(nn) = {my(all = []); for (n=1, nn, my(row = getrow(n, all)); print(row); /* for (k=1, n, print1(row[k], ", ")); */ all = Set(concat(all, row)););} \\ Michel Marcus, Sep 04 2019

Extensions

Corrected by David Wasserman, Aug 12 2002
More terms from Michel Marcus, Sep 04 2019