## Magic Hybercube of Order 5 and Dimension 4

Magic squares are an arrangement of consecutive integers arranged in a 2 dimensional grid such that every row or column sums up to the same value. A "perfect magic square" has the additional property that any symmetrical set of n cells also sums to a particular value.

Below is an example of a magic hypercube formed using an original algorithm for expanding magic squares into any number of higher dimensions and (with certain restrictions) any order. This one is a 4 dimensional hypercube of order 5. It contains every integer from 1 to 625 arranged in a four-dimensional cube such that every set of 5 cells along any axis, or any diagonal, sum up to 1,565. In addition, every pair of symmetrically located cells sums to 625. This latter property also means it contains a complete internal hypercube of dimension 4 and order 3.