It turns out that there is an optimal matrix, by which I mean there is a way to arrange the smallest 9 primes so that the matrix is singular, and the sum is 100. One such way (remember, we can exchange rows, exchange columns, or take transposes and still have a solution) is this:
As to how I found this solution, I used the following observation for such a solution M: The columns of M are linearly dependent over the integers. Thus I wrote a short program in MATLAB that looked through the first N primes, took them two at a time, say p and q, and then checked whether ap+bq was a prime, for parameters a and b that I could change.
Using a=1, b=-2, I found the optimal matrix is
whose sum is 112, and I thought this was pretty good, since it only missed 19 and 29. The next choice of a = 3, b = -2 turned out to be the winner above (notice, as expected, that 3 times the first column minus twice the second is the third). I was also surprised to find that choosing a = 5, b = -6 did very well, with a matrix total of 106 (this is, by necessity, the second best answer, since it only swaps out a 23 for a 29).
Since yesterday, I was able to use the same sort of ad-hoc method to find a similarly optimal 4×4 “prime” matrix (again, “optimal” means I use only the first 16 primes):
![[UNSET] (9)](http://colindcarroll.files.wordpress.com/2012/02/unset-9.jpg?w=300&h=225)
![[UNSET] (8)](http://colindcarroll.files.wordpress.com/2012/02/unset-8.jpg?w=300&h=225)
![[UNSET] (7)](http://colindcarroll.files.wordpress.com/2012/02/unset-7.jpg?w=640)