# Magic Square Primes At Most

Take 9 numbers from 1~20 without repetition and fill them in a 3x3 grid so that the sums on each row, each column, and each diagonal are the same. If there are a primes among these 9 numbers at most, and that the largest prime is b, find a x b.

The answer is 133, which means a = 7 and b = 19, but I can't find the complete square numbers.

• You should start by adding a note to the question that tells where this puzzle is from. (This is required by the site policy, when you post a puzzle to which you don't own the copyright.) Then, take any "regular" magic square with digits 1-9, double each number, and add one.
– Bass
Jul 12 '21 at 16:22

The following is a full solution to the original puzzle, without cheating from knowing the values of a and b.

The primes under 20 are 2, 3, 5, 7, 11, 13, 17, and 19.

If we assume all eight primes are used:

Observe that 2 is even and the other seven are odd. Regardless of the ninth number in the grid, you will have one line full of odd primes (which sums to an odd number), and another line containing the number 2 and two odd primes (which sums to an even number). Since an odd number cannot be equal to an even number, we cannot use all eight primes.

Now,

Let's try using the seven odd primes. My instinct tells me that the seven primes are part of the nine consecutive odd numbers: 3, 5, 7, 9, 11, 13, 15, 17, 19. They can easily form a magic square, in the same way 1 through 9 are laid out.

One possible magic square is

17  3 13
7 11 15
9 19  5

• A magic square is one where the sum of all rows, columns, (and by some definitions, diagonals) are the same. Jul 12 '21 at 15:31