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.

A289251 Triangle T(n, k), n > 0 and 0 <= k < n, read by rows; if gcd(n, k) = 1, then T(n, k) = modular inverse of k (mod n), otherwise T(n, k) = k.

This page as a plain text file.
%I A289251 #12 Oct 31 2017 04:57:55
%S A289251 0,0,1,0,1,2,0,1,2,3,0,1,3,2,4,0,1,2,3,4,5,0,1,4,5,2,3,6,0,1,2,3,4,5,
%T A289251 6,7,0,1,5,3,7,2,6,4,8,0,1,2,7,4,5,6,3,8,9,0,1,6,4,3,9,2,8,7,5,10,0,1,
%U A289251 2,3,4,5,6,7,8,9,10,11,0,1,7,9,10,8,11
%N A289251 Triangle T(n, k), n > 0 and 0 <= k < n, read by rows; if gcd(n, k) = 1, then T(n, k) = modular inverse of k (mod n), otherwise T(n, k) = k.
%C A289251 The n-th row has n terms, and is a self-inverse permutation of the first n nonnegative numbers.
%C A289251 T(n, 0) = 0 for any n > 0.
%C A289251 T(n, 1) = 1 for any n > 1.
%C A289251 T(n, n-1) = n-1 for any n > 0.
%C A289251 If n > 0 and gcd(n, k) = 1 then T(n, k) = A102057(n, k).
%C A289251 T(prime(n), k) = A124223(n, k) for any n > 0 and k in 1..prime(n)-1.
%H A289251 Rémy Sigrist, <a href="/A289251/b289251.txt">Rows n=1..100 of triangle, flattened</a>
%e A289251 The first rows are:
%e A289251 n\k  0 1 2 3 4 5 6 7 8 9
%e A289251 1    0
%e A289251 2    0 1
%e A289251 3    0 1 2
%e A289251 4    0 1 2 3
%e A289251 5    0 1 3 2 4
%e A289251 6    0 1 2 3 4 5
%e A289251 7    0 1 4 5 2 3 6
%e A289251 8    0 1 2 3 4 5 6 7
%e A289251 9    0 1 5 3 7 2 6 4 8
%e A289251 10   0 1 2 7 4 5 6 3 8 9
%t A289251 T[n_, k_] := If[GCD[n, k] == 1, PowerMod[k, -1, n], k];
%t A289251 Table[T[n, k], {n, 1, 13}, {k, 0, n-1}] // Flatten (* _Jean-François Alcover_, Oct 31 2017 *)
%o A289251 (PARI) T(n, k) = if (gcd(n, k)==1, lift(1/Mod(k, n)), k)
%Y A289251 Cf. A102057, A124223.
%K A289251 nonn,tabl
%O A289251 1,6
%A A289251 _Rémy Sigrist_, Jun 29 2017