Using all integers from 1 to 20, assign them into a 5 by 4 grid so that adjacent numbers (horizontally, vertically and diagonally) will differ by at least 4.

(In reply to

re: computer solutions by Jer)

For the 5 by 4 grid given a difference of 6 is impossible.

Consider any 2x2 subsquare in the grid. All four numbers are mutually adjacent, which means that for all the numbers to differ by at least 6, the largest and smallest must differ by 3*6=18. There are only three such pairs in the set 1-20: (1,19), (1,20), and (2,20). But there are four clearly independent 2x2 subsquares, one in each corner. Thus a difference of six is impossible.

A difference of five might still be possible. The difference between the smallest and largest in a 2x2 subsquare would need to be 3*5=15. Then each of the possible subsquares would need at least one number 1-6 and one number 16-20. This can be accomplished with the pattern (A is a number 1-5 or 16-20, N is any leftover number):

N A N A N

N A N A N

N A N A N

N A N A N

*Edited on ***February 14, 2016, 6:19 pm**