# Arrange number inside squares

Arrange numbers 1 to 10 to the squares, with rules :

1. The difference between 2 numbers connected by a line is more than 2
2. Number inside the blue square is an even number.
3. Numbers inside the green squares are prime numbers.

Solution:

Reasoning:

The four numbers on the left must all be more than 2 away from each other. The only set that allows this is {1,4,7,10}. Since 7 is the only prime, it must be in the bottom-left green box.

The 3 boxes joined to 8 must be within 1-5. Since 1 and 4 are used above, those 3 must be {2,3,5}. Since the top two of those 3 boxes are joined, they must be 2 and 5, leaving 3 for the box below 8.

Since the bottom-right most box is connected to the same 3 boxes that 8 is connected to, it is connected to a 5. It can therefore not be 6 and must be the only remaining number, 9. 6 must be in the top-left box, the only remaining valid box for it.

Since 6 is in the top-left box, the top-right box must be 2, leaving 5 for the box to the right of 8.

Since 6 is in the top-left box, the two boxes below it cannot be 4. 4 must be in the bottom-right box of the left group. This leaves 10 for the blue square and 1 to the right of the blue square.

• So this puzzle can be solved without the information that the box connected to 8 is a prime! Aug 31, 2017 at 7:36
• @glugglug Maybe they need to be prime for the solution to be unique? Aug 31, 2017 at 9:44
• The 3 didn't need to be coloured for the solution to be unique. The line between the 3 and 9 could also be removed without affecting the uniqueness or solvability of the puzzle. The number of rules could be reduced if the 7 was uncoloured and the 4 was coloured blue.
– Apep
Aug 31, 2017 at 11:28