This page was formerly at:

Bordered Magic Squares


This site uses the term Bordered Magic Squares for consecutively concentric magic squares. These have the property that each concentrically inlaid square consists of consecutive integers.

An inlaid square of order m can be converted to a normal magic square by subtracting the (n²+1)/2 of the border order n square and adding (m²+1)/2, which is equivalent to subtracting (n²-m²)/2.


The algorithms here were first programmed on the pocket calculators HP-67 and HP-41CV. The bones numbers are computed and, optionally, (n²+1)/2 added to each number to produce the actual square.

The programs are designed to compute one cell number at a time, given the row and column. A (row, column) is entered to calculate any cell number or, optionally, the square can be stepped through, computing one cell at a time, by repeatedly pressing the R/S button.

Because the squares are not stored in the calculator, the biggest square that can be made is determined by the number computation and display capacities of the calculator, and, smileytime and patience smiley.


BorderedSquares makes squares from these algorithms. See examples below.
Also, for odd orders, squares are made like those of methods from Holger Danielsson
attributed to Abu'l-Wafa al-Buzjani, Takakazu Seki, Michael Stifel, and J. Travers.

BorderedRectangles also makes these squares and non-square rectangles.

Squares, up to order 32, can also be made below.

Order5Special makes all the order 5 bordered squares. They can also be made on page border 5.

Odd Order Squares

Example Squares: Order 3, 5, 7

Order 3, 5, 7 squares

The order 3 square can be any aspect of the Lo Shu.

To see the normal magic square of the order 3 square at the center of the order 7 square, subtract (7² - 3²)/2 = 20 from the nested order 3 square numbers. Similarly, subtract (7² - 5²)/2 = 12 for the nested order 5 square. Similarly, subtract (5² - 3²)/2 = 8 for the nested order 3 square of the order 5 square.

Bones of Above Squares

Order 3, 5, 7 bones

Imagine an X-axis through the center row and a Y-axis through the center column of each bones. A couple of observations:

Even Order Squares

Example Squares: Order 6, 8

Order 4, 6, 8 squares

The center 4x4 square can be any aspect of the 880 order 4 squares.

To see the normal magic square of the order 4 square at the center of the order 8 square, subtract (8² - 4²)/2 = 24 from the nested order 4 square numbers. Similarly, subtract (8² - 6²)/2 = 14 for the nested order 6 square. Similarly, subtract (6² - 4²)/2 = 10 for the nested order 4 square of the order 6 square.

Bones of Above Squares

Order 4, 6, 8 bones

Note that ½ has been omitted from all the bones numbers displayed here.
Therefore, to convert these displayed bones numbers to the actual square numbers:

Again, imagine a horizontal X-axis and a vertical Y-axis through the center of each bones. Some observations:

Make Squares


Click START.

To make a square:

To make a bones:

Order    Make Bones  

Note: In the bones displayed here, the minus sign is dropped from negative numbers. Positive and negative numbers are distinguished by different colors, (red, blue). Also, ½ is dropped from all numbers for even order bones.

Freeware Disclaimer

The software on this site may be used freely.
You should use only if you agree to the freeware disclaimer.

Please send errata or comments to Harry White,


Danielsson, Holger "Magic Squares"

Heinz, Harvey "Glossary"

Nakamura, Mitsutoshi "Magic Cubes and Tesseracts"

Weisstein, Eric W. "Border Square"

See also: Magic Squares - REFERENCES


Furlow, Warren "The HP-41 Archive Website"

Hicks, David G. "The Museum of HP Calculators"