title: Pandiagonal magic cube
text: # Pandiagonal magic cube
  
  In recreational mathematics, a pandiagonal magic cube is a magic cube with the additional property that all broken diagonals (parallel to exactly two of the three coordinate axes) have the same sum as each other. Pandiagonal magic cubes are extensions of diagonal magic cubes (in which only the unbroken diagonals need to have the same sum as the rows of the cube) and generalize pandiagonal magic squares to three dimensions.
  
  In a pandiagonal magic cube, all 3m planar arrays must be panmagic squares. The 6 oblique squares are always magic. Several of them may be panmagic squares. A proper pandiagonal magic cube has exactly $9m^2$ lines plus the 4 main space diagonals summing correctly (no broken space diagonals have the correct sum.)
  
  The smallest pandiagonal magic cube has order 7.
  
  