Got the solution to 15 from the uni server. I originally wrote it in haskell but that took too long to run, I used the same algorithm in C and it was a lot quicker. I only later realised the way to do it without brute forcing it.