Project Euler Problem 338

A rectangular sheet of grid paper with integer dimensions w times h is given.

Project Euler Problem 338

Solution

Answer: 15614292

After reducing the geometric operation to a divisor-counting problem and evaluating the resulting summatory arithmetic functions efficiently (using divisor summatory transforms and hyperbola decomposition to handle $N=10^{12}$), the required value is:

Answer: 15614292