Prove that since m+n is an odd prime, n−m+1 is even. Therefore, H(m,n) has an even number of terms.
Let mn1+(m+1)(n−1)1+⋯2m+n−1⋅21+2n+1=rs,(r,s)=1,r,s∈N.
It is easy to see that the prime factors of r are all less than or equal to n, so,
(m+n,r)=1.∵H(m,n)=pq,∴pq=r(m+n)s,
which means
(m+n)sp=rq.∵(m+n,r)=1,∴(m+n)∣q.
The 21st IMO has a problem as follows:
Let p,q be natural numbers, pq=1−21+31−41+⋯ −13181+13191. Prove: 1979∣q.
It is easy to see that
pq=H(1,1319)−2(21+41+⋯+13181)=H(1,1319)−H(1,659)=H(660,1319).
Since 660+1319=1979 is a prime number, by Example 2, we know 1979∣q.