OFFSET
1,3
EXAMPLE
Table T(n,r) begins:
n\r | 1 2 3 4 5 6 7 8 9 10 11
----+-------------------------------------------
1 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
2 | 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
3 | 5, 4, 6, 7, 8, 9, 3, 10, 11, 12, 13
4 | 8, 9, 10, 7, 11, 12, 6, 13, 14, 15, 16
5 | 13, 14, 12, 15, 11, 16, 17, 10, 18, 19, 20
6 | 19, 18, 20, 17, 21, 22, 16, 23, 24, 15, 25
7 | 25, 26, 27, 24, 28, 23, 29, 22, 30, 31, 21
8 | 33, 34, 32, 35, 31, 36, 30, 37, 38, 29, 39
9 | 42, 41, 43, 40, 44, 39, 45, 46, 38, 47, 37
10 | 51, 52, 50, 53, 54, 49, 55, 48, 56, 47, 57
11 | 62, 63, 61, 64, 60, 65, 59, 66, 58, 67, 57
12 | 74, 73, 75, 72, 76, 71, 77, 70, 78, 79, 69
13 | 86, 87, 85, 88, 84, 89, 90, 83, 91, 82, 92
MATHEMATICA
l[n_, r_] := l[n, r] = Table[Product[(M - i + 1)/M, {i, 2, n}]*n/M, {M, 2, n^2*r}];
T[1, r_] = 1; T[n_, r_] := T[n, r] = Module[{pos}, pos = Position[l[n, r], RankedMax[l[n, r], r]]; If[Length[pos] == 0, -1, pos[[1, 1]] + 1]];
(*Table*)Table[T[n, r], {n, 1, 13}, {r, 1, 11}] // TableForm
(*Data*)Table[T[n, r - n + 1], {r, 1, 12}, {n, 1, r}] // Flatten
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Robert P. P. McKone, Dec 30 2023
STATUS
approved