Message Boards Message Boards

0
|
3561 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Find 7X7 matrix of distinct cubed integers with identical row & column sums

Posted 4 years ago

Problem: find a 7X7 matrix of distinct cubed integers with identical row and column sums.

Well, I have the following code:

ClearAll[findMat]
findMat = 
  Module[{csums = ConstantArray[#, 3], 
     mats = Select[DuplicateFreeQ[Join @@ #] &]@
       Subsets[Select[DuplicateFreeQ]@
         IntegerPartitions[#, {3}, Range[Ceiling[#^(1/2)]]^2], {3}]}, 
    Join @@ ((Select[Total[#] == csums &]@
          Tuples[{{#[[1]]}, Permutations[#[[2]]], 
            Permutations[#[[3]]]}]) & /@ mats)] &;
solsB = ParallelTable[findMat[n] /. {} -> Nothing, {n, 0, 100000}];
{Total[#[[1, 1]]]} & /@ solsB

And this code solves the described problem for a 3X3 matrix of distinct squared integers with identical row and column sums.

How can I edit my code, such that this problem can be solved for a 7X7 matrix of distinct cubed integers with identical row and column sums?

POSTED BY: Jan Eerland
Posted 4 years ago

Crossposted here.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract