I'm looking at ways to optimize my algorithm for solving Project Euler #75, two things I have done so far are,
- Only check L with even values as this can be easily proved.
- Store L values that have been verified to have only one way to form an integer sided right angle triangle. Later on, when checking a new L value, I look for L's divisors that are already verified to have this quality. If there are 2 or more divisors, then this value is skipped. E.g. 12, 30 and 40 are stored (24, 36, etc. are not stored because they are really enlarged versions of 12), so when I see 60 or 120, I can quickly determine that they should be skipped.
However my algorithm is still not quick enough. Do you have other suggestions or links to relevant articles? Thanks.