OFFSET
1,1
LINKS
Alois P. Heinz, Antidiagonals n = 1..100, flattened
EXAMPLE
Column k=3 contains prime 47 because (47+3)^2+3 = 2503 is prime and (47+2)^2+2 = 2403 = 3^3*89 and (47+1)^2+1 = 2305 = 5*461 are composite.
Square array A(n,k) begins:
: 3, 7, 11, 29, 193, 139, 107, 181, ...
: 5, 31, 47, 41, 331, 523, 293, 277, ...
: 13, 37, 59, 113, 409, 563, 359, 541, ...
: 19, 43, 61, 163, 457, 769, 389, 937, ...
: 23, 79, 67, 173, 487, 853, 397, 1381, ...
: 53, 97, 71, 199, 787, 1019, 401, 1741, ...
: 73, 103, 127, 211, 829, 1489, 433, 2551, ...
: 83, 241, 131, 251, 991, 1553, 461, 2617, ...
MAPLE
A:= proc() local h, p, q; p, q:= proc() [] end, 2;
proc(n, k)
while nops(p(k))<n do q:= nextprime(q);
for h while not isprime((q+h)^2+h)
do od; p(h):= [p(h)[], q]
od; p(k)[n]
end
end():
seq(seq(A(n, 1+d-n), n=1..d), d=1..12);
MATHEMATICA
nmax = 12;
col[k_] := col[k] = Reap[For[cnt = 0; p = 2, cnt < nmax, p = NextPrime[p], If[PrimeQ[(p+k)^2+k] && AllTrue[Range[k-1], !PrimeQ[(p+#)^2+#]&], cnt++; Sow[p]]]][[2, 1]];
A[n_, k_] := col[k][[n]];
Table[A[n-k+1, k], {n, 1, nmax}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, May 03 2019 *)
CROSSREFS
AUTHOR
Alois P. Heinz, Feb 17 2014
STATUS
approved