%I #24 Jun 28 2023 22:39:29
%S 2,3,5,7,1117,1171,7331,131983991,179907191,179991179,191199311,
%T 191739971,191797919,199199311,199709971,199937971,337353739,
%U 373151113,733353337,797389337,919311739,971727179,1193100992213191,1193120192093911,1193123793413719
%N Prime numbers with m^2 digits that, if arranged in an m X m matrix, form m-digit reversible primes in each row and column and along the main diagonal.
%C For m = 1, 2, 3, 4:
%C - number of terms with m^2 digits: 4, 3, 15, 86.
%C - smallest term with m^2 digits: 2, 1117, 131983991, 1193100992213191.
%C - largest term with m^2 digits: 7, 7331, 971727179, 9931722992931193.
%C Palindromic terms: 2, 3, 5, 7, 733353337, 971727179, ...
%C There are 1303816 terms with 25 digits, from 1119710007309831033317939 to 9979399989793939049937997, while the terms with 36 digits range from 111119100049100049150607134777979313 to 999931999983999983792293733331319919. - _Giovanni Resta_, Apr 05 2013
%D Chris K. Caldwell, G. L. Honaker, Jr.: Prime Curios! The Dictionary of Prime Number Trivia. CreateSpace 2009, p. 219, and 229.
%H Martin Renner and Giovanni Resta, <a href="/A224164/b224164.txt">Table of n, a(n) for n = 1..10000</a> (first 108 terms from Martin Renner)
%H Chris K. Caldwell and G. L. Honaker, Jr., <a href="https://t5k.org/curios/page.php?number_id=621">Prime Curios! 733353337</a>.
%H Chris K. Caldwell and G. L. Honaker, Jr., <a href="https://t5k.org/curios/page.php?number_id=662">Prime Curios! 3391382115599173</a>.
%H Chris K. Caldwell and G. L. Honaker, Jr., <a href="https://t5k.org/curios/page.php?number_id=699">Prime Curios! 19973...37991 (25-digits)</a>.
%e a(5) = 1117 is the smallest 4-digit prime that if arranged in a 2 X 2 matrix yields in each row and column and along the main diagonal a number that is prime in both directions, i.e.,
%e 11
%e 17
%e -> 11 (4 times), 17 (3 times), 71 (3 times) are all reversible primes.
%e a(8) = 131983991 is the smallest 9-digit prime that if arranged in a 3 X 3 matrix yields in each row and column and along the main diagonal a number that is prime in both directions, i.e.,
%e 131
%e 983
%e 991
%e -> 131 (4 times), 181, 199, 389, 983, 991 (each 2 times) are all reversible primes.
%e a(23) = 1193100992213191 is the smallest 16-digit prime that if arranged in a 4 X 4 matrix yields in each row, and column and along the main diagonal a prime in both directions, i.e.,
%e 1193
%e 1009
%e 9221
%e 3191
%e -> 1009, 1021 (2 times), 1193 (3 times), 1201 (2 times), 1229, 1913, 3191, 3911 (3 times), 9001, 9029, 9209, 9221 are all reversible primes.
%p # Maple program generating all 4-digit primes
%p M:={}: for a in [1,3,7,9] do for b in [1,3,7,9] do if isprime(10*a+b) and isprime(10*b+a) then for c in [1,3,7,9] do for d in [1,3,7,9] do if isprime(10*c+d) and isprime(10*d+c) and isprime(10*a+c) and isprime(10*c+a) and isprime(10*b+d) and isprime(10*d+b) and isprime(10*a+d) and isprime(10*d+a) then S:=[a,b,c,d]: if isprime(add(S[j]*10^(4-j),j=1..4)) then M:={op(M),add(S[j]*10^(4-j),j=1..4)}: fi: fi: od: od: fi: od: od: M;
%p # Maple program generating all 9-digit primes
%p M:={}: for d in [1,3,7,9] do for e from 0 to 9 do for f in [1,3,7,9] do if isprime(100*d+10*e+f) and isprime(100*f+10*e+d) then for a in [1,3,7,9] do for b in [1,3,7,9] do for c in [1,3,7,9] do if isprime(100*a+10*b+c) and isprime(100*c+10*b+a) then for g in [1,3,7,9] do for h in [1,3,7,9] do for i in [1,3,7,9] do if isprime(100*g+10*h+i) and isprime(100*i+10*h+g) and isprime(100*a+10*d+g) and isprime(100*g+10*d+a) and isprime(100*b+10*e+h) and isprime(100*h+10*e+b) and isprime(100*c+10*f+i) and isprime(100*i+10*f+c) and isprime(100*a+10*e+i) and isprime(100*i+10*e+a) then S:=[a,b,c,d,e,f,g,h,i]: if isprime(add(S[j]*10^(9-j),j=1..9)) then M:={op(M),add(S[j]*10^(9-j),j=1..9)}: fi: fi: od: od: od: fi: od: od: od: fi: od: od: od: M;
%Y Cf. A224398.
%K nonn,base
%O 1,1
%A _Martin Renner_, Mar 31 2013