Suppose you have a 2D array - a list that exits in both x and y axis - which is 4 x 4, and you need to fill the table by putting numbers in it obeying following restrictions.
Each cell is able to store a number that can be calculated according to its index. (Indexes start from [0,0])
If a cell's index is [i, j] it can store a number calculated as one of the following ways.
i x j + i - j
i x j + j - i
i ^ j
j ^ i
Each cell can carry at most multiplication of its adjacent cells. (horizonal and vertical)
Each cell should be colored in a way all odds are of same color and all evens are of same color and two same colored cell cannot stand side by side vertically or horizontally.
It turns out that this is
The cell with index $[1,1]$ must contain the entry $ 1\times 1 + 1 - 1 = 1^1 = 1$.
Now consider the cell with index $[0,1]$ which is adjacent to $[1,1]$. This must contain either
(i) $0 \times 1 + 0 - 1 = -1$,
(ii) $0 \times 1 + 1 - 0 = 1$
(iii) $0^1 = 0$
(iv) $1^0 = 1$
Now, (i), (ii) and (iv) are odd which would break rule 3.
However if we are in case (iii) then we break rule 2, since the cell with index $[1,1]$ can carry, at most, multiplication of its adjacent cells, which would be $0$ in this case.
My "solution" (a lateral thinking answer)
__0 NaN 1 NaN
NaN 1 NaN 1
__1 NaN 4 NaN
NaN 1 NaN 9
NaNmeaning not-a-number (according to the rules, a cell does not has to contain a number, but rather can do so). All other rules are obviously complied (if a cell contains a number, it is of the 4 permitted ones; NaNs (and their products) are never greater than any number; you should color all "odd" cells blue, "evens" green and NaNs grey, since the latter are neither even nor odd).