If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of p ≤ 1000, is the number of solutions maximized?
Source: Project Euler
5040 in Steven's answer is a big clue.
u^2v^2+u^2+v^2+2uv =2u(u+v), hence the number of solutions can be maximised by setting p to have a record number of divisors.
Then it's just a matter of lookup; Sloane, A002182, Highly Composite Numbers:
1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720, 840, 1260, 1680, 2520, 5040, etc.
Edited on December 8, 2018, 10:34 pm

Posted by broll
on 20181208 22:33:45 