login
A082224
Square array read by antidiagonals alternately upwards and downwards. A(i, j) is the least positive integer not occurring earlier in the sequence such that (1) if j > 1, then the j-th partial sum of the i-th row is prime; and (2) if i > 1, then the i-th partial sum of the j-th column is composite (with A(1,1) = 1).
8
1, 2, 3, 4, 8, 10, 6, 12, 15, 7, 5, 24, 18, 14, 22, 20, 16, 30, 28, 26, 13, 9, 40, 36, 38, 34, 44, 42, 46, 52, 48, 54, 60, 50, 32, 21, 11, 58, 56, 64, 66, 72, 62, 74, 78, 80, 70, 82, 84, 76, 90, 94, 88, 68, 17, 19, 92, 100, 96, 86, 102, 98, 112, 104, 108, 114, 120, 122, 106
OFFSET
1,2
EXAMPLE
Array A(i,j) (with rows i >= 1 and columns j >= 1) begins:
1, 2, 10, 6, 22, 20, 42, ...
3, 8, 12, 14, 16, 44, ...
4, 15, 18, 30, 34, ...
7, 24, 28, 38, ...
5, 26, 36, ...
13, 40, ...
9, ...
...
From Petros Hadjicostas, Feb 25 2021: (Start)
A(1,2) = 2 because i = 1, j = 2 > 1, and 1 + 2 = 3 is prime (2nd partial sum of 1st row).
A(2,1) = 3 because i = 2 > 1, j = 1, and 1 + 3 = 4 is composite (2nd partial sum of 1st column).
A(3,1) = 4 because i = 3 > 1, j = 1, and 1 + 3 + 4 = 8 is composite (3rd partial sum of 1st column).
A(2,2) = 8 because i = j = 2 > 1, 3 + 8 = 11 is prime and 2 + 8 = 10 is composite. (Here 5 has been rejected because 3 + 5 = 8 is composite, 6 has been rejected because 3 + 6 = 9 is composite, and 7 has been rejected because 3 + 7 = 10 is composite.)
A(1,3) = 10 because i = 1, j = 3 > 1 and 1 + 2 + 10 = 13 is prime. (Here 5 has been rejected because 1 + 2 + 5 = 8 is composite, 6 has been rejected because 1 + 2 + 6 = 9 is composite, 7 has been rejected because 1 + 2 + 7 = 10 is composite, and 9 has been rejected because 1 + 2 + 9 = 12 is composite.) (End)
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])); print1(n, ", "); )) } /* This is a modification of the PARI program by Max Alekseyev in A082228. - Petros Hadjicostas, Feb 25 2021 */
CROSSREFS
KEYWORD
nonn,easy,tabl
AUTHOR
Amarnath Murthy, Apr 09 2003
EXTENSIONS
Edited and extended David Wasserman, Feb 27 2006
STATUS
approved