in reply to Not A Magic Square But Similar

1 2 3 4 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 etc

Replies are listed 'Best First'.
Re^2: Not A Magic Square But Similar
by kennethk (Abbot) on Sep 06, 2013 at 20:04 UTC
    Also:
    1 2 3 4 5 6 8 9 10 1 2 3 5 6 7 9 10 11 1 2 4 5 6 8 9 10 12
    Any additive offset to a row or column from a valid state that doesn't cause a value collision also satisfies the permutation condition.
    3 6 9 2 5 8 1 4 7 1 2 3 7 8 9 4 5 6 2 1 3 5 4 6 8 7 9
    Rotations, row swaps and column swaps also yield valid results. Of course, these are actually a subset of the additive transformation. If you think about it, the 1 .. 9 square is just the all 1's square subjected to 9 row additions and 3 column additions; the minimum necessary number to achieve element uniqueness.

    The real question for me is are there valid results which are not mappable via addition to the base square.


    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      kennethk,
      The real question for me is are there valid results which are not mappable via addition to the base square

      Yes and I am kicking myself for not including this in the list of trivial cases I had considered (as this is not my intent). In any event, if I had to make this work I could but I isn't what I was hoping for.

      Cheers - L~R

Re^2: Not A Magic Square But Similar
by LanX (Saint) on Sep 06, 2013 at 20:36 UTC
    Best solution so far! hdb++

    Works also always¹ for "selections" which are not parallels of a diagonal, like 1-10-7-16.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

    ¹) prove left for interested readers.