OFFSET
1,6
COMMENTS
The n-th row has n terms, and is a self-inverse permutation of the first n nonnegative numbers.
T(n, 0) = 0 for any n > 0.
T(n, 1) = 1 for any n > 1.
T(n, n-1) = n-1 for any n > 0.
If n > 0 and gcd(n, k) = 1 then T(n, k) = A102057(n, k).
T(prime(n), k) = A124223(n, k) for any n > 0 and k in 1..prime(n)-1.
LINKS
Rémy Sigrist, Rows n=1..100 of triangle, flattened
EXAMPLE
The first rows are:
n\k 0 1 2 3 4 5 6 7 8 9
1 0
2 0 1
3 0 1 2
4 0 1 2 3
5 0 1 3 2 4
6 0 1 2 3 4 5
7 0 1 4 5 2 3 6
8 0 1 2 3 4 5 6 7
9 0 1 5 3 7 2 6 4 8
10 0 1 2 7 4 5 6 3 8 9
MATHEMATICA
T[n_, k_] := If[GCD[n, k] == 1, PowerMod[k, -1, n], k];
Table[T[n, k], {n, 1, 13}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Oct 31 2017 *)
PROG
(PARI) T(n, k) = if (gcd(n, k)==1, lift(1/Mod(k, n)), k)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Rémy Sigrist, Jun 29 2017
STATUS
approved