login
A082231
Main diagonal of A082228.
4
1, 8, 20, 36, 64, 92, 140, 182, 264, 324, 392, 470, 568, 688, 780, 900, 1042, 1176, 1286, 1472, 1636, 1762, 1922, 2082, 2270, 2456, 2704, 2922, 3174, 3392, 3618, 3850, 4058, 4346, 4616, 4910, 5188, 5500, 5776, 6062, 6400, 6682, 7078, 7378, 7720, 8096, 8472
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[1]==q[2], print1(n, ", ")); )) } \\ This is a modification of Max Alekseyev's PARI program from A082228. - Petros Hadjicostas, Feb 25 2021
KEYWORD
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