Question: 3. The Subirachs Magic Square-pictured below-is an interesting construction. While not technically a magic square, its rows, columns, diagonals, corners, center, and postage stamps
3. The Subirachs Magic Square-pictured below-is an interesting construction. While not technically a magic square, its rows, columns, diagonals, corners, center, and "postage stamps" do all have the same sum. In fact, there are many other combinations in the square that also have this sum. (47 Points) Write a Java program that counts all the 4-element combinations that have the same sum as the rows/columns, etc. Add to your program so that you can count all combinations with this sum. Some will have fewer than 4 elements, some will have exactly 4 elements, some will have more than 4 elements. Count them all. Make yet another addition to your program that counts the number of ways every possible sum can be formed. Include 0 as a possible sum; the largest sum will be created by summing every cell of the square. What sum can be created with the greatest number of combinations, and how many combinations is that? Notice anything interesting about that?
Step by Step Solution
There are 3 Steps involved in it
import javautil public class MagicSquareCombinations private static int magicSquare 16 3 ... View full answer
Get step-by-step solutions from verified subject matter experts
