[Question]
  [
5 Years ago, [this](https://www.youtube.com/watch?v=aOT_bG-vWyg) happened, and then it became sort of a meme.
# Challenge
The Challenge today is, to check if a "[magic square](https://en.wikipedia.org/wiki/Magic_square)" is a valid parker square.  
What is a **Real Magic square**?
* All the numbers must be natural or sometimes 0
* The sum of rows, columns and diagonals must be same.
* There must be no repeating numbers
What Matt tried to achieve is a real magic square but with all the numbers being squares.  
But what he did is a semi-magic square, sometimes called [The Parker Square](http://theparkersquare.com/).
What **is** a valid parker square (rules made by me)?
* It must be a \$3\times3\$ "magic square"
* There **must** be at least one number that appear twice in the square
* The rows and columns must add up to the same number
* At least one diagonal must add up to the same number too.
* Each number must be the square of an integer
# Rules
* Input must be given in a form of a list (flat or 2-dimensional), or just 9 inputs from top left to bottom right
* Input is guaranteed to represent a \$3√ó3\$ square
* Output must be a Boolean, 1 or 0, no output or some output
* [Standard Loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) apply
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in each language wins!
# Examples
```
Classic Parker Square:
In: [841, 1, 2209, 1681, 1369, 1, 529, 1681, 841]
Out: True
0-Square
In: [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
Out: 1
Mirrored Square:
In: 4, 9, 1, 9, 1, 9, 1, 9, 4
Out: 0
Random Square:
In: 1, 2, 4, 3, 4, 9, 8, 9, 0
Out: False
Real Magic Square:
In: [[8, 1, 6], [3, 5, 7], [4, 9, 2]]
Out:
Pythagorean triple (by Arnauld):
In: [25, 0, 0, 0, 16, 9, 0, 9, 16]
Out: false
Non integer (Suggested by Luis):
In: [841.45, 1, 2209, 1681, 1369, 1, -529, 1681, 841]
Out: false
Almost real magic square of squares (Suggested by Jonathan):
In: [[16129, 2116, 3364], [4, 12769, 8836], [5476, 6724, 9409]]
Out: 0
```
Disclaimer: I put magic square in quotes, because most people don't think it is a magic square if the numbers repeat. But it doesn't mean it is easy to make a "magic square" with only a few numbers repeating, all squares and on of the diagonals working. Good work Matt!
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~25~~ 23 bytes
-1 byte thanks to [Grimmy](https://codegolf.stackexchange.com/users/6484/grimmy)!
```
√Ç‚ÄöŒµ√Ö\¬™I√∏¬´O√ã}√†IÀú√ê√ô√äs√Ö¬≤PP
```
[Try it online!](https://tio.run/##yy9OTMpM/f//cNOjhlnnth5ujTm0yvPwjkOr/Q931x5e4Hl6zuEJh2ce7io@3HpoU0DA///R0RYmhjoKQGRkZGAZq6MQbWhmARIwNrMEkiABUyMQCywKVBsbCwA "05AB1E ‚Äì Try It Online") or [Try all cases!](https://tio.run/##S0oszvifnFiiYKeQnJ@SqpdfnJiUmapgY6Pg6u/2/3DTo4ZZ57Yebo05tMrz8I5Dq/0Pd9ceXuB5es7hCYdnHu4qPtx6aFNAwH@gWi6u8ozMnFSFotTEFIXMPK6UfC4FBf38ghJ9iJFQCs0WGwUVsNq81P/R0RYmhjoKQGRkZGAZq6MQbWhmARIwNrMEkiABUyMQCywKVBsbyxUdbaCjAEIgWSxMkAoTHQWYfkuw8RCzwaImYBUgK0FsoLAxkIaqsACrgJhhAdZoBlVhqqNgDmJCTDYCqzAyRbHd0AxqigHEdjOgIgA)
**Commented:**
```
√Ç‚Äö               # pair the input with its reverse
  Œµ        }     # map over each of them:
   √Ö\            #   take the main diagonal
     ¬™           #   append this to the input
      I√∏         #   push the input transposed
        ¬´        #   and concatenate this to the list
         O       #   sum rows, columns and the diagonal
          √ã      #   are all sums equal?
            √†    # is one of the two results a 1?
IÀú               # push the input and flatten it
  √ê              # triplicate
   √ô√ä            # does the uniquified flat input not equal the flat input?
     s           # swap to flattened input
      √Ö¬≤         # for every number: is it a square integer?
        P        # are all square?
P                # take the product (AND reduction) of all results
```
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 34 bytes
```
·πò"v√ûD∆õh‚àë;??√∏TJv‚àë$M∆õf‚âà;a?fDU‚â†$‚àÜ¬≤AWŒ†
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=%E1%B9%98%22v%C3%9ED%C6%9Bh%E2%88%91%3B%3F%3F%C3%B8TJv%E2%88%91%24M%C6%9Bf%E2%89%88%3Ba%3FfDU%E2%89%A0%24%E2%88%86%C2%B2AW%CE%A0&inputs=%5B%5B841%2C%201%2C%202209%5D%2C%20%5B1681%2C%201369%2C%201%5D%2C%20%5B529%2C%201681%2C%20841%5D%5D&header=&footer=)
Bug fixes make it even messier.
[Answer]
# JavaScript (ES7), ~~¬†129¬†~~ 120 bytes
Expects a flat array of 9 values. Returns **0** for Parker, or **1** for non-Parker.
```
a=>new Set([A,B,C,D,E,F,G,H,I]=a).size>8|a.some(x=>x**.5%1)|[D+E+F,G+H+I,A+D+G,B+E+H].some(x=>x-A-B-C)|E+I!=B+C&E+G!=A+B
```
[Try it online!](https://tio.run/##bY3NasMwEITvfQrl0GJl1yZWYlU5yGDZru1zj8YHkSolJbVKHdpQ/O6uotIfimEZdodvZ570mx52r4eXU9jbBzPt5aRl2pt3cm9OQZuhwhwLLPEOK6yx6aSm0XD4MKkYdTTYZxOcZXpeLqPkOqZjW0AJDoUaGsyggAqVc@ruFw2zUIU5HUtoFlJBflNCtZAZqGln@8EeTXS0j8E@aMUmRuKGsdXWLVxczjXfejNhP57jOkqv/n2vkMzPDHspQbJBsvbqkoXXOVb4eu7ZBMnt9webYVnypzjmX5leY@7w6RM "JavaScript (Node.js) ‚Äì Try It Online")
Or **[117 bytes](https://tio.run/##bY1Pa8JAEMXvfor1YEmcSTCr2a6HDeSfSc4excOia7HYbGlEpeS7p5u1liKB4c3M4zfz3uVFNruv4@fZq/VedQfRSRHV6krW6uxsYkwwxQxzXGGBJVZbIV2/OX6riLfSb/SHcm4iuk2nfjgJ3DaDHFZe7CVe2hZQQvU7Z1DYnkNpnL5XY5FA@pJDMRYxJN1O140@Kf@k35yDs@GLAIkpSmdLMzDer3O2tGZI/zzDbV139HQ9QzJcA2wfgmSBZG7VfOZWh1hu45llQySvjws6wNLwX3DA7j@tBszg3Q8)** if we can just return truthy / falsy values.
### How?
We split the input array into 9 distinct variables.
```
A B C
D E F
G H I
```
At the same time, we turn the input array into a set and check its size. If it's greater than \$8\$, then all values are distinct and this is not a Parker square.
```
new Set([A, B, C, D, E, F, G, H, I] = a).size > 8
```
We test whether at least one of the values is not a square:
```
a.some(x => x ** .5 % 1)
```
We test the sum of the values in the 2nd row, 3rd row, 1st column and 2nd column. If one of them is not equal to the sum of the values in the 1st row, this is not a Parker square.
```
[D + E + F, G + H + I, A + D + G, B + E + H].some(x => x - A - B - C)
```
**Note**: We don't have to test the 3rd column. It's trivial to prove that we have \$F+I=A+B\$ (and therefore \$C+F+I=A+B+C\$) if all other sums described above are correct.
Finally, we test whether both diagonals have an invalid sum:
```
E + I != B + C & E + G != A + B
```
[Answer]
# [R](https://www.r-project.org/), ~~106~~ ~~105~~ 104 bytes
```
function(m,`?`=colSums)all(table(m)<2)|sd(c(?m,s<-?t(m)))|any(m^.5%%1)|sum(diag(m))-s&&sum(m[1:3*2+1])-s
```
[Try it online!](https://tio.run/##lY9vS8MwEMbf@ykCsnHRTJq0jZ1s9EP4UrSLXSfFpNX8AYV993pNqaCIOjiO3HN3v@dih9ZVXe@rF2WfG1u516Bssx0Ooat923dg2K7cbete3wbjqNIavHrUDRi6EfTo9lBDaZjbrEqPGqVH1b2DebjKFwuO/WBg36qnsbVyy@VYmzt@k16IS36P0o/2YJS37Ruii4wzgiFEssaHLMYyleso5uJTwznKUkrJOTko7Zqz37DJvydryBiZzL7lbLbzNvzFGO/HDUbSmHG7iDk5gVFEYxkZOSPXM0mcwBC4mMzB5XTD9Cf5BTN8AA "R ‚Äì Try It Online")
Output is reversed\*: `TRUE` if it is *not* a Parker square, `FALSE` otherwise.
**Ungolfed code** (still the right way around):
```
is_parker_square=
function(m){
    twice=any(table(m)-1) # some number must appear twice
    rowscols=!sd(c(rowSums(m),s<-colSums(m))) # rows & cols must have same sum
    diags=any(c(sum(diag(m)),sum(diag(m[3:1,])))==s) # at least one diag must have same sum
    squares=!any(m^.5%%1) # all numbers are squares
    twice && rowscols && diags && squares
}
```
\*Add [+5 bytes](https://tio.run/##jY9vS8MwEMbf@ykypOMCN2nTNuvA0Q/hS9EtZp0Ek07zB/TT1zSlgopSOB5yx3O/52IH5Q6vwr509uDegrDdfjiHXnp16cHgsT3u5UXfBeOo6D/AiyfdgaGbgq5X7gQSWoPudtP6OKR0LbSGlXm8qbOsQJepPpPggoGTEs@jA8fG3EsoscYtfYg7vw4AI7xV75HdVAWSWIzlu/jgzdiWfJeGNfuaRR/FklJyTbwN3dVfxHyJSUKFZIr4odUcchba/QcYT452JGXSuNokzZcCmhTJE6BGsp0xbCmAxa18roJP6dNX@HfG8Ak) to output `TRUE` for a Parker square.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~¬†27¬†~~ 25 [bytes](https://github.com/DennisMitchell/jelly/iki/Code-page)
```
S;¬ßf∆ë‚±Æ,U≈íD·∏¢$‚Ç¨¬ß∆≤·∫∏»ß√Ü¬≤»¶»ß‚Å∏FQ∆ë
```
Parker: `0`, non-Parker: `1` - just like it always seems to be! ;p
**[Try it online!](https://tio.run/##y0rNyan8/z/Y@tDytGMTH21cpxN6dJLLwx2LVB41rTm0/Nimh7t2nFh@uO3QphPLTix/1LjDLfDYxP///0dHG5oZGlnqKBgZGprpKBgbm5nE6ihEm@goGBqZmwHFLSyMzUAipibmQHkzcyOglKWJgWVsLAA "Jelly ‚Äì Try It Online")**
### How?
```
S;¬ßf∆ë‚±Æ,U≈íD·∏¢$‚Ç¨¬ß∆≤·∫∏»ß√Ü¬≤»¶»ß‚Å∏FQ∆ë - Link: 3 by 3 matrix, M
S                         - column sums (M)
  ¬ß                       - row sums (M)
 ;                        - (column sums) concatenate (row sums)
              ∆≤           - last four links as a monad - f(M):
       U                  -   reverse each row (of M)
      ,                   -   (M) pair (reversed row version)
           $‚Ç¨             -   for each:
        ≈íD                -     diagonals
          ·∏¢               -     head
             ¬ß            -   sums -> [sum(main diagonal), sum(anti-diagonal)]
     ‚±Æ                    - map with:
    ∆ë                     -   is invariant under:
   f                      -     (column-and-row-sums) filter keep (diagonal-sum)
               ·∫∏          - any?
                 √Ü¬≤       - is square (vectorises across M)
                »ß         - logical AND -> 0 or [[is r1c1 square?,...],...]
                   »¶      - contains no zero when flattened?
                    »ß‚Å∏    - logical AND with M -> 0 or M
                      F   - Flatten -> [0] or flattened M
                        ∆ë - is invariant under:
                       Q  -   deduplicate
```
[Answer]
# [J](http://jsoftware.com/), 59 57 bytes
```
((<.@%:-:%:)*]>&#~.)@,*3>+/(2#.{.~:])@,1&#.,],&(2{+//.)|.
```
[Try it online!](https://tio.run/##hZDBTgMhEIbvfYqJa7fQTmdhYFmW2E2jiSfjwfvGg7ExXnyAmr76Cqw1jbvGABP4@b@fCe/DFa0OsAuwAgQFIa4twd3Tw/0gxA3tl2EblkGu@64sTiT3uDbdphJc0JFOoY@CLgvCHkvBx01VkfykQS4ebwnmedOJ/3i5eH15@wANOziAieMavNUIcTKrNm6cT0fj2izW/KNF3xRWo6QuJIswsr@qnVrTq5gAg9@Yz3Um1ecYl601QnMGeGrleK/OU7sxcWzEzQRbTbb@@wee577gMsDpZGCdXjLG2dyZ5ibx3puo1raJ1TWcWraqHb4A "J ‚Äì Try It Online")
* `(<.@%:-:%:)` All are perfect squares.
* `]>&#~.` Length of uniq is less than length (ie, has repeats)
* The remainder first creates a single list of all 8 relevant sums (cols, rows, diagonals):
	+ `],&(2{+//.)|.` Get the `/` diagonal sum of both the input and the input with rows reversed. This gives us both diagonal sums.
	+ `1&#.,` Prepend row sums.
	+ `+/...,` Prepend col sums.
* `{.~:]` Turn that list into a boolean list indicating which elements are *not* equal to the first element.
* `2#.` Interpret that result as a binary number.
* `3>` Check if it is less than 3 (will only be true if at most 1 diagonal fails to match the other sums)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~165 163~~ 161 bytes
```
l=>l.some(e=>e**.5%1)|(I=([c,i=3])=>l[c]+l[c+=i]+l[c+=i]!=l[0]+l[1]+l[2])([0,4])&I([2,2])|[[0],[1],[2],[3,1],[6,1]].some(I)|l.every(e=>l.map(g=>z+=g==e,z=0)|z<2)
```
[Try it online!](https://tio.run/##fVDbaoQwEH3vV6QPLck6lRg1VWh89xtCHsRGsWTXZV0WKv67zcSltLQIw2Ru55yZfDS3Zmovw/n6chrf7dqp1anKxdN4tNSqyh4Ocf6UsIXWiuoWBpUa5gd0ayLvIjV8v4/KaY5Zgk4YRjWHzLDnmmoBPl@074Nvg@@CTgEj6b3Z5Gq2uNje7OUTlV18bM60V9UcqV4pC7PibJnfBFvb8TSNzsZu7GlHtS6yBIg3IXhpgOhEFlhIZek9FnKBUaj6Wa/XueZKGWMPf6gCkURQCiQH8ophBsQTiD0gB4KG0/@EO8CNO6xZBvHthFDN9oAi/6WTyDuUb4RyD4ufhfTbmdkdWQTkz23XLw "JavaScript (Node.js) ‚Äì Try It Online")
This feels too long.
Outputs 1 for non-Parker and 0 for Parker.
+38 to fix bug
[Answer]
# [MATL](https://github.com/lmendo/MATL), 30 bytes
```
t!GXdGPXd&hsdXB2>GX^1\=Gun9<vA
```
Input is a 3√ó3 matrix. Output is `1` if it is a Parker square, `0` if not.
[Try it online!](https://tio.run/##y00syfn/v0TRPSLFPSAiRS2jOCXCycjOPSLOMMbWvTTP0qbM8f//aAsTQx0FIDIyMrC0VjA0swBxjc0sgaS1gqkRiAaLAdXFAgA) Or [verify all test cases](https://tio.run/##dU89C8JADN39FXFxqtLkPnrHqaAIXR0cilpR6OCgLlbx39ckXUQRQi7Jy3svdz21l@7YtcOyasp11YzO96Za0rysDriflY9bnD4X3Wr72nS7YDEDDqI8JkAfpDU@ck7gSF6d8V492OUZSCT4LhizGfSsqIKiphPLmBhwlcBwViwoJryg614xl0GRoFcixsh9@KBXZt77eKFanFj3//7xzwfQo4wIRcwYb9UNqRBGCIbPcLZgzBckZ9g81m8).
### Explanation
```
t!    % Implicit input: 3√ó3 matrix. Duplicate
GXd   % Push input again. Diagonal as a column vector
GPXd  % Push input, flip vertically. Diagonal as a column vector (this is the
      % anti-diagonal of the input)
&h    % Concatenate everything horizontally. This gives a 8√ó3 matrix whose
      % columns are: the 3 columns of the input, the 3 rows of the input, the
      % diagonal and the anti-diagonal
s     % Sum of eah column. Gives a row vector of length 8 (*)
d     % Consecutive differences. Gives a row vector of length 7
XB    % Convert from binary expansion to number. This treats nonzero values in 
      % the input as 1
2>    % Is it greater than 3? (**) This gives false if and only if all entries
      % in (*) are equal except perhaps the last or second-to-last, but not both 
      % (The result will be false for a valid input)
GX^   % Push input. Square root of each entry
1\    % Modulo 1. (***) (All entries give 0 for a valid input)
=     % Equal? Since the modulus is always less than 1, equality means that all
      % entries in (***) were 0, as was (**). (This gives a matrix containing
      % only true for a valid input)
Gun   % Push input again, unique elements as a row vector, number of elements
9<    % Less than 9? (True for a valid input)
v     % Concatenate everything into a column vector
A     % All: gives true if all entries are true. Implicit display
```
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), ~~154~~  144 bytes
```
lambda a:1-any([len({*a})>8,{(s:={sum(a[i%7:i%5*3:i%4])-a[4]for i in b"\r@@@+?"}).pop()}-{a[0]+a[8],a[2]+a[6]},s,sum(i<0 or i**.5%1for i in a)])
```
`@` represents unprintables chars
Outputs 1 for Parker, 0 for not Parker
[Try it online!](https://tio.run/##dVBRa8MgEH7P2x7GXqVQiKkp0aixYd1@iJVhWcMCbRpM@lBCfnvmGdaNrRP5OL@77zvv2mv/cW5y1bqp2u6moz3t3y2yJU1tc4318dDEQ2JH/KLIEHfldugup9jqelmU9VIkuUducGo1N9XZoRrVDdovdu7h8Wn1uhjxuj23MR7TwerMrKxWhljNIJJmJB0Bu/o5Q6BNkrVY0puNxQZP/aHru7feXQ5oi7RWnBLkL2PZxgdSwTOXm0AKduN8nSFIZwTdv8ZE0Wxd2WM3e3OCZp9fyMEJevqQoDygp1XADJIqlMqQFAQVXyUMkkz8aEzlrJrtZRBzuubi/6nSv2NRSYFjFOzyXPLQkLICJErlnhW88CgLBj/h2QYGhs1a5@wVtvu92DJC/rSubvq4ikMBxtH8xvdEYWV3VdMn "Python 3.8 (pre-release) ‚Äì Try It Online")
A pretty messy solution ^^
## How it works:
* `1-any([...])` will return 1 if all elements are `False`
* `len({*a})>8` length of the set of `a`, returne `True` if equal to `9` (no duplicates)
* `(s:={sum(a[i%7:i%5*3:i%4])-a[4]for i in b"\r@@@+?"})` create the set of the sums of all lines and columns (name it `s`). I used the impicit conversion of bytes into ints to store the values for the slices.
* `{ .pop()}-{a[0]+a[8],a[2]+a[6]}` remove an element of `s` and verify if it is equal to the sum of one diagonal. I used set substraction. If it is present, return the empty set (=> False) else, return itself (=>True)
* `s` verify if `s` is empty (=> False if `s` had exactly one element before the pop)
* `sum(i<0 or i**.5%1for i in a)` verify both than i is positive and i is a square. If any `i` is lower than 0, `i<0` will be True and the sum will no longer be nul. If any `i` is not a sqare, `i**.5` (sqrt(i)) will have a decimal part and `i**.5%1` won't be nul.
]