Solution:
Answer: 20134025
We claim that the set of grids on which it is possible to obtain an array of all zeroes (mod 2013) is indexed by ordered 4025-tuples of residues (mod 2013), corresponding to the starting entries in the first row and first column of the grid, giving the answer of 20134025.
To do this, we show that after fixing all of the entries in the first row and column, there is a unique starting grid which can become an array of all zeroes after applying the appropriate operations.
Let ai,j be the entry in the i-th row and the j-th column. Suppose there is a sequence of operations giving all zeroes in the array; let ri be the number of times we operate on row i, and let cj be the number of times we operate on column j. It is enough to take all of these values to be residues modulo 2013. Clearly, ai,j+ri+cj≡0(mod2013) for each i,j. In particular, r1+c1≡a1,1.
Now, for each i,j, we have
ai,j≡−ri−cj≡(ai,1+c1)+(a1,j+r1)≡ai,1+a1,j−a1,1,
which is fixed. Thus, the rest of the entries in the grid are forced.
Conversely, if we set ai,j to be the appropriate representative of the residue class of ai,1+a1,j−a1,1 modulo 2013, we may take ri≡−ai,1(mod2013), and cj≡a1,1−a1,j(mod2013) for each i,j. It is clear that ai,j+ri+cj≡0(mod2013) for each i,j, so we're done.