# Magic Penteract!

(Don't worry, this is the last magic square themes question I'll be posting (as far as I know), so I picked a challenging one!)

First off, let's define what a magic square is;

A magic square is an $n\times n$ grid filled with the numbers $1$ through $n\times n$, where every horizontal, vertical, and diagonal line adds up to be the same number, this number is called the magic constant

So now let's generalize that...

A magic $m$-cube is an $n^m$ grid filled with the numbers $1$ through $n^m$, where $m > 1$ and each line on every axis adds up to be the same number. This number is called the magic constant

So now imagine the penteract being a 5-cube, so that would mean a magic penteract is an $n\times n\times n\times n\times n$ grid where each line on every axis ($v, w, x, y, z$) all adds up to the one and only Magic Constant!

Your job? Easy! Determine the $3\times 3\times 3\times 3\times 3$ magic penteract, and its magic constant!

Good luck!

You are describing a magic hypercube. For a magic hypercube's Magic Sum, have $M_k(n)$, where $k$ is the dimensionality (5 in this case), and $n$ is the size of each row/column. In general this gives:

$M_k(n) = n\Big( \frac{n^k +1}{2}\Big)$ for n > x where x is particular to each k.

So, in your formulation, you need:

$MagicSum = 3\Big( \frac{3^5 +1}{2}\Big) = 366$

According to here:

The SMALLEST SIMPLE MAGIC HYPERCUBE of dimension 5 is of Order 3.
All the numbers from 1 TO 243 are arranged in such a way that the Magic Sum is:
366 in 421 ways.

81 rows            (parallel to x-axis)
81 columns (parallel y-axis)
81 pillars (parallel to z-axis)
81 files            (parallel to w-axis)
81 posts            (parallel to v-axis)
16 pentagonals (continuous)
Altogether 421 ways.

The number of dimension 5 hypercubes is not known (for any order),
but there are 3840 variations of each due to rotations and reflections.
• This still does not tell me what the lines within the penteract are – warspyking Dec 5 '14 at 10:25
• @warspyking do you want all 3840 variations of 243 numbers, or just one? – BmyGuest Dec 5 '14 at 19:28
• @BmyGuest Just 1 – warspyking Dec 5 '14 at 20:11

Marián Trenkler constructs magic $m$-cubes of arbitrary size in the papers  and . The following theorem is in :

Theorem: A magic $m$-cube of size $\underbrace{n\times\ldots\times n}_m$ exists if and only if $m\geq 2$ and $n\neq2$, or $m=1$.

This means that a $3\times3\times3\times 3\times 3$ magic penteract exists.

 Trenkler, Marián. Magic $p$-dimensiona cubes of order $n\neq 2\mod 4$. Acta Arith. 92 (2000), no. 2, 189-194.

 Trenkler, Marián. Magic $p$-dimensiona cubes. Acta Arith. 96 (2001), no. 4, 361-364.

• That doesn't answer the question about what it is and what it's magic constant is. – warspyking Dec 5 '14 at 10:23