# Primes, composites, and an 11-by-11 square

I really enjoyed attempting to find a solution to Filling an 11-by-11 square (and am a fan of Gamow's square puzzles), so I was inspired to make a puzzle in the same spirit.

Is it possible to fill all $121$ entries of an $11\times11$ grid with the numbers $0$, $1$, and any composite number less than or equal to $10$ such that the row sums and column sums contain the first $22$ prime numbers?

• So the allowable numbers in the grid are 0,1,4,6,8,9,10, right? – Engineer Toast Jan 21 '16 at 21:57
• @EngineerToast: Correct. – dpwilson Jan 21 '16 at 21:58
• I believe it is possible since you have 0,1 and other 5 numbers to fill the square. you can adjust it accordingly. has to be much easier than Gamow's. – Oray Jan 21 '16 at 22:20

If the row sums and the columns sums contain the first 22 prime numbers, their sum must be equal to the sum of the first 22 prime numbers, which is odd.

However, the sum of the row sums is equal to the sum of the column sums, because they are both equal to the total of all the numbers in the grid. Therefore, their sum must be even.

Therefore, the row and column sums cannot be the first 22 prime numbers.

• Why must they be equal? – Steve Eckert Jan 21 '16 at 23:23
• @SteveEckert because they both represent the sum of all 121 numbers. – f'' Jan 21 '16 at 23:24
• @f" Right. Ok. That's fairly obvious. So, why can't the sum of row sums and the sum of column sums be equal? I feel like you're implying that there's a division by two somewhere that I'm missing. Or, what is the relevance of it being an odd number? – Steve Eckert Jan 21 '16 at 23:29
• @SteveEckert I've edited my answer again to hopefully make it clearer. – f'' Jan 21 '16 at 23:38
• @f" Ok, I got it. +1 for a good explanation. – Steve Eckert Jan 21 '16 at 23:38

I had some trouble to understand easily @f" answer, so I'll post a more intuitive one.

The matrix is:

$$\begin{bmatrix}a_{0,0} & a_{0,1}&... &a_{0,10}\\a_{1,0}&...&..&...\\...&...&...&...\\a_{10,0} &...&...& a_{10,10}\end{bmatrix}$$

$$\text{row sum }r_i=\sum_{k=0}^{10}{a_{i,k}}\qquad i=0...10$$ $$\text{column sum }c_i=\sum_{k=0}^{10}{a_{k,i}}\qquad i=0...10$$

we define $$\text{sum of the sums of the rows }R=\sum_{i=0}^{10}{r_{i}}$$ and $$\text{sum of the sums of the columns }C=\sum_{i=0}^{10}{c_{i}}$$

$(1)$ From the question we know that $C+R=\text{sum of first 22 primes}=2n + 1= 791$

$(2)$ From the construction of $C$ and $R$ we know that $C=R$ since they are the sum of all of the values of the matrix. Therefore their sum must be in the form $C+R= 2C = 2R = 2n$ which is in contradiction with $(1)$

Therefore, the row and column sums cannot be the first 22 prime numbers. -@f"

• I guess "more intuitive" is subjective. I found f'''s answer clearer. All those mathematic notations makes it more confusing to me. Although I do understand it I can imagine that someone with less mathematical education couldn't understand it as easily. – Ivo Beckers Jan 22 '16 at 13:17