9744=1002−162 cells.
Lemma. Let a strip 1×k be filled with positive integers. Then it is possible to color several non-overlapping good rectangles in it, covering at least k−16 cells.
Proof. Induction on k. For k≤16 nothing needs to be colored. Suppose k≥17. Let the leftmost 17 cells contain numbers a1,…,a17. Among the numbers 0,a1,a1+a2,…,a1+⋯+a17, there are two with the same remainder modulo 17. Then their difference, which has the form ai+ai+1+⋯+aj, is divisible by 17. Remove the cells from i to j from the strip. The remaining cells form a strip of length k−(j−i+1). By the induction hypothesis, we can color several good rectangles so that at most 16 cells remain uncolored. Then in the original strip, we can color the same cells, as well as the cells from i to j (they either form a new good rectangle or fall inside an old one). □
Now to the problem. We show that it is possible to leave at most 162=256 uncolored cells. Consider a strip 1×100, where the cells contain the sums of the numbers in the columns of the original square. Applying the lemma to it, we find several good rectangles. Then in the original square, we can color the corresponding rectangles of height 100. After this, at most 16 columns remain uncolored. Now apply the lemma to each of them separately; in each column, at most 16 cells remain uncolored, i.e., at most 256 cells in total.
It remains to give an example of an arrangement in which it is impossible to leave fewer than 256 cells uncolored. Place ones in some 16×16 square, and zeros in all other cells. Consider any rectangle P; if it contains a one, then it intersects the square in some rectangle a×b (1≤a,b≤16); but then the sum of all numbers in P is ab, which cannot be divisible by 17. Thus, no cell with a one will be colored, so at least 256 cells remain uncolored.