Grid A Grid B
A B C D A B C D
+++++ +++++
1      1 14 23 34 14 
+++++ +++++
2      2 31 42 26 26 
+++++ +++++
3      3 22 24 44 29 
+++++ +++++
4      4 12 32 19 16 
+++++ +++++
The numbers 1 to 16 are to be placed in grid A, so that consecutive numbers are not adjacent in any direction, including diagonally. Nor do they appear in the same row, column or any diagonal.
The number in each cell of grid B is the sum of the horizontal and vertical neighbors of the corresponding cell in grid A.
NB. The letters and numbers around the edge of the grid serve no purpose for the solver. They are to be used for identifying cells in the solution.
1. B3 + C2 = 44  16 = 28. 28 = 16 + 12 or 15 + 13.
2. 16 can only be in four cells at corners or 2X2 square in middle as other places would make one corner > 16. Also 16 cannot be in D4 as then 16 + 2 + 1 = 19(C4). 14/15 can be in corners, 2X2 square in middle, C4 or D3.
3. If 28 = 15 + 13. 16 goes in A1, 14 in D4. But then B4 + C3 = 5 implies A3 + B2 = 19 implies A1 = 12. Contradiction. So 28 = 16 + 12.
4. 28 = 16 + 12. 15 cannot go in D4 as then 14 could not go in any cell. 15 goes in A1 implies 14 in C4 or D3. But 14 in D3 would mean sum in D2 greater than 26. So 14 in C4.
5. Rest can be calculated or filled in using constraints given in the problem.

Posted by rs
on 20061031 04:44:53 