The magic constant of an nth-order magic square is calculated by dividing the total of 1 to n2 by n, i.e. the magic constant = n (n2+1)/2.