I have been trying to solve this problem. I think that for n>11, this is not possible, since the diagonal of the square is smaller than the number of primes that fit: n^2 <