Books about
Magic Squares
at Amazon.Canada


Amazing Math Whiz

products available:

Buttons, Magnets,
t-shirts, Tote bags,
Teddy bears, & more

Books about Magic Squares at Amazon.com

Be sure to visit the
Magic Squares Main Menu
for other topics including Irregular Squares, Algebraic Squares and more.

Other 4N+2 Magic Square Sizes:
Detailed Directions for: 6x6 * 10x10 * 14x14 *
and many more examples
* 18 * 22 * 26 * 30 * 34 * 38 * 42 * 46 * 50 * 54 * 58 *
* 62 * 66 * 70 * 74 * 78 * 82 * 86 * 90 * 94 * 98 *

A 38x38 Magic Square

Scroll down to see a magic square
in which all rows, columns, and both diagonals
add up to the same magic sum (27455)

A Magic Square is a square of numbers in which every row, every column, and both diagonals add up to the same number. This number is often called the magic sum. The 38 by 38 magic square shown below has a magic sum equal to 27455.

Though magic squares can be made with non-consecutive and non-regular sequences, they are usually seen made up of consecutive numbers, possibly because it is harder to be consecutive.

The method described below can be used to create all 4N+2 even-size squares that are at least 10x10 in size, where the size is equal to double any odd number. This is just one method for creating magic squares, there are many other methods, just as there are millions and millions and millions (many millions if not billions or trillions) of these squares to be found.

Read more about Magic Squares

If you'd like to read more about magic squares, click one of these links to look for books about Magic Squares at Amazon.com, at Amazon.canada, and at Amazon.co.UK.

Books about
Magic Squares
at Amazon.co.UK


Support Our Site
by purchasing our
Amazing Math Whiz
products

and other
Amazing Messages



How to Create a 38x38 Magic Square
with a Magic Sum of 27455

The method described on this page can be used to create 14x14, 18x18 and larger 4N+2 magic squares

Steps:

  1. Create an overlay 38x38 Magic Square grid consisting only of the numbers 0, 1, 2 and 3
  2. Create a 19x19 Magic Square (half the size of our final 38x38 square) that starts with the number 1
  3. Double the size of that 19x19 Magic Square, quadrupling every number, to create a 38x38 magic square that has each number in it four times.
  4. Subtract the numbers in the overlay grid from the quadrupled numbers in the doubled square to make your new square.
    Alternate directions: You may create a 19x19 Magic Square that starts with zero in step 2 if you add the two squares together in step 4.

Step One: Create a 38x38 Magic Square overlay grid

Since we are going to create a magic square that contains each number four times, we need to also create a magic square consisting only of the numbers 0, 1, 2 and 3, and we need to make sure that each 2x2 part of this overlay grid contains all four numbers.

When I created my 6x6 Magic Square page, I knew that one method of creating these squares was to simply double the size of the 3x3 magic square, quadrupling its values, then use brute-force to find an overlay pattern that satisfied my requirements (every number from 0 to 3 overlaying each identical number in the quadrupled square, in such a way that every row, column and diagonal added up to 9). Imagine my surprise when I found over a million different overlay squares. You can see information about how I brute-forced that solution at www.mazes.com/magic-squares/magic-06.html.

Obviously, I do not want to brute-force a 10x10 or larger 4N+2 magic square (there must be billions and billions of answers), so I decided to seek out a method of creating an overlay grid that will work with all 4N+2 squares larger than 6x6. I decided to use binary numbers as part of my search for a universal method. Binary (or base two) numbers, as many math students know, use the digits 0 and 1 to represent any number. The binary equivalents for the decimal (or base 10) numbers 0, 1, 2 and 3 are 00, 01, 10, and 11. Since half of each binary number represents whether or not the 1 is present, and half of each number represents whether or not the two is present, I decided to create two temporary overlay grids, one for the value 1, and one for the value 2, so that each square was independently magic.

Also, I wanted to make it easy for you, my visitor, to use the same method with pencil and paper, so I wanted to use basically the same grid twice, just doubling the "one" grid to get the "two" grid, with a simple rotation to make sure that the sum of the values will be different.

Create a 38x38 Magic Square of all 1's and 0's

Here are the steps to create the first grid (based on the pattern '11100000000000000000001111111111111111'):
  • Draw a 38x38 grid on your paper.
  • Put the number 1 into the first column of the first 3 rows of your grid
  • Put the number 0 into the first column of the next 19 rows of your grid
  • Put the number 1 into the remaining spaces of the first column.
  • Double-check your work. You should now have 19 1's and 19 0's in the first column, which I have bolded so you can see it clearly. As a further double-check, you have used the digits in the pattern '11100000000000000000001111111111111111')
  • For the second column, put the opposite number ... if there is a 1 in the first column, put 0 in the second column, and vice-versa.
  • Double-check. The first column and the second column number should add up to 1.
  • Copy the first column to the third column, and copy the second column to the fourth column.
  • Turn the first two columns upside-down and copy them into the fifth and sixth columns.
  • Copy the fifth and sixth columns to the rest of the square.
  • Double-check. Each row, each column and both diagonals should have exactly 19 1's in it.

Create a 38x38 Magic Square of all 2's and 0's

Here are the steps to create the second grid:

  • Rotate the first grid 90 degrees counter-clockwise and
  • double all the numbers.
  • You can see how the bolded left column has become the bolded bottom row after rotation.

Add Magic Square 1 to Magic Square 2

And, of course, here are the steps to create the third grid, which is your overlay grid:

  • Add the two squares together
  • You should end up with every 2x2 block containing all four digits, 0, 1, 2 and 3.
  • (I have bolded alternating 2x2 blocks so that you can see this more easily.)
  • and, if you have done the work properly, each row, each column, and both diagonals add up to the same magic sum.
  • Lay this grid aside for a few minutes. You won't need it until after you've finished your quadrupled grid

Step Two: Create a 19x19 Magic Square

Next, you need to create a magic square that is half the size as your desired square. Since this half-sized square is odd (19x19), it is easy to create. Just follow the method you see described at the bottom of every odd square page at www.mazes.com/magic-squares. Here is one such square, in which I started with the number 1 in the middle of the top row, then moved one square up one and two squares to the right after each move, except when the next move would be blocked, in which case I dropped down one for the next number.

I deliberately used a different magic square than the one you learned in school, just because I enjoy being different.

Now that you have an odd square, we are ready for the next step

Step Three:  Double the size of the 19x19 magic square
and quadruple all the numbers

Draw a 38x38 grid, then, for each number in the 19x19 magic square:
  • Multiply the number times four (quadruple it), and
  • Write that number four times, into a 2x2 area of the new grid that corresponds to the position of the original number in the 19x19 square. (I have bolded alternating 2x2 blocks so you can see how the 19x19 square has expanded into a 38x38 square.)

Step Four: Put the Quadrupled and the Overlay grids together

This last part should be simple.
  • If the smallest number in the quadrupled grid is 4, use subtraction: Quadrupled minus Overlay = Magic Square
    The lowest number in the new Magic Square will be one, just like in the original 19x19 magic square.
     
  • If the smallest number in the quadrupled grid is 0, use addition: Quadrupled plus Overlay = Magic Square
    The lowest number in the new Magic Square will be zero, just like in the original.
We have many
Amazing Message
stores.

Click each image to see
other amazing product choices

(each product imprinted
with an actual
solvable maze puzzle



Amazing Teacher



Amazing Student



Amazing Student



Amazing Reader



Amazing Artist

See our choices @
www.mazes.com/cp



Please
Support Our Site



buy
Amazing Math Whiz
products from
our online store



Many other
Amazing Messages
are available


Please visit
www.MAZES.com/cp/
for details

A 38-by-38 Magic Square

(Magic Sum = 27455)

425424118911885095081273127259359213571356677676144114407637627677177091908558541751749399382592581023102234334011051104
427426119111905115101275127459559413591358679678144314427617605476976889888538521731729379362572561021102034134211071106
50550412691268589588135313526736721437143675775677767677668786851850171170935934255254101910183393381103110242342011851184
50650712701271591590135513546756741439143875975879787657648584849848169168933932253252101710163373361101110042142211871186
58458513481349669668143314327537527372837836818084784616716693193025125010151014335334109910984194181183118250350012651264
58658713501351671670143514347557547574839838838284584416516492992824924810131012333332109710964174161181118050150212671266
6646651428142974974869688338321531528418401611609279262472461011101033133010951094415414117911784994981263126258358013451344
6666671430143175175071708358341551548438421631629259242452441009100832932810931092413412117711764974961261126058158213471346
7447456465829828149148913912157156921920241240100710063273261091109041141011751174495494125912585795781343134266366014251424
7467476667831830151150915914159158923922243242100510043253241089108840940811731172493492125712565775761341134066166214271426
8248251441459099082292289179162372361001100032132010871086407406117111704914901255125457557413391338659658142314227437406160
8268271461479119102312309199182392381003100232332210851084405404116911684894881253125257357213371336657656142114207417426362
90490522422598998823323299799631731610811080401400116711664874861251125057157013351334655654141914187397385958823820141140
90690722622799199023523499999831931810831082403402116511644854841249124856956813331332653652141714167377365756821822143142
98498530430599399231331210771076397396116111604814801247124656756613311330651650141514147357345554819818139138903900221220
98698730630799599431531410791078399398116311624834821245124456556413291328649648141314127337325352817816137136901902223222
1064106530830910721073392393115611574764771240124156056113261327646647141014117307315051814815134135898899218219982981300301
1066106731031110741075394395115811594784791242124356256313241325644645140814097287294849812813132133896897216217980983302303
1068106938838911521153472473123612375565571320132164064114061407726727464781081113013189489521421597897929829910621061380381
1070107139039111541155474475123812395585591322132364264314041405724725444580880912812989289321221397697729629710601063382383
1148114946846912321233552553131613176366371400140172072142438068071261278908912102119749752942951058105937837911421141384385
1150115147047112341235554555131813196386391402140372272340418048051241258888892082099729732922931056105737637711401143386387
1229122854954813121313632633139613977167173637800801122123886887206207970971290291105410553743751138113945845911461145464465
1231123055155013141315634635139813997187193839802803120121884885204205968969288289105210533723731136113745645711441147466467
1309130862962813921393712713323379679711611788088120220396696728628710501051370371113411354544551218121946246312261225544545
1311131063163013941395714715343579879911811988288320020196496528428510481049368369113211334524531216121746046112241227546547
1389138870970828297927931121138768771961979609612822831046104736636711301131450451121412155345351222122354254313061305624625
1391139071171030317947951141158788791981999629632802811044104536436511281129448449121212135325331220122154054113041307626627
2524789788108109872873192193956957276277104010413623631126112744644712101211530531129412955385391302130362262313861385704705
2726791790110111874875194195958959278279104210433603611124112544444512081209528529129212935365371300130162062113841387706707
1051048698681881899529532722731036103735635711201121442443120612075265271290129161061112981299618619138213837027032221784785
1071068718701901919549552742751038103935835911221123440441120412055245251288128960860912961297616617138013817007012023786787
1851849499482682691032103335235311161117436437120012015225231286128760660713701371614615137813796986991819782783102101864865
1871869519502702711034103535435511181119438439120212035205211284128560460513681369612613137613776966971617780781100103866867
26526410291030350351111411154344351198119951851912821283602603136613676866871372137369269312137767779697860861180181944945
26726610311028349348111311124334321197119651751612811280601600136513646856841375137469569415147797789998863862183182947946
345344110911104314301195119451551412791278599598136313626836821447144669169098773772939285785617717694194026126010251024
34734611111108429428119311925135121277127659759613611360681680144514446896881110775774959485985817917894394226326210271026

This Magic Square was created by John Knoderer, a webmaster and computer programmer who is available to telecommute to your location. (In other words, John would be delighted to create puzzles for your website or do other amazing work for you on a contract basis.)

If you found this page useful, and especially if you printed this page to distribute to students, we invite you to send a suitable donation to John (address below) or PayPal your donation to Donations (at) Mazes.com.

You can find more of John's puzzling materials at www.MAZES.com and at www.GodLovesEveryone.org. You can reach John at Webmaster (at) Mazes.com.

Fine Print: If you print and duplicate these magic squares for classroom use or other multiple copy use, please send a payment of $(however much you think this is worth) to the author. John puts a GREAT DEAL of time into creating and posting materials to the internet for you to use (and enjoy). Your donations will help pay bills and keep new materials coming your way.

Send your donations to:

John Knoderer
www.MAZES.com
P O Box 235
Sulphur Springs, AR 72768 USA

www.MAZES.com
www.GodLovesEveryone.org
www.DriverExam.org

E-mail the webmaster: webmaster (at) mazes.com

The contents of this page are copyright 2005 by the author. However, we recognize that teachers may wish to download and use our materials with their students. We give that permission, as long as the teacher sends what they believe to be a fair donation to the author each time the material is used.