(07-26-2018 12:57 AM)John Keith Wrote: So did I!
Emulated HP 50g with the ListExt Library took 3437 seconds on an ancient WinXP laptop. Same results.
...and yet another "brute force" method using ListExt with a slight twist on the check.
Code:
Spoiler alert!
\<<
0. 8. NDUPN \-> a b c d e f g h i
\<<
9. DUP LSEQ
SWAP
\<<
{ a b c d e f g h i } STO
a b + d e + SAME
{
c d + f g + SAME
{
e f + h i + SAME
{
{ a b c d e f g h i } LRCL R\->I
}
IFT
}
IFT
}
IFT
\>>
DOPERM
\>>
\>>
I assumed (hopefully correctly) that the following conditions had to hold:
a + b = d + e
c + d = f + g
e + f = h + i
So I nested the above tests to short-circuit them. If a + b ≠ d + e, then there's
no reason to continue checking. If it is, then if c + d ≠ f + g, there's no reason to
continue checking, etc.
The short-circuit made for a nice speed improvement over checking everything
each time through.