Hi Jeffery
Let me see if I am reading this right, you want to generate a set of PT and from this set you want to find 4 PT's that meet a criteria using those rules. I am assuming its only 4 from the description of your rules.
If I can now make a few observations, first if we are generating PT's then we don't need to use the first 4 rules as they are by definition PT's, secondly we don't need to use the last 4 rules either as all PT's generated will have Integer lengths ( assuming you do not use fractional lengths to generate the PT's in the first place. and so really all you are wanting to check are that from this sub list of 4 PT's a1 = b4 etc.
This now brings me to the method of generating the PT's, It is my experience that using the (m n) method to generate them isn't the best way, you don't have any real control over what PT's you are going to end up with and you certainly can't guarantee that you have found all PT's that have a certain say minimal length side. I like to use a method I developed quite some time ago that will generate all PT's with a small side of any length and is easily adapted to generate all PT's below a given length.
Finally regarding choosing 4 from a list can become a huge task considering that there are an infinite set of PT's and choosing any 4 of those can be memory hungry unless we restrict out list considerably, so here is a method that could be what you are looking for.
However I also have to point out that using your rules won't find anything no matter the size of list of PT's. If our list is sorted in size order of small side then choosing 4 PT's a1 can never equal b4. The only way it could work is if you allow duplicates where a and b also appear as b and a like {3, 4, 5} and {4, 3, 5}, but that is the same PT.
The following code will generate the PT's and then make a sub list of sets of 4 and look for matches where you can see how the testing is done. Hope this helps you some way. but correct me if this isn't what you are trying to do.
Column[t =
Table[t = Select[Divisors[n^2], # <= n &];
r = Reverse[Select[Cases[(n^2 - t^2)/(2 t), _Integer], # > n &]];
Table[{n, r[[s]], Sqrt[n^2 + r[[s]]^2]}, {s, 1, Length[r]}], {n, 3,
20}]]
ptlist = Partition[Flatten[t], 3]
sublist =
Cases[Subsets[
ptlist, {4}], {{a_, b_, c_}, {d_, e_, f_}, {g_, h_, i_}, {j_, k_,
l_}} /; a == k && b == d && e == g && h == j]
Paul.
p.s. changing the #>n to n>0 in this line r = Reverse[Select[Cases[(n^2 - t^2)/(2 t), _Integer], # > n &]];
will generate the duplicates.