OFFSET
1,2
PROG
(PARI) lista(nn) = { my(A=matrix(nn, nn)); S=Set(); for(s=2, nn+1, for(i=1, s-1, if(s%2, q=[i, s-i], q=[s-i, i]); p=[sum(j=1, q[2]-1, A[q[1], j]), sum(j=1, q[1]-1, A[j, q[2]])]; n=1; while(setsearch(S, n) || (p[1]&&isprime(p[1]+n)) || (p[2]&&!isprime(p[2]+n)), n++); A[q[1], q[2]]=n; S=setunion(S, Set([n])); if(q[2]==1, print1(n, ", ")); )) } \\ This is a modification of Max Alekseyev's PARI program from A082228. - Petros Hadjicostas, Feb 25 2021
CROSSREFS
KEYWORD
hard,nonn
AUTHOR
Amarnath Murthy, Apr 09 2003
EXTENSIONS
Extended by Max Alekseyev, Apr 11 2009
Various sections edited by Petros Hadjicostas, Feb 25 2021
STATUS
approved