Project Euler Problem 723
A pythagorean triangle with catheti a and b and hypotenuse c is characterized by the well-known equation a^2+b^2=c^2.
Solution
Answer: 1395793419248
Let
$$n=\prod p_i^{e_i}.$$
A key reduction for this problem is that the quadrilateral count depends only on the exponent vector $(e_i)$, not on the actual primes. The exact-count function can be written as
$$F(n)= 7\prod B_1(e_i) -14\prod B_2(e_i) -4\prod B_3(e_i) +8\prod B_4(e_i) +4\prod B_5(e_i),$$
where
$$\begin{aligned} B_1(e)&=e+1,\ B_2(e)&=(e+1)^2,\ B_3(e)&=\left\lfloor \frac{(e+1)^2+1}{2}\right\rfloor,\ B_4(e)&=(e+1)^3,\ B_5(e)&=\frac{(e+1)(2e^2+4e+3)}{3}. \end{aligned}$$
For the divisor sum
$$S(n)=\sum_{d\mid n}F(d),$$
the local sums are
$$\begin{aligned} A_1(e)&=\frac{(e+1)(e+2)}2,\ A_2(e)&=\frac{(e+1)(e+2)(2e+3)}6,\ A_3(e)&=\frac12\left(A_2(e)+\left\lfloor \frac e2\right\rfloor+1\right),\ A_4(e)&=A_1(e)^2,\ A_5(e)&=\frac{(e+1)(e+2)(e^2+3e+3)}6. \end{aligned}$$
Thus
$$S(n)= 7\prod A_1(e_i) -14\prod A_2(e_i) -4\prod A_3(e_i) +8\prod A_4(e_i) +4\prod A_5(e_i).$$
For
$$n=5^6\cdot13^3\cdot17^2\cdot29\cdot37\cdot41\cdot53\cdot61,$$
the exponent vector is
$$(6,3,2,1,1,1,1,1).$$
Compute the products:
$$\begin{aligned} \prod A_1 &= 408240,\ \prod A_2 &= 183750000,\ \prod A_3 &= 2239488,\ \prod A_4 &= 166659897600,\ \prod A_5 &= 16273209680. \end{aligned}$$
Therefore,
$$\begin{aligned} S(n) &= 7(408240) -14(183750000) -4(2239488) +8(166659897600) +4(16273209680)\ &=1395793419248. \end{aligned}$$
This matches the independently listed result for Problem 723.
Answer: 1395793419248