login
Consider the triangle in which the j-th row begins with prime(j) and is the arithmetic progression with least common difference such that the remaining j-1 terms are composite and not divisible by prime(j). Sequence gives last term in each row.
2

%I #6 Sep 26 2017 10:21:13

%S 2,4,27,10,39,68,299,194,159,497,261,840,1205,576,901,2318,2155,2730,

%T 2569,1762,4853,9550,6265,8622,12313,7176,17289,7208,23657,17136,

%U 25297,41640,21609,38782,17115,45056,10561,70574,28401,63392,104539,14900

%N Consider the triangle in which the j-th row begins with prime(j) and is the arithmetic progression with least common difference such that the remaining j-1 terms are composite and not divisible by prime(j). Sequence gives last term in each row.

%t a[n_] := For[r = 1, True, r++, ro = Table[Prime[n] + k* r, {k, 0, n - 1}]; If[AllTrue[Rest[ro], CompositeQ[#] && !Divisible[#, Prime[n]]&], Return[ro[[-1]]]]]; Table[a[n], {n, 1, 42}] (* _Jean-François Alcover_, Sep 26 2017 *)

%o (PARI) For arithprog(p,j) see A095181. {m=42;for(j=1,m,p=prime(j);d=arithprog(p,j);print1(p+d*(j-1),","))}

%Y Cf. A095181 for the first few rows of the triangle.

%K nonn

%O 1,1

%A _Amarnath Murthy_, Jun 02 2004

%E Edited and extended by _Klaus Brockhaus_, Jun 03 2004