OFFSET
1,2
COMMENTS
A permutation of the natural numbers.
LINKS
EXAMPLE
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,..
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
EXTENSIONS
Corrected by David Wasserman, Aug 12 2002
More terms from Michel Marcus, Sep 04 2019
STATUS
approved