Little problem(s) July 2022
|
07-10-2022, 10:37 PM
(This post was last modified: 07-11-2022 04:23 AM by Didier Lachieze.)
Post: #29
|
|||
|
|||
RE: Little problem(s) July 2022
Here is a solution to #1 on the Texas SR-52, the first programmable calculator with indirect register addressing back in 1975. It includes the list input.
Usage: 0 STO 99 then input each list element followed by [ A ], when finished input number N and press [ B ], after some time the program will return the index of the first element, press [RUN] to get the second element. You can then input another value for N and press [ B ] without having to input the list again. If there is no solution it returns 0 and 1. Example: 0 [STO] 99 2 [A] 7 [A] 11 [A] 15 [A] 17 [ B ] returns 1 and 4 then 18 [ B] returns 2 and 3 Performance: On my SR-52 with upgraded memory it can handle lists up to 49 elements (vs. 19 on a regular SR-52). With the list {1,2,3...48,49} searching for 3 returns 1 and 2 in 14 minutes. This is the worst case as the loops with dsz are done starting from the last element and going down. Code: Texas SR-52: 73 steps |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)