# magic square

Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last
• Sep 26th 2006, 05:51 AM
beta12
magic square
1) Suppose that S is a square such that the sum of the entries in each row is some number R, and the sum of the entries in each column is some number C.
Prove that S is in fact a magic square , i.e. R=C.

2) Prove that every regular square is necessarily magic.

How should I prove these two questions?
• Sep 26th 2006, 07:06 AM
CaptainBlack
Quote:

Originally Posted by beta12
1) Suppose that S is a square such that the sum of the entries in each row is some number R, and the sum of the entries in each column is some number C.
Prove that S is in fact a magic square , i.e. R=C.

If each row sums to R then the total sum is nR, where n is the number
of rows. Similarly if each col sums to C and there are m cols, then the total
sum is mC. But we have a square so n=m, so the total sum=nR=nC,
which implies R=C.

Quote:

2) Prove that every regular square is necessarily magic.
What is a regular square?

RonL
• Sep 27th 2006, 05:43 AM
beta12
Hi Captain black,

I don't quite get the meaning of " regular squares" as well as. If you can figure it out from the below question, please do teach me. Thank you very much.

Question
We say that n x n square is regular provided that:
a) Each of the integers from 0 to n^2 - 1 appears in exactly one cell, and each cell contains only one integer.
b) If we express the entries in base-n form , each base-n digit occurs exactly once in the units' position, and exactly once in the n's position.

For example:

7 3 2
5 1 6
0 8 4

expressed base 3 is

21 10 02
12 01 20
00 22 11

The square is regular because each of the ternary digits 0, 1, 2 appears exactly once in the units' and 3's in each row and each column.

* construct an example of 4 x 4 regular square.

Do you know how to construct such 4 x 4 regular square in both decimal and base - 4 notation?
• Sep 27th 2006, 07:45 AM
topsquark
Quote:

Originally Posted by beta12
Prove that every regular square is necessarily magic.

If I understand what you posted below for a regular square, this can't be proved. For example:

0 1 2
3 4 5
6 7 8

is a regular square by your definition, and it certainly isn't magic.

-Dan
• Sep 27th 2006, 07:52 AM
topsquark
Quote:

Originally Posted by beta12
Hi Captain black,

I don't quite get the meaning of " regular squares" as well as. If you can figure it out from the below question, please do teach me. Thank you very much.

Question
We say that n x n square is regular provided that:
a) Each of the integers from 0 to n^2 - 1 appears in exactly one cell, and each cell contains only one integer.
b) If we express the entries in base-n form , each base-n digit occurs exactly once in the units' position, and exactly once in the n's position.

For example:

7 3 2
5 1 6
0 8 4

expressed base 3 is

21 10 02
12 01 20
00 22 11

The square is regular because each of the ternary digits 0, 1, 2 appears exactly once in the units' and 3's in each row and each column.

* construct an example of 4 x 4 regular square.

Do you know how to construct such 4 x 4 regular square in both decimal and base - 4 notation?

There are methods to produce many types of magic squares. This one will produce a 4 x 4 magic square:

We want to write out the numbers 0 through 15 in order in a 4 x 4 matrix, but we only want certain positions filled. The pattern is as follows:

0 _ _ 3
_ 5 6 _
_ 9 10 _
12 _ _ 15

Now we want to do the same thing backward, that is starting from the lower right corner list the numbers 0 through 15 again, filling in the blank spots. This gives you a square:

0 14 13 3
11 5 6 8
7 9 10 4
12 2 1 15
Hopefully this will look okay when I post it. :) (Waaa! I want LaTeX back!)

This square is magic, as you can verify for yourself.

-Dan
• Sep 27th 2006, 12:20 PM
CaptainBlack
Quote:

Originally Posted by topsquark
If I understand what you posted below for a regular square, this can't be proved. For example:

0 1 2
3 4 5
6 7 8

is a regular square by your definition, and it certainly isn't magic.

-Dan

Write your square out in ternery and you have:

00 01 02
10 11 12
20 21 22

and since col-1 contains 0 in the units poition more than once this is
not regular.

RonL
• Sep 27th 2006, 12:24 PM
topsquark
Quote:

Originally Posted by CaptainBlack
Write your square out in ternery and you have:

00 01 02
10 11 12
20 21 22

and since col-1 contains 0 in the units poition more than once this is
not regular.

RonL

Ahhh, I see it now!

-Dan
• Sep 27th 2006, 12:25 PM
CaptainBlack
Quote:

Originally Posted by beta12
Hi Captain black,

I don't quite get the meaning of " regular squares" as well as. If you can figure it out from the below question, please do teach me. Thank you very much.

Question
We say that n x n square is regular provided that:
a) Each of the integers from 0 to n^2 - 1 appears in exactly one cell, and each cell contains only one integer.
b) If we express the entries in base-n form , each base-n digit occurs exactly once in the units' position, and exactly once in the n's position.

For example:

7 3 2
5 1 6
0 8 4

expressed base 3 is

21 10 02
12 01 20
00 22 11

The square is regular because each of the ternary digits 0, 1, 2 appears exactly once in the units' and 3's in each row and each column.

* construct an example of 4 x 4 regular square.

Do you know how to construct such 4 x 4 regular square in both decimal and base - 4 notation?

The sum of a row is (1+..+n-1)n+(1+..+n), and the same for any col,
hence the square in magic (this is the sum of the digits in the units position
plus n times the sum of the digits in the n position).

RonL
• Sep 27th 2006, 09:12 PM
beta12
0 14 13 3
11 5 6 8
7 9 10 4
12 2 1 15
Hopefully this will look okay when I post it. :) (Waaa! I want LaTeX back!)

This square is magic, as you can verify for yourself.

=======================

Hi topsquark,

I know how to construct any n x n magic squares.

But I don't understand how to express my answer ( for example the above 4 x 4 magic square) into both decimal and base-4 notation.

Can you explain to me how
7 3 2
5 1 6
0 8 4

changed to be base 3

21 10 02
12 01 20
00 22 11

Thks
• Sep 27th 2006, 11:22 PM
CaptainBlack
Quote:

Originally Posted by beta12
0 14 13 3
11 5 6 8
7 9 10 4
12 2 1 15
Hopefully this will look okay when I post it. :) (Waaa! I want LaTeX back!)

This square is magic, as you can verify for yourself.

=======================

Hi topsquark,

I know how to construct any n x n magic squares.

But I don't understand how to express my answer ( for example the above 4 x 4 magic square) into both decimal and base-4 notation.

Can you explain to me how
7 3 2
5 1 6
0 8 4

changed to be base 3

21 10 02
12 01 20
00 22 11

Thks

The digits d(0)..d(k) of the base n representation of N are non-negative
integers form {0, 1, .., (n-1)}, d(k) != 0, such that:

N=sum d(r) n^r

where d(0) is the least significant digit and d(k) the most significant.

Then it is clear that if we define

N(0)=N

d(r)=mod(N(r),n)
N(r)=[N(r-1)-d(r-1)]/n

Then if we stop when N(k)=0 that d(0), d(1), .., d(k) are the base n
digits of the base n representation of N.

Example N=27, n=5

N(0)=27

d(0)=mod(27,5)=2
N(1)=5

d(1)=mod(5,5)=0
N(2)=1

d(2)=mod(1,5)=1
N(3)=0

so the base 5 representation of 27 is (1)(0)(2).

RonL
• Sep 28th 2006, 01:34 AM
beta12
Hi CaptainBlack,

So how so I express

0 14 13 3
11 5 6 8
7 9 10 4
12 2 1 15

in both decimal and base-4 notation?

I am still looking at your explaination about the tenary digit. Not quite get it at this moment....:(
• Sep 28th 2006, 04:44 AM
topsquark
Quote:

Originally Posted by beta12
0 14 13 3
11 5 6 8
7 9 10 4
12 2 1 15
Hopefully this will look okay when I post it. :) (Waaa! I want LaTeX back!)

This square is magic, as you can verify for yourself.

=======================

Hi topsquark,

I know how to construct any n x n magic squares.

But I don't understand how to express my answer ( for example the above 4 x 4 magic square) into both decimal and base-4 notation.

Can you explain to me how
7 3 2
5 1 6
0 8 4

changed to be base 3

21 10 02
12 01 20
00 22 11

Thks

Quote:

I know how to construct any n x n magic squares.
Really? Do you know how to do a 6 x 6? I don't know how to do those.

We wish to convert the numbers 0 - 8 to base 3. The simplest way is just to count them.
0 -- 00
1 -- 01
2 -- 02
3 -- 10
4 -- 11
5 -- 12
6 -- 20
7 -- 21
8 -- 22
(Where the first column is in base 10 and the second column is its equivalent in base 3.)

The base 4 counting works the same way:
0 -- 00
1 -- 01
2 -- 02
3 -- 03
4 -- 10
5 -- 11
6 -- 12
7 -- 13
8 -- 20
9 -- 21
10 -- 22
11 -- 23
12 -- 30
13 -- 31
14 -- 32
15 -- 33
And just make the replacements.

So the 4 x 4 square I showed you will become:

00 32 31 03
23 11 12 20
13 21 22 10
30 02 01 33

So if I (finally) have the definition of a regular square correct, this square is not regular.

-Dan

The flaw in my construction method is probably that the methods I know also cause the diagonals to have the same sum as the rows and columns. I don't know if that can be done for a regular square.
• Sep 28th 2006, 05:54 AM
beta12
Quote:

Originally Posted by topsquark
Really? Do you know how to do a 6 x 6? I don't know how to do those.

Please take a look of this web for constructing 4n+2 magic squares.
The Other Series Solution

======================================
So the 4 x 4 square I showed you will become:

00 32 31 03
23 11 12 20
13 21 22 10
30 02 01 33

So if I (finally) have the definition of a regular square correct, this square is not regular.

-Dan

The flaw in my construction method is probably that the methods I know also cause the diagonals to have the same sum as the rows and columns. I don't know if that can be done for a regular square.

Yes, I have just found out from the book that ==whenever the uniform step method gives a filled magic square, that square is regular.

I think we should use uniform step method to construct this 4 x 4 regular square.
• Sep 28th 2006, 06:36 AM
topsquark
Quote:

Originally Posted by beta12
Yes, I have just found out from the book that ==whenever the uniform step method gives a filled magic square, that square is regular.

I think we should use uniform step method to construct this 4 x 4 regular square.

Fascinating. The last I knew the 6 x 6 and 10 x 10, etc. had been solved (for at least several solutions) but not that a method for constructing them had been found. Thank you! (The geek in me is truely satisfied. ;) )

The site you mentioned has the methods that I know for how to construct a 4n x 4n square and this is obviously not the "uniform step method" construction as my 4 x 4 wasn't regular. Would you be willing to share this construction method?

-Dan
• Sep 28th 2006, 07:12 AM
beta12
Hi Topsquark,

The website is very good!

I used the uniform step method but the square which it produced is not magic.:(

Uniform step method does not gurantee can product a filled magic square.

Here is the example of application of U S M of 5 x 5 magic square with magic sum 60:

19_7_20_13_1
10_3_16_9_22
6_24_12_0_18
2_15_8_21_14
23_11_4_17_5

you need to set the value of a , b , c, d, e, f,
a = 4 ( since x0=4)
b = 3 (since y0=3)
c=1 (xj move RHS by 1)
d = 2(yj move up by 2)
e = 1 ( xj move RHS by 1 from 0 to 5)
f = 3 (yj move up by 3 from 0 to 5)

note:
you can put the initial number (0) anywhere in the cell. so a, b is changing according to the position of the initial number.

c , d is fixed

e and f apply when

Hope this information is helpful to you.
================================
But this one will work as a regular square
0_5_10_15
11_14_1_4
13_8_7_2
6_3_12_9

Finally, I solved it! :)

===========================
Can anyone construct the below 9 x 9 square?
# Construct a 9 x 9 filled, magic square using the integers from 0 to 80. Your magic square should additionally have the property that when it is divided into ninths, each 3 x 3 subsquare is also magic.
Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last