login
Index array for A192175 (distance up to next prime), by antidiagonals.
5

%I #9 Feb 13 2014 13:24:09

%S 1,2,4,3,6,9,5,8,11,24,7,12,15,72,34,10,14,16,77,42,46,13,19,18,79,53,

%T 47,30,17,22,21,87,61,91,62,282,20,25,23,92,68,97,66,295,99,26,27,32,

%U 94,80,114,137,319,180,154,28,29,36,124,82,121,146,331,205,259,189

%N Index array for A192175 (distance up to next prime), by antidiagonals.

%C Row 1: numbers k such that p + 1 or p + 2 is a prime,

%C where p = (k-th prime).

%C Row r > 1: numbers k such that if p = (k-th prime) then r = (least h for which p + 2 h) is a prime.

%C Every positive integer occurs exactly once, so that as a sequence, A192176 is a permutation of the positive integers.

%e Northwest corner:

%e 1....2....3....5....7....10....13

%e 4....6....8....12...14...19....22

%e 9....11...15...16...18...21....23

%e 24...72...77...79...87...92....94

%e 34...42...53...61...68...80....82

%e ...

%e These are the index numbers of the primes displayed in the Example at A192175; e.g., in that display, the top row begins with 2,3,5,11,17,29,41.

%t z = 5000; (* z = number of primes used *)

%t row[1] = (#1[[1]] &) /@ Cases[Array[{#1, PrimeQ[1 + Prime[#1]] || PrimeQ[2 + Prime[#1]]} &, {z}], {_, True}]; Do[row[x] = Complement[(#1[[1]] &) /@ Cases[Array[{#1, PrimeQ[2 x + Prime[#1]]} &, {z}], {_, True}],Flatten[Array[row, {x - 1}]]], {x, 2, 16}];

%t TableForm[Array[row, {16}]] (* A192176 array *)

%t Flatten[Table[row[k][[n - k + 1]], {n, 1, 11}, {k, 1, n}]] (* A192176 sequence *)

%t (* by _Peter J. C. Moses_, Jun 20 2011 *)

%Y Cf. A192175, A192177, A192178, A192179.

%K nonn,tabl

%O 1,2

%A _Clark Kimberling_, Jun 24 2011