Continuing http://programmingpraxis.com/2014/12/12/magic-squares/