Problems & Puzzles: Puzzles

Puzzle 1067 Primes in a square such that...

Rodolfo Kurchan, sent the following nice puzzle:

The "reversible-7 numbers", are the digital numbers (or 7 segment display numbers) that when you turn them over, you still get a
number:
 

Digits 3, 4 and 7 are not "reversible-7" numbers.

Q1.
Using "reversible-7" numbers, at least 1 of each of the 7 possible (0, 1, 2, 5, 6, 8, 9) place them in the smallest square possible so that all the numbers that are formed from top to bottom, of left to right are different prime numbers, and the same happens when we rotate the square 180 degrees.

Q2. Redo Q1 including both diagonals in the conditions.


We ask for your apologies but this clarification is needed. It's better last than never:

Rules of reading and counting the primes

The integers inside any of the two squares NxN (N= quantity of rows or columns) must be read from top to bottom (the columns) and from left to right (the rows). Regarding the diagonals one must be read from the upper-left cell to lower right cell; and the other diagonal must be read from the upper-right cell to lower-left cell.

This also means that any square NxN must have 2N distinct primes or 2N+2 distinct primes if diagonals are counted. Considering the original square and the rotated one, the expected total quantity of distinct primes must be 4N or 4N+4 if diagonals are counted.

Nevertheless, it may happen that one or several of the primes inside of any of the two squares could be emirps, increasing the total quantity of distinct primes contained in both squares.

In conclusion the total quantity of primes could be =>4N or =>4N+4 if diagonals are counted.

Of course any solution that satisfy the puzzle as was stated before the rules above described must be accepted as good in a fair play.

***    

During the week 11-17 Dec 2021, contributions came from Giorgos Kalogeropoulos and Oscar Volpatti.

***

Giorgos wrote:

Here is a 7x7 square and its rotation with 32 distinct primes
This qualifies for Q1 (as there is no 6x6 square with different primes)  and also Q2.

 
1 6 6 1 1 1 1                             6 6 1 1 6 1 1
6 8 5 8 8 6 9                             6 0 0 0 1 1 9
6 0 6 8 5 9 9   >>>>>>>>>>        6 1 2 1 0 9 1
1 9 5 9 9 6 1       rotation            1 9 6 6 5 6 1
1 6 0 1 2 1 9   >>>>>>>>>>        6 6 5 8 9 0 9
6 1 1 0 0 0 9                             6 9 8 8 5 8 9
1 1 9 1 1 9 9                             1 1 1 1 9 9 1

But because the following five integers are other distinct emirps: 1661111, 1696109, 1659011, 1026581 and 1196089, so the total primes of this solution is 37 distinct primes.

***

Oscar wrote:

For both Q1 and Q2, the smallest possible square S has side n = 6.

Each reversible digit is used at least once, so n^2 >= 7 and n >= 3.
An entry p can't have leading zeros: after a 180 degree rotation, they would become trailing zeros in reversal number p', which would be composite.
But both p and p' must be prime, so they have length exactly n, greater than 1, and they end with 1 or 9, as 3 and 7 are not permitted; being the reversal of each other, they also begin with 1 or 6.
In particular, for both square S and its reversal S':
bottom row and right column only contain 1 or 9;
top row and left column only contain 1 or 6;
top-right cell and bottom-left cell contain 1;
the interior of the square contains reversible digits 0, 2, 5 and 8, so (n-2)^2 >= 4 and n >= 4.
For 4 <= n <= 5, we don't have enough pairs (p,p') to fill the boundary of the square:
for n = 4, pair (1999,6661) only;
for n = 5, pair (19991,16661) only.
Hence, neither Q1 nor Q2 have solutions.

 
But for n = 6 there are three suitable pairs:
(111119,611111)
(111919,616111)
(119191,161611)
Let's choose the first two pairs, so that top-left cell contains 6 and bottom-right cell contains 9, and try to solve Q2.
Convention: main diagonal is read from top-left to bottom-right, minor diagonal is read from top-right to bottom-left.
Exaustive search provides 93 pairs (S,S'); for 14 such solutions, each reversible digit is used at least twice.

 
First example:
616111
100591
151051
128521
110881
111919
 
Both S and S' contain 14 distinct primes; of course entries 111119, 111919, 611111 and 616111 are repeated between S and S', also in the same position; the remaining 20 primes are distinct.

 
Second example:
616111
150221
180221
160009
119851
111119
An interesting symmetry: after flipping S along its minor diagonal and replacing each digit with its reversal, we obtain S again.
The prime on row k is the reversal of the prime on column 7-k; the prime on main diagonal is the reversal of itself. 

***

 

 

 

 

 

 

Records   |  Conjectures  |  Problems  |  Puzzles