The Mathematical &#8216;Magic&#8217; Behind the Magic Square