Problem 1697. Make a Pandiagonal Prime Magic Square: 11 x 11
Solution Stats
Problem Comments
-
4 Comments
Richard, I think your test suite has an error in it. Both pd and pad will result in the same matrix, as they're both circshifted by [1 1-i] Will pad=fliplr(pad); after the for loop correct this problem?
Test Suite fixed. Who new that 1-i is the same as -i+1.
The circular shift should be made from first row, not the 2nd, and the "knight" always moves down from the first column of the row to the last column in an L-movement.
I fully agree with the comments by Rafael S.T. Vieira. The problem is nice but it was badly explained
Solution Comments
-
1 Comment
I had not recognized the symmetry of row and column processing. A very succinct method to create a Knight pattern.
Problem Recent Solvers13
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
44016 Solvers
-
1196 Solvers
-
Create logical matrix with a specific row and column sums
285 Solvers
-
3977 Solvers
-
Check that number is whole number
3038 Solvers
More from this Author260
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!