the term magic square referred not to something mystical but to something mathematical -- it was the name given to a grid of consecutive numbers arranged in such a way that all the rows , columns , and diagonals added up to the same thing .