Magic Squares - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Magic Squares (/thread-9347.html) |
Magic Squares - Eddie W. Shore - 10-22-2017 03:34 PM Link to blog entry: http://edspi31415.blogspot.com/2017/10/hp-prime-and-casio-fx-cg-50-3-x-3-magic.html Background A magic square is a square of integers where each row, column, and diagonal have the same sum. For example: 2 9 4 7 5 3 6 1 8 Each row, column, and diagonal of this magic square has a sum of 15. A proper magic square has the integers 1 through n^2, n is the size of the magic square. A non-normal magic square follows the sum rule, but different integers than the 1 to n^2 sequence is allowed. The program MAGICSQ3 generates random 3 x 3 non-normal magic squares. The sum of each row, column, and diagonal are given. HP Prime Program: MAGICSQ3 Code:
|