Cornered Odd–Even Order Magic Square Generator

Created by: Inder J. Taneja
Every internal upper-left corner has equal row and column sums; the requested outer square is a full magic square with both diagonals.
Each step adds two right columns and two bottom rows. The older square is shifted by 2m+2, and the new border uses complementary low and high numbers. Internal diagonals may differ from the common sum; the final layer is selected so both outer diagonals equal the full magic constant.