A magic square consists of a 3 × 3 grid filled in with the digits 1-9 such that every column, row, or diagonal adds up to the same constant (typically 15).
Is it possible to fill each box with a distinct integer such that the product of every column, row, or diagonal is the same number?
Note: The integers don't need to be the numbers 1-9.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
But the numbers must be between 1-9
Log in to reply
It says integer in the final question... But I've clarified the question.
Log in to reply
If you read the note, you’d actually understand.
Nice! I believe that the smallest multiplicative magic square "product" is 216, e.g.,
18 .... 1 ..... 12
4 ..... 6 ..... 9
3 ..... 36 .... 2
Log in to reply
Can you prove that claim?
Log in to reply
I think you'd need to use unique factorisation: the product of row/columns can be factorised as p 1 i 1 p 2 i 2 ⋯ p n i n . Each entry of the square is also of this form.
In the case n = 1 you reduce yourself to standard magic squares and get the smallest product to be 2 1 2 = 4 0 9 6 . In the case n = 2 you are looking at Graeco-latin square and the smallest is the one with primes 2 and 3 (i.e. the one given above). In the case n ≥ 3 , you can show that i j ≥ 2 (probably i j ≥ 3 is true) and get a minimal product of at least 300.
Log in to reply
@Antoine G – Why 2^12 and not 2^15=32768, though?
Also, if all powers need to be >=3 (which was basically proven by Yatin above), then minimal value would be 27000. :-B
Log in to reply
@C . – The "traditional" magic squares has integers from 1 to 9. If you add the same number to all numbers in a magic square, you still get a magic square. So let's add -1 to get a magic square with numbers from 0 to 8. 0 is not a positive integer but when you take the powers of 2, 2 0 = 1 .
So basically, since it is known that the smallest magic square is the standard one (minus 1 if you accept 0), the smallest "product magic square" with only one prime has a product of p 1 2 which is much bigger than the actual 216.
Here is the square:
2^1 | 2^6 | 2^5
2^8 | 2^4 | 2^0
2^3 | 2^2 | 2^7
=
2 | 64 | 32
256 | 16 | 1
8 | 4 | 128
So to recap: with one prime it's a 2 1 2 ; with two primes it's a Graeco-Latin square (with smallest elements being a = 2 0 , b = 2 1 , c = 2 2 , α = 3 0 , β = 3 1 , γ = 3 2 ); with three primes [using Yatin's comment which came some days afterwards] you get at least ( 2 ⋅ 3 ⋅ 5 ) 3 = 2 7 0 0 0
Would you accept a brute-force approach, Marcus? :)
The reason this is the smallest, likely has to do with the center number.
This has to be:
6 fits the bill!
It can be easily proved that the product is actually the cube of the number in the central square. Hence, we only need to check cubes; 8,27 and 125 are cubes of primes we cannot have so many distinct factors for them. 64 too doesnt have enough factors required.
As for proof consider:
a b c d e f g h i
As the magic square and K as product.
K=abc=def=ghi=aei=beh=ceg=def
K=K^4/K^3 = (aei)(beh)(ceg)(def)/((abc)(def)(ghi) = e^3.
Brilliant way of viewing it! Bravo!
Wow! Brilliant!
Such simplicity much wow.
Of course (slapping my forehead)! Why didn't I think of that? Very nice!!
I found exactly the same solution ;)
I did not read the note, I really do need to read more
Amazing!!!!
The solution can be generalized with any number set a^n+bc where c is -3,4,-1 on top row; 2, 0 -2 in middle row; and 1, -4, 3 on bottom row. The values a, n, and b can be anything and gives pretty much infinite solutions to the problem.
Log in to reply
Not quite sure I understand... 🤔
Log in to reply
He's talking about the additive square of the exponents.
how though
A general solution could be of the form:
h f | b | d h |
d | b h | f |
b f | h | b d |
With the additional constraint:
bh = df.
Take b,d,f,h to be square numbers satisfying the constraint and you are done!
I think your solution is the best one.
Log in to reply
Apart from b, d, h and f not exactly needing to be square numbers (see the 2^n solution), yes, I agree with you.
Log in to reply
I said square numbers because in order to fill the grid with integers, the easiest way is to have b,d,f,g as squares.
Why did you choose b, d, h and f, may I ask?
Log in to reply
I started off with 9 unknowns - a to i. But after reducing a couple of equations was left with only 4 : b,d,f,g.
The most prefectest answer i've seen
Here's another solution
1 2 | 1 | 1 8 |
9 | 6 | 4 |
2 | 3 6 | 3 |
where all the products equal to 2 1 6
Very nice! As @Brian Charlesworth pointed out to me earlier this could be the one with the smallest integers!
Log in to reply
oh, I didn't see Brian's comment posted earlier
I love it! Hmm. I see that each row, column, diagonal has three factors each of 2 and 3. Do they have to have three? Could I have four factors of 2 and two of 3?? (A common sum of 144?)
Log in to reply
Any magic square of powers of any prime number or factor can be thrown in. For example, throwing in the prime number 5
6 0 | 9 | 5 0 |
2 5 | 3 0 | 3 6 |
1 8 | 1 0 0 | 1 5 |
Log in to reply
And yet three of each - 2 and 3 and 5 - in each row, column, diagonal.
But I’m looking for a lower product than 216.
Log in to reply
@Phillip Wagoner – These numbers are not distinct, however. But you get the idea.
4 | 1 | 2 |
1 | 2 | 4 |
2 | 4 | 1 |
Log in to reply
@Michael Mendrin – I’m looking for distinct numbers. Maybe based on powers of 2. But all I get is
2^1 2^8 2^3 2^6 2^4 2^2 2^5 2^0 2^7
And each product is 2^12. Decidedly not less than 216.
Michael, your use of factors of powers of 2 and 3, I see, is the key. 1,2,3,4,6,9,12,18,36 increases much more slowly than powers of 2 alone: 1,2,4,8,16,32,64,128,256.
A beautiful solution, Michael. Thanks for sharing.
Log in to reply
@Phillip Wagoner – For distinct integers, 216 is the minimum possible product.
@Phillip Wagoner – Nope, i just ran a computer program to check all possible products up to 220. Only 8 solutions exist with that restriction: the rotations and mirror images of what Michael provided.
However, the first in "alphabetical" order would be 2 9 12 / 36 6 1 / 3 4 18 :-B
Not sure you can get to LESS than 3 factors... Looking on the separate power-squares, each of them has a diagonal where the product is formed with 1 factor from each row/column.
The reason this is the smallest, likely has to do with the center number.
This has to be:
6 fits the bill!
You could replace every number with 5
Numbers need to be distinct.
Don't know how to make boxes in comment, so... Row 1: AD--BE--CF Row 2: CE--AF--BD Row 3: BF--CD--AE Substitute any value for the alphabet, the product will be ABCDEF.
The idea is that say that you have: 35 6 9 5 34 11 10 10 30 The number is 50 (Sorry about the diagonals, plz don’t judge me for that, or the line thing, it was a square when I typed it(if there’s an error at all))
There have been many squares that sum to a constant (50 in your case)... but the problem was asking about MULTIPLYING the numbers to get to a constant product.
Also, you have the number 10 twice in there. All the numbers need to be distinct. :-B
And saying "sorry about the diagonals" doesn't cancel the fact that diagonals not having the same sum WILL make your square not a perfectly magic one, even if it did have all numbers distinct.
The integers need to be distinct.
Ah, my mistake
Assuming 0 is a possible number, out it in the center of the box for a consistent product with any other number.
The problem then becomes the outer rows and columns... 🤔
Just fill each field with the same number. It works with any number.
Convert the multiplication problem into a summation problem bu using the numbers in the given solution as exponents to any fixed integer base where |base| > 1.
That would work, except that the integers all need to be different.
If the digits don't have to be 1 - 9, they could all be identically 1 or 0, so the products are 1 or 0. Found two cases in half a second so I bet clever people more interested could easily find more.
The question specified distinct integers.
You can use the original pattern to create an infinite number of different possibilities. Just add a random constant K to each square and the results of the rows, columns and diagonals will now be 15 + 3K
Problem Loading...
Note Loading...
Set Loading...
Since, multiplying two numbers together is like adding exponents, you can take the above square, and replace n with 2 n in each case, giving: