Solution:
If we apply (i) to l rows and (ii) to k columns, we obtain (m−k)l+(n−l)k plus signs.
a.
We have the equation (100−k)l+(100−l)k=2004, or 100l+100k−2lk=2004.
50l+50k−lk=1002
Rewrite the last equation as
(50−l)(50−k)=2500−1002=1498
Since 1498=2⋅7⋅107, this equation has no solutions in natural numbers.
b.
Let n=101. Then we have
(100−k)l+(101−l)k=2004
Or
100l+101k−2lk=2004
That is,
101k=2004−100l+2lk
Or
101k−2lk=2004−100l
k(101−2l)=2004−100l
So
k=101−2l2004−100l
Since k must be a natural number, check possible l values. For l=4:
k=101−82004−400=931604≈17.25
Not integer. For l=5:
k=101−102004−500=911504≈16.53
Not integer. Continue checking, but no integer solution for n=101.
Let n=102. Then we have
(100−k)l+(102−l)k=2004
Or
100l+102k−2lk=2004
50l+51k−lk=1002
Rewrite the last equation as
(51−l)(50−k)=2550−1002=1548
Since 1548=2⋅2⋅3⋅3⋅43, try 51−l=36 and 50−k=43. Then l=15, k=7.
Indeed,
(100−7)⋅15+(102−15)⋅7=93⋅15+87⋅7=1395+609=2004
Hence, the least n is 102.