Step 1: Set up N.
Let \(N = 3^a \times 5^b \times 7^c \times 11^d\), with \(a, b, c, d \ge 1\) since each prime occurs at least once.
Step 2: Use the factor-count formula.
Number of factors of N \(= (a+1)(b+1)(c+1)(d+1) = 32 = 2^5\).
Since each of \(a+1, b+1, c+1, d+1\) is at least 2, and their product is a pure power of 2, each of them must itself be a power of 2. Writing \(a+1 = 2^{k_1}\) etc., we need \(k_1+k_2+k_3+k_4 = 5\) with each \(k_i \ge 1\). The only way to write 5 as a sum of four positive integers is \(2+1+1+1\).
So \((a+1, b+1, c+1, d+1)\) is a permutation of \((4, 2, 2, 2)\), which means \((a, b, c, d)\) is a permutation of \((3, 1, 1, 1)\).
Step 3: Maximise N.
To make N largest, put the biggest exponent (3) on the largest prime (11), and exponent 1 on the rest:
\(N_{max} = 3^1 \times 5^1 \times 7^1 \times 11^3 = 3 \times 5 \times 7 \times 1331 = 105 \times 1331 = 1,39,755\).
Step 4: Minimise N.
To make N smallest, put the biggest exponent (3) on the smallest prime (3):
\(N_{min} = 3^3 \times 5^1 \times 7^1 \times 11^1 = 27 \times 385 = 10,395\).
Step 5: Find the difference.
\(N_{max} - N_{min} = 1,39,755 - 10,395 = 1,29,360\).
So Harsha won Rs. 1,29,360.