login
Infinite table filled by antidiagonals with smallest numbers such that every partial concatenation of a row or a column gives a prime.
0

%I #9 Mar 15 2014 11:27:34

%S 2,3,3,3,1,3,3,1,1,3,3,47,1,47,3,23,31,21,21,31,23,7,71,171,53,171,71,

%T 7,3,3,111,7,7,111,3,3,53,253,9,231,9,231,9,253,53,19,33,711,111,33,

%U 33,111,711,33,19,149,33,63,519,213,1,213,519,63,33,149,571,23,177,21,831,21,21,831,21,177,23,571,3,91,309

%N Infinite table filled by antidiagonals with smallest numbers such that every partial concatenation of a row or a column gives a prime.

%C Table is symmetric with respect to its main diagonal.

%C Like magic squares one can define primagic squares as a symmetric square table of numbers in which every partial concatenation of a row or column gives only primes. 2, 2 3 2 3 3 3 1, 3 1 1 3 1 1, ... are primagic squares of order 1 2 and 3 respectively occurring in the above array. An absolute primagic square can be defined as the one whose members are all prime. A strictly primagic square can be defined as the one in which both the diagonals also yield primes. The primagic square of order 3 above is an example.

%e The table starts with

%e 2 3 3 3 3 ...

%e 3 1 1 47 ...

%e 3 1 1 21 ...

%e 3 47 21 ...

%e 3 ...

%e ...

%e The first row/column gives primes 2, 23, 233, 2333, 23333, ..., while the fourth row/column gives primes 3, 347, 34721, 3472153, ...

%o (PARI) n=20; M=matrix(n,n); for(s=2,n+1, for(j=1,s-1, i=s-j; M[i,j]=1; while( !ispseudoprime( eval(concat(vector(i,k,Str(M[k,j])))) ) || !ispseudoprime( eval(concat(vector(j,k,Str(M[i,k])))) ), M[i,j]++); print1(M[i,j],", "); )) /* _Max Alekseyev_ */

%K base,nonn,tabl

%O 1,1

%A _Amarnath Murthy_, Apr 11 2003

%E Edited and extended by _Max Alekseyev_, Mar 15 2014