A magic 8?

Algebra Level 2

Nine consecutive integers are placed in the squares of a 3 × 3 3 \times 3 grid.

Every column, every row, and every diagonal add up to the same number n n and the middle number is 8. 8.

What is n ? n?


The answer is 24.

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.

11 solutions

Geoff Pilling
Sep 15, 2018

If each row adds up to n n , then all 9 9 squares add up to 3 n 3n .

Also, if we add up the four lines that pass through 8 8 , we get the sum of all squares + 3 + 3 additional 8 8 's, or 3 n + 3 8 3n + 3 \cdot 8 . But this also adds up to 4 n 4n , since it is four groups of three that add up to n n each.

Therefore 3 n + 3 8 = 4 n 3n + 3 \cdot 8 = 4n , or n = 24 n = \boxed{24}

Here is one way to do it:

5 10 9
12 8 4
7 6 11

As a matter of interest, I think the 9 consecutive integers are 4 through 12. Ed Gray

Edwin Gray - 2 years, 8 months ago

Log in to reply

Yes. Yes they are! 😃

Geoff Pilling - 2 years, 8 months ago

The "standard" magic square has a 5 in the centre square, so I just added 3 to all the entries in a standard square to create a solution, e.g.,

5 .... 10 ..... 9

12 ... 8 .... 4

7 ..... 6 .... 11

Brian Charlesworth - 2 years, 8 months ago

Log in to reply

Wow! This was smart!

James Bacon - 2 years, 8 months ago

I performed an equivalent process in my head, again starting from knowing the numbers that feature in the standard 3 x 3 magic square.

Thomas Sutcliffe - 2 years, 8 months ago

I don't know if this counts as cheating but I took all squares to have the value 8 since this satisfies every condition of the question.

Abha Vishwakarma - 2 years, 8 months ago

Log in to reply

Clever... But all the integers have to be consecutive... 🤔

Geoff Pilling - 2 years, 8 months ago

Log in to reply

Ahhh... there. I missed that part. Thank you :-)

Abha Vishwakarma - 2 years, 8 months ago

Looks like this proves that the numbers don't even need to be consecutive. In other words: The rows, columns and diagonals in any 3x3 magic square add up to three times the center square, by extension of the above proof.

Willem Monsuwe - 2 years, 8 months ago

Log in to reply

Ah yes, you're right... Looks like this solution doesn't refer to the fact that they are consecutive at all! Which makes me wonder, is there a solution where they aren't consecutive? @Brian Charlesworth

Geoff Pilling - 2 years, 8 months ago

Log in to reply

Sure! A magic square maintains it "magicness" under multiplication, e.g.,

10 ..... 20 ..... 18

24 ..... 16 ..... 8

14 ..... 12 ..... 22

You can then add or subtract a constant from each entry as done in your solution example. In other words, "magicness" is closed under linear transformations.

Brian Charlesworth - 2 years, 8 months ago

Log in to reply

@Brian Charlesworth Ah yes of course... How about not following an arithmetic progression?

Geoff Pilling - 2 years, 8 months ago

Log in to reply

@Geoff Pilling I think so. We can also add magic squares to one another to get another magic square, so I took a magic square, did a linear transformation followed by a rotation, then added it to the original magic square to get the following non-A.P. example:

17 .... 8 ..... 23

22 .... 16 ... 10

9 ..... 24 .... 15

Looking at this, I've combined three A.P.;s, namely (8,15,22), (9,16,23) and (10,17,24), (or looked at another way (8,9,10), (15,16,17) and (22,23,24)).

Brian Charlesworth - 2 years, 8 months ago

Log in to reply

@Brian Charlesworth There will always be two sets of three A.P's. This is easily shown if you start out with three variables and fill out the square as such:

? a ?

? ? ?

a+b ? a+c

From this, you can deduce the rest of the squares:

a+2b+c a a+b+2c

a+2c a+b+c a+2b

a+b a+2b+2c a+c

The progressions: (a, a+b, a+2b) (a+c, a+c+b, a+c+2b) (a+2c, a+2c+b, a+2c+2b) and the ones with the roles of b and c reversed.

Willem Monsuwe - 2 years, 8 months ago

There are exactly 9 solutions (9 different squares) all containing consecutive integers from 4 through 12.

Stefano Micheletti - 2 years, 8 months ago

Log in to reply

Are you sure? By my count I get 8. 4 ways to choose the top left corner (must be odd) and once its chosen, 2 ways to choose the bottom left corner. The rest fall right into place. 2 4 = 8 2\cdot4 = 8

Geoff Pilling - 2 years, 8 months ago

Actually, I did it without assuming any number .Just put a,b,c in the first row then go on to fill the rest boxes to have a fixed sum of "n". In my case the middle row is like this:

8+c-a----------8----------8+a-c

Now simply that directs us to n=24

In order to fill the square with any integer There is infinitely many solution.

Ritabrata Roy - 2 years, 8 months ago

However in all such solution we must have n=24

Ritabrata Roy - 2 years, 8 months ago

That is very clever!

Daniel Podobinski - 1 year, 3 months ago
David Vreken
Sep 22, 2018

A square in which every column, row, and diagonal add up to the same number is called a magic square . A well-known 3 × 3 3 \times 3 magic square is as follows, where the middle number is 5 5 and every column, row, and diagonal add up to 15 15 :

Adding 3 3 to every number in the above magic square would change the middle number to 8 8 , but now every column, row, and diagonal would add up to 15 + 3 3 = 24 15 + 3 \cdot 3 = \boxed{24} .

Oh, this is a very neat solution!

Scott Bartholomew - 2 years, 8 months ago

But they are not consecutive

Stefano Micheletti - 2 years, 8 months ago

Log in to reply

The numbers used are consecutive: 4, 5, 6, 7, 8, 9, 10, 11, 12

David Vreken - 2 years, 8 months ago

Log in to reply

Yes, you are right, sorry!

Stefano Micheletti - 2 years, 8 months ago
Ossama Ismail
Sep 15, 2018

When using consecutive integers to bulid the given table n = 3 × m n = 3 \times m where m m is the middle number.

In this case m = 8 then n = 3 × 8 = 24 m = 8\ \ \text{then}\ n = 3 \times 8 = 24

Explained this simple, math becomes beautiful and almost an artform.

Thomas Oppenlænder - 2 years, 8 months ago

Log in to reply

You may check the solution given by Brian.

Ossama Ismail - 2 years, 8 months ago

easy if you happen to know this rule, but this doesn't explain/prove the rule

Thomas Langerwerf - 2 years, 8 months ago

Log in to reply

That's not a rule, because the numbers don't need to be consecutive.

Willem Monsuwe - 2 years, 8 months ago

Not an explanation of the problem's answer, though.

Darwyn Klatt - 2 years, 8 months ago

I'm not satisfied with answers given above. My result is 12. 0 1 2 7 8 6 5 3 4 Consecutive numbers, aren't they?

NusarP InoHD - 2 years, 8 months ago

Log in to reply

But 8 is not in the middle.

Niranjan Khanderia - 2 years ago
Tobias Kallehauge
Sep 29, 2018

Here is my brute force method of doing it using python and the Itertools package. Not the most intelegent way to do it... but it is fun programming :D

Prints out: [[ 5 10 9] [12 8 4] [ 7 6 11]]

Brian Bohan
Sep 24, 2018

Consider any magic square with a center of value x. To get every value to be the same, you need to balance the values surrounding it. A good way to go about this is with modular math, which is this in the case of consecutive numbers.

x-1 x-2 x+3
x+4 x x-4
x-3 x+2 x+1

As you can see, the amounts over and under x manage to cancel out in each row, square, and column. You wind up with each row, square and column being 3x. In this case, 24.

That's how I did it too! Nice.

Miguel B - 2 years, 8 months ago
Vinod Kumar
Sep 24, 2018

The well known solution for 1 to 9 consecutive digits is 15 and it has 5 at the center instead of 8. Therefore adding 3 to each digits gives us consecutive digits from 4 to 12 with 8 at the center and

Answer=15+3*3=24

Mark Lunt
Sep 26, 2018

Nine consecutive numbers containing 8 can be anything from 1 to 9 to 8 to 16. Since 8 is the middle number of the grid, all the other numbers must include the 8 in a sum of three numbers that has the same total. To make this feasible, the largest number, plus 8, plus the smallest number must give the same sum as the second largest number, plus 8, plus the second smallest number, and so on. From this it follows that 8 must be the middle value number of the sequence, so the sequence must be 4 to 12. Hence 4 + 8 + 12 = 24

Edwin Gray
Sep 24, 2018

I recall that the standard magic square had 5 in the center with the sum n = 15. Add 3 to every square, and we get the numbers 4 through 12 with 8 in the center. Their sum = 72, and id we divide by 3, n = 24. Ed Gray

Apratim Ganguly
Sep 30, 2018

If we go backward and forward in the grid from 8 , rest of the numbers are 7,6,5, 4 and 9,10,11 and 12 . If we add all of them we have 16*9/2=72 . Hence each row or column or diagonal adds upto 72/3 = 24

P A
Sep 24, 2018

Prolog program to derive solution to magic square. just ask (type) ?- g(X).

soma1([A,B,C,D,E,F,G,H,I],N):- N is A + B + C. soma2([A,B,C,D,E,F,G,H,I],N):- N is D + E + F. soma3([A,B,C,D,E,F,G,H,I],N):- N is G + H + I. soma4([A,B,C,D,E,F,G,H,I],N):- N is A + D + G. soma5([A,B,C,D,E,F,G,H,I],N):- N is B + E + H. soma6([A,B,C,D,E,F,G,H,I],N):- N is C + F + I. soma7([A,B,C,D,E,F,G,H,I],N):- N is A + E + I. soma8([A,B,C,D,E,F,G,H,I],N):- N is C + E + G.

lista([4,5,6,7,8,9,10,11,12]). verifica(L,N):- soma1(L,N), soma2(L,N), soma3(L,N), soma4(L,N), soma5(L,N), soma6(L,N), soma7(L,N), soma8(L,N).

go(N):- lista(L), permutation(L,Ls), [A,B,C,D,E,F,G,H,I] = Ls, E = 8, verifica([A,B,C,D,E,F,G,H,I],N), faz([A,B,C,D,E,F,G,H,I]).

faz([A,B,C,D,E,F,G,H,I]):- write([A,B,C]), nl, write([D,E,F]), nl, write([G,H,I]), nl.

B D
Sep 17, 2018

The rule for solving magic squares with 1 digit(the digit has to be in the center) is that 3 times the middle digit or n as you have to find.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...