EDIT: I opened up my notes and followed through some of my work and what I have found so far:
If there is a non-trivial solution for A2-B2=c, then it is of the form (A+2d)2-(B-4e)2 where d and e are integers. This will let me speed up my code as I can forget about half or 3/4 of the potential values. I am still working on cutting that down even more
I don't think this is true. And I see two problems with it.
1. (A+2d), the new A can't be greater than the original A. The reason why is that you can't get the difference between A
2 and B
2 any smaller than c because if you pick the best case scenario where B is 1 smaller, you'll get a new c by definition.
So I think it's supposed to be (A-2d)
2. (B-4e), I ran some tests, and some needed 2e
Here's what I did: (A,B)
First column is number, second column is the trivial solution, third is the special solution, 4th is difference from trivial
9 5,4 3,0 2,4
15 8,7 4,1 4,6
21 11,10 7,2 4,8
25 13,12 5,0 8,12
27 14,13 6,3 8,10
33 17,16 7,4 10,12
But, (A-2d)
2 - (B-2e)
2 still eliminates half the numbers.
Edit:
The table looks so much better in preview than in the actual forum, idk why.
Edit2:
e is always greater than d, so that's another half of the numbers