The magic square consists of 4X4 boxes. We don't yet know whether all the numbers from 1 to 16 are there. Each row adds up to 34, so since there are 4 rows the sum of the numbers must be 4*34=136. When we add the numbers from 1 to 16 we get 136, so we now know that the square consists of all the numbers between 1 and 16.
We can arrange the numbers 1 to 16 into four groups of four such that within the group there are 2 pairs of numbers {x y 17-x 17-y}. These add up to 34. We need to find 8 numbers represented by A, B, ..., H, so that all the rows, columns and two diagonals add up to 34.
A+B+17-A+17-B=34, C+D+17-C+17-D=34, ... (rows)
A+C+17-A+17-C=34, ... (columns)
Now there's a problem, because the complement of A, for example, appears in the first row and the first column, which would imply duplication and mean that we would not be able to use up all the numbers between 1 and 16.
To avoid this problem we need to consider other ways of making up the sum 34 in the columns. Let's use an example. The complement of 1 is 16 anewd its accompanying pair in the row is 2+15; but if we have the sum 1+14 we need another pair that adds up to 19 so that the sum 34 is preserved. We would perhaps need 3+16. We can't use 16 and 15 because they're being used in a row, and we can't use 14, because it's being used in a column, so we would have to use 6+13 as the next available pair. So the row pairs would be 1+16 and 2+15; the column pairs 1+14 and 6+13; and the diagonal pairs 1+12 and 10+11. Note that we've used up 10 of the 16 numbers so far. This type of logic applies to every box, apart from the middle two boxes of each side of the square (these are part of a row and column only), because they appear in a row, a column and diagonal.
There are only 10 equations but 16 numbers. In the following sets, in which each of the 16 boxes is represented by a letter of the alphabet between A and P, the sum of the members of each set is 34:
{A B C D} {A E I M} {A F K P} {B F J N} {C G K O}
{D H L P} {D G J M} {E F G H} {I J K L} {M N O P}
The sums of the numbers in the following sets in rows satisfy the magic square requirement of equalling 34. This is a list of all possibilities. However, there are also 24 ways of arranging the numbers in order. We've also seen that we need 10 out of the 16 numbers to satisfy the 34 requirement for numbers that are part of a row, column and diagonal; but the remaining numbers (the central pair of numbers on each side of the square) only use 7 out of 16. The next problem is to find out how to combine the arrangements. The vertical line divides pairs of numbers that could replace the second pair of the set. So 1 16 paired with 2 15 can also be paired with 3 14, 4 13, etc. The number of alternative pairs decreases as we move down the list.
17 X 17:
1 16 2 15 | 3 14 | 4 13 | 5 12 | 6 11 | 7 10 | 8 9
2 15 3 14 | 1 16 | 4 13 | 5 12 | 6 11 | 7 10 | 8 9
3 14 4 13 | 1 16 | 2 15 | 5 12 | 6 11 | 7 10 | 8 9
4 13 5 12 | 1 16 | 2 15 | 3 14 | 6 11 | 7 10 | 8 9
5 12 6 11 | 1 16 | 2 15 | 3 14 | 4 13 | 7 10 | 8 9
6 11 7 10 | 1 16 | 2 15 | 3 14 | 4 13 | 5 12 | 8 9
7 10 8 9 | 1 16 | 2 15 | 3 14 | 4 13 | 5 12 | 6 11
16 X 18:
1 15 2 16 | 4 14 | 5 13 | 6 12 | 7 11 | 8 10
2 14 3 15 | 5 13 | 6 12 | 7 11 | 8 10
3 13 4 14 | 2 16 | 6 12 | 7 11 | 8 10
4 12 5 13 | 2 16 | 3 15 | 7 11 | 8 10
5 11 6 12 | 2 16 | 3 15 | 4 14 | 8 10
6 10 7 11 | 2 16 | 3 15 | 4 14 | 5 13
7 9 8 10 | 2 16 | 3 15 | 4 14 | 5 13 | 6 12
15 X 19:
1 14 3 16 | 4 15 | 6 13 | 7 12 | 8 11
2 13 4 15 | 3 16 | 5 14 | 7 12 | 8 11
3 12 5 14 | 4 15 | 6 13 | 8 11
4 11 6 13 | 3 16 | 5 14 | 7 12
5 10 7 12 | 3 16 | 4 15 | 6 13 | 8 11
6 9 8 11 | 3 16 | 4 15 | 5 14 | 7 12
7 8 9 10 | 3 16 | 4 15 | 5 14 | 6 13
14 X 20:
1 13 4 16 | 5 15 | 6 14 | 8 12 | 9 11
2 12 5 15 | 4 16 | 6 14 | 7 13 | 9 11
3 11 6 14 | 4 16 | 5 15 | 7 13 | 8 12
4 10 7 13 | 5 15 | 6 14 | 8 12 | 9 11
5 9 8 12 | 4 16 | 6 14 | 7 13 | 9 11
6 8 9 11 | 4 16 | 5 15 | 7 13
13 X 21:
1 12 5 16 | 6 15 | 7 14 | 8 13 | 10 11
2 11 6 15 | 5 16 | 7 14 | 8 13 | 9 12
3 10 7 14 | 5 16 | 6 15 | 8 13 | 9 12
4 9 8 13 | 5 16 | 6 15 | 7 14 | 10 11
5 8 9 12 | 6 15 | 7 14 | 10 11
6 7 10 11 | 5 16 | 8 13 | 9 12
12 X 22:
1 11 6 16 | 7 15 | 8 14 | 9 13 | 10 12
2 10 7 15 | 6 16 | 8 14 | 9 13 | 10 12
3 9 8 14 | 6 16
4 8 9 13 | 6 16 | 7 15
5 7 10 12 | 6 16
11 X 23:
1 10 7 16 | 8 15 | 9 14
2 9 8 15 | 7 16
3 8 9 14 | 7 16
10 X 24:
1 9 8 16
To give an example of how the list could be used, let's take row 3 in 17 X 17 {3 14 4 13}. If 3 is the number in the row column and diagonal, then we need to inspect the list to find another row in a different group containing 3 that doesn't duplicate any other numbers. So we move on to 15 X 19 and we find {3 12 8 11} and another row in 13 X 21 with {3 10 5 16}. So we've used the numbers 3, 4, 5, 8, 10, 11, 12, 13, 14, 16. That leaves 1, 2, 6, 7, 9, 15.
In fact, one answer is:
07 12 01 14 (see 15x19)
02 13 08 11
16 03 10 05
09 06 15 04