Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

## Post a reply

Write your message and submit
|
Options

## Topic review (newest first)

bobbym
2013-09-17 04:44:34

Hi;

In post #2 there is a formula for generating any odd n. You will be able to program it easily. I have also showed you how to modify them for your type of numbers, also easy to program.

For even n, as I said there is a new paper. But it is unrefereed and not even checked. It claims to have algorithm for all even n too. I have not verified their work.

Here is one that I did using M for the algorithm in post #2, it is a 15 x 15.

bob bundy
2013-09-17 04:21:52

#### Agnishom wrote:

Is there a way to figure out the magic number without sorting a square?

If there are n rows, the magic number must be

sum{all numbers}/n

The method I use is partly trial and improvement.

(i) Add up all the numbers.  Divide by n to get the required total (=T) for any row.

(ii) Pick any set of n numbers that add to T.  Make that row one.

(iii)  Pick any set from the remainder that add to make T.  Make that row two.

(iv) Continue like this until you have all the rows or an impossible set left.

(v) If the latter juggle some numbers about until the rows all work.

(vi) Now shuffle the numbers only within their rows until a column works too.

(vii) Keep that column fixed but shuffle the remainder within their rows until all the columns work.

(viii) Swap whole rows or whole columns until the diagonals work too.

example with 1,2,3,4,5,6,7,8,9

(i) sum = 45 => T = 45/3 = 15

(ii)  I chose 9, 1, 5

(iii) Then I chose 7, 2 6 which meant the third row was bound to work as well: (iv)+ (v)  3,4,8  diagram one.

(vi) + (vii) see diagram two

(viii) The last two diagrams show whole row and column swaps.

Bob

Agnishom
2013-09-17 02:13:08

For example?

bobbym
2013-09-17 00:54:00

There is a formula for the general ones. You would have to do some extra work for your type.

Agnishom
2013-09-17 00:48:46

Yes. Is there a way to figure out the magic number without sorting a square?

bobbym
2013-09-17 00:28:29

That is just a different 4 x 4 magic square. There are more than one.

Check the rows and columns and diagonals, each will be 74.

Agnishom
2013-09-17 00:23:26

A box with all numbers from 11 to 26....perfect!

But you have shuffled them in post #4

bobbym
2013-09-17 00:18:20

Take a look at the square in post #8 and add 10 to every box. What do you get?

Agnishom
2013-09-17 00:17:03

How are these two related? I am totally confused

bobbym
2013-09-17 00:02:54

Hi;

Agnishom
2013-09-16 23:39:22

Known one?

bobbym
2013-09-16 23:03:16

I used a known one and plugged in your numbers.

Agnishom
2013-09-16 22:31:46

How did you do this?

bobbym
2013-09-16 15:07:45

Agnishom
2013-09-16 15:04:50

These are the numbers:
11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26

## Board footer

Powered by FluxBB