Place the digits 1 through 9 in a 3x3 array so that the numbers surrounding each digit (including those adjacent by a diagonal) add to a multiple of that digit.
As an example of an array that fails in this regard, take:
9 5 1
6 7 2
4 3 8
While 6+7+5=18 is in fact a multiple of the 9 that it surrounds, as required, the 2+7+3=12 that surrounds the 8 is not a multiple of 8, so this grid fails (it also fails based on the surrounds of 6 and 7).
2 6 5
7 3 1
9 8 4
is the single solution, up to rotations and reflections.
solve(Sol) :-
Sol = [X1,X2,X3,X4,X5,X6,X7,X8,X9],
permute([1,2,3,4,5,6,7,8,9],[X1,X2,X3,X4,X5,X6,X7,X8,X9]),
T1 is (X2+X4+X5) mod X1, T1 = 0,
T2 is (X1+X4+X5+X6+X3) mod X2, T2 = 0,
T3 is (X2+X5+X6) mod X3, T3 = 0,
T4 is (X1+X2+X5+X7+X8) mod X4, T4 = 0,
T5 is (X1+X2+X3+X4+X6+X7+X8+X9) mod X5, T5 = 0,
T6 is (X2+X3+X5+X8+X9) mod X6, T6 = 0,
T7 is (X4+X5+X8) mod X7, T7 = 0,
T8 is (X7+X4+X5+X6+X9) mod X8, T8 = 0,
T9 is (X8+X5+X6) mod X9, T9 = 0.