(41C) Pythagorean Triples
06-27-2022, 05:51 AM
Post: #4
 Thomas Klemm Senior Member Posts: 1,830 Joined: Dec 2013
RE: (41C) Pythagorean Triples
With obvious transformations, I thought more of something like: STO+ ST X $$\mapsto$$ ST+ X.

Thanks for improving my program.

Using DSE instead of ISG avoids the calculation of the index.
Also by using it twice in a row we still use a step size of 2:
Code:
07  LBL 00 08   DSE 05  XEQ 02  DSE 05  GTO 00

I should have remembered that with STO Z we also have tuck ~ swap over:
Code:
18  LBL 03 19   STO Z  MOD  X≠0?  GTO 03

I would probably rather use SIGN instead of 10^X to map $$0 \mapsto 1$$ but its nice to add both $$1 + 1 = 2$$ and use the result as a factor when calculating $$2 \cdot m \cdot n$$ in the following steps:
Code:
23  10^X  X≠Y?  RTN 26  +  CLA

I wasn't aware of FMT or probably just forgot about it.
It makes for a nice listing:
Code:
40  -  FMT  ACX  RDN  ACX  RDN  ACX

Well done!
 « Next Oldest | Next Newest »

 Messages In This Thread (41C) Pythagorean Triples - SlideRule - 10-15-2019, 12:57 PM RE: (41C) Pythagorean Triples - Thomas Klemm - 06-25-2022, 03:40 PM RE: (41C) Pythagorean Triples - C.Ret - 06-26-2022, 09:29 AM RE: (41C) Pythagorean Triples - Thomas Klemm - 06-27-2022 05:51 AM RE: (41C) Pythagorean Triples - Ángel Martin - 06-29-2022, 01:02 PM RE: (41C) Pythagorean Triples - John Keith - 07-01-2022, 11:55 AM RE: (41C) Pythagorean Triples - C.Ret - 07-03-2022, 08:18 AM RE: (41C) Pythagorean Triples - John Keith - 07-03-2022, 01:55 PM RE: (41C) Pythagorean Triples - Thomas Klemm - 07-03-2022, 10:46 AM RE: (41C) Pythagorean Triples - C.Ret - 07-03-2022, 01:41 PM

User(s) browsing this thread: 1 Guest(s)