Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #18 Aug 02 2022 12:37:40
%S 2,3,5,7,13,19,5,13,17,29,11,31,41,61,71,7,13,19,31,37,43,29,43,71,
%T 113,127,197,211,17,41,73,89,97,113,137,193,19,37,73,109,127,163,181,
%U 199,271,11,31,41,61,71,101,131,151,181,191,23,67,89,199,331,353
%N Triangle read by rows: T(n,k) is the k-th prime = 1 (mod n).
%H Nathaniel Johnston, <a href="/A077316/b077316.txt">Rows 1..100, flattened</a>
%e Triangle begins:
%e 2;
%e 3, 5;
%e 7, 13, 19;
%e 5, 13, 17, 29;
%e 11, 31, 41, 61, 71;
%e ...
%p Tj := proc(n,k) option remember: local j,p: if(k=0)then return 0:fi: for j from procname(n,k-1)+1 do if(isprime(n*j+1))then return j: fi: od: end: A077316 := proc(n,k) return n*Tj(n,k)+1: end: seq(seq(A077316(n,k),k=1..n),n=1..15); # _Nathaniel Johnston_, Sep 02 2011
%t Tj[n_, k_] := Tj[n, k] = Module[{j}, If[k == 0, Return[0]];
%t For[j = Tj[n, k-1]+1, True, j++, If[PrimeQ[n*j+1], Return[j]]]];
%t T[n_, k_] := n*Tj[n, k]+1;
%t Table[Table[T[n, k], {k, 1, n}], {n, 1, 15}] // Flatten (* _Jean-François Alcover_, Aug 02 2022, after _Nathaniel Johnston_ *)
%Y Cf. A034694 (first column), A077317 (main diagonal), A077318 (row sums), A077319, A093870, A193869 (row products).
%K nonn,easy,tabl
%O 1,1
%A _Amarnath Murthy_, Nov 04 2002
%E Edited and extended by _Franklin T. Adams-Watters_, Aug 29 2006