%I #27 Feb 26 2021 10:40:06
%S 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,
%T 44,42,46,52,48,54,60,50,32,21,11,58,56,64,66,72,62,74,78,80,70,82,84,
%U 76,90,94,88,68,17,19,92,100,96,86,102,98,112,104,108,114,120,122,106
%N 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).
%e Array A(i,j) (with rows i >= 1 and columns j >= 1) begins:
%e 1, 2, 10, 6, 22, 20, 42, ...
%e 3, 8, 12, 14, 16, 44, ...
%e 4, 15, 18, 30, 34, ...
%e 7, 24, 28, 38, ...
%e 5, 26, 36, ...
%e 13, 40, ...
%e 9, ...
%e ...
%e From _Petros Hadjicostas_, Feb 25 2021: (Start)
%e A(1,2) = 2 because i = 1, j = 2 > 1, and 1 + 2 = 3 is prime (2nd partial sum of 1st row).
%e A(2,1) = 3 because i = 2 > 1, j = 1, and 1 + 3 = 4 is composite (2nd partial sum of 1st column).
%e A(3,1) = 4 because i = 3 > 1, j = 1, and 1 + 3 + 4 = 8 is composite (3rd partial sum of 1st column).
%e 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.)
%e 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)
%o (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 */
%Y Cf. A082225, A082226, A082227, A082228.
%K nonn,easy,tabl
%O 1,2
%A _Amarnath Murthy_, Apr 09 2003
%E Edited and extended _David Wasserman_, Feb 27 2006
|