Results 1 to 15 of 15

Thread: Magic Square, definition?

  1. #1

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Magic Square, definition?

    If a magic square is defined as:

    Eric W. Weisstein. "Magic Square." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/MagicSquare.html
    A magic square consists of the distinct positive integers 1, 2, ..., n2, such that the sum of the n numbers in any horizontal, vertical, or main diagonal line is always the same number
    What is this called?

    A ??? consists of the distinct positive integers k, k+1, k+2, ..., k+n2-1, such that the sum of the n numbers in any horizontal, vertical, or main diagonal line is always the same number

  2. #2
    Fanatic Member twanvl's Avatar
    Join Date
    Dec 2001
    Posts
    771
    A magic square with each cell +k-1?

  3. #3

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    So you would agree that the case of where a Magic Square starts with k is simply a linear transformation of a Magic Square starting with 1, and it would be a trivial distinction to define a Magic Square as starting with k?

  4. #4
    Fanatic Member twanvl's Avatar
    Join Date
    Dec 2001
    Posts
    771
    Yes, but traditionally Magic Squares start at 1, not at k, so maybe it's better to call it a 'Generalized Magic Square' or something

  5. #5
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    hey! what's the "rules" on magic squares/cubes?
    can the same number be used many times?
    can the numbers be random or do they follow some pattern?
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  6. #6
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    The standard definition uses the integers from 1 to n2.

    It is interesting to use zero to (n2 - 1) and radix n notation.

    For n > 3, you can create squares with various special properties. The definition is sometimes expanded for special squares. For example, you can create bordered squares of order (n+2). These contain a central n*n square which is magic. The central square uses the middle of the range: 1 to (n+2)2.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  7. #7
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    whats the point?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    Kedaman: Constructing Magic Squares is interesting to some people. When very young, I was both fascinated and challenged by them. It might have been a child who coined the term Magic.

    The construction of ordinary squares is easy. The construction of squares with special properties is a bit more difficult. For ordinary squares, there are four well known algorithms which are simple to apply. One algorithm does not work for every order.

    They have some aesthetic appeal. I used them as a learning tool for Visual Basic. Writing a VB application for generating Magic Squares was both fun and educational.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  9. #9

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    So, what's everybody's opinion?

    Which do you consider more important, or rather, which part of the definition of a Magic Square is most important in relation to it being "Magic" {heh, outside of every row summing to the same "Magic Number"}:
    [list=1][*]That the range of numbers used in the cells of the Structure are continuous, ie, that from "LowNum" to "HighNum" every single integer is included?[*]That the range from "LowNum" to "HighNum" must start where LowNum = 1?[/list=1]


    -Lou

  10. #10
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    NotLKH: Continuous range seems more essential. Otherwise, I think you are dealing with a different game.

    Starting with some value other than one or using an arithmetic progression (say 1, 3, 5, 7, . . .) allows the use of the same algorithms for building squares.

    If you allow the use of arbitrary numbers in the square, I think you are building a different class of Magic Squares. It might be more or less interesting. I wonder what the rules might be.
    • You might pick an arbitrary number for the sum and start to work, using any numbers you choose. For some choices of sum, you might need to use negative numbers.
    • Perhaps you pick n2 arbitrary numbers and start to put them into a square, trying to get a constant sum for all the rows, columns, and diagonals. I wonder if there might be two possible sums for certain sets of n2 arbitrary numbers. I wonder if some sets of numbers cannot be arranged to make a magic Square.
    • It is not possible to pick both n2 arbitrary numbers and an arbitrary sum, although I imagine there are some degrees of freedom here.
    If I have time, I might play with my VB application which either fills the square automatically or allows the user to fill in the squares.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  11. #11

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Originally posted by Guv
    NotLKH: Continuous range seems more essential. Otherwise, I think you are dealing with a different game.
    I definitely agree.
    If you define a Magical Structure with the strict requirement that it must start with the number 1 then you can be pigeonholed into overlooking all the others, especially if there exists a structure which has only 1 magical arrangement of any size that starts with 1, thus saying that there exists only 1 such Magic Structure, and no other can exist.

    Again, Its a trivial distinction with magic squares, but I know of another structure where this requirement has definetely hurt its usefulness as a mathematical recreation.

    Perhaps that will soon change...


  12. #12
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    NotLKH: For order 3, there is only one magic square if you use the integers from 1 to 9. It can be reflected & rotated, but that does not really change its structure. In a sense, using an arithmetic progression of 9 integers does not result in squares with any essential differences.

    Using the integers from 1 to n2, for order 4 and up, the sky becomes the limit. There are 880 order 4 squares, which can be reflected and/or rotated to produce 7040 variations. For order 5, I do not think anybody knows how many squares are possible. It is known that more than 13 million are possible.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  13. #13

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    GUV
    True, Magic Squares have been the defacto Magic Structure, but I'd like to see Magical Hexagons ascend to be on par with Magic Squares.

    The point of this thread is that Magic Hexagons, by there definition, with the requirement that they must start with 1, {See the bottom right text in this link: http://www.vbforums.com/attachment.p...postid=1656146 }has meant that, since there is One and Only One Magic hex that starts with 1, that there are absolutely no others. But, if we relaxed that 1 requirement, but keep the continuous range, then we see that there are also 36 Three Ring Magical hexes that start with -4 and end with 14, adding to 19,, and 19 Three Ring Magical Hexes that start with -9 and end with 9, adding to 0.

    There are millions of 4 ring magical hexes, {I've got over a million on my pc}, and countless 5, 6, ... ring magical hexes.

    And, of course, I'm not counting their rotations, reflections, or their negative 1 multiples.

    -Lou

  14. #14

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Hmmm.

    I just got a Letter from a certain Mr. Martin Gardner. This highly respected Recreational Mathematist was kind enough to respond to something I sent him a few days ago. He regards my work on Magical Hexagons as "path-breaking results on Magic polygons".



  15. #15
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    NotLKH: Martin Gardner is one of my favorite people and a man to be respected. His columns in Scientific American were delightful. I read almost all of them.

    Congratulations!! It is to your credit that he considers your work path breaking.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width