magic-square Questions

6

Magic square: sum of any row, column, or diagonal of length is always equal to the same number. All 9 numbers are distinct positive integers. I am doing it this way in JavaScript, but what is the ...
Moiramoirai asked 16/10, 2018 at 17:44

3

Solved

In Ocatave / Matlab, I can use magic() to get a magic square, e.g., magic(4) 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 Definition: A magic square is an N×N grid of numbers in which the entries...
Filipe asked 15/12, 2017 at 14:15

5

Solved

For those unfamiliar with the classic magic square algorithm: A magic square is a two dimensional array (n x n) which contains a numerical value between the values 1 and n^2 in each location. Each ...
Budget asked 7/12, 2010 at 1:16

2

Solved

I'm trying to find an elegant algorithm for creating an N x N matrix of 1's and 0's, under the restrictions: each row and each column must sum to Q (to be picked freely) the diagonal must be 0's ...
Gersham asked 20/5, 2014 at 13:37

2

for university I have to implement an algorithm which creates all possibile magic squares for a given edge length and a specific sum. For n=3 the algorithm is working as expected. But when generati...
Agape asked 13/12, 2012 at 9:2

5

Solved

I've been writing programs to solve various number puzzles, but I'm constantly designing unreasonably complex search algorithms that I can't optimize. For example, in one puzzle, you are given a 3...
Outrelief asked 6/1, 2012 at 6:2
1

© 2022 - 2025 — McMap. All rights reserved.