Let
fm,n(i)=[mi]+[ni],S(m,n)=i=0∑mn−1(−1)fm,nn(i),
The problem is equivalent to finding the necessary and sufficient condition for S(m,n)=0.
Case 1: Both m and n are odd. In this case, S(m,n) is the sum of an odd number (mn) of odd numbers, so S(m,n)=0.
Case 2: One of m and n is odd, and the other is even. In this case, for 0⩽i⩽mn−1, we have
fm,n(mn−i−1)=[mmn−i−1]+[nmn−i−1]=m+n+[−mi+1]+[−ni+1]
We need the following result: For m∈N∗,i∈N,
[mi]+[−mi+1]=−1
In fact, let mi=k+α,k∈N,0⩽α<1, then [mi]=k, and 0⩽α⩽mm−1. At this time,
−mi+1=−k−α−m1⩾−k−mm−1−m1=−k−1,
and
−mi+1=−k−α−m1⩽−k−m1<−k
Therefore,
[−mi+1]=−(k+1)
This shows that (8) holds.
From (8) and (7), we know
fm,n(mn−i−1)=m+n−1−[mi]−1−[ni]=m+n−2−fm,n(i)≡fm,n(i)+1(mod2)
Thus, by pairing the first and last terms in the sum S(m,n) (noting that the number of terms mn is even), we can see that S(m,n)=0.
Case 3: Both m and n are even. Let m=2k,n=2l. Since for any p∈N∗,j∈N, we have [2p2j]=[2p2j+1], therefore, S(m,n) is twice the sum of all even i(0,2,⋯,mn−2), i.e.,
S(m,n)=2i=0∑2H−1(−1)fm,n(i=2i=0∑2H−1(−1)fk,l(i)=2(S(k,l)+i=kl∑2H−1(−1)fk,l(i))=2(S(k,l)+i=0∑k−1(−1)k+l⋅(−1)fk,l(i(i))=2S(k,l)(1+(−1)k+l)
By replacing k,l with m,n and repeating the above discussion until k,l are not both even, we find that the necessary and sufficient condition for S(m,n)=0 is: the exponents of 2 in the prime factorizations of m and n are different.