Post Reply 
Little problem(s) July 2022
07-06-2022, 06:16 AM
Post: #13
RE: Little problem(s) July 2022
This is a solution for #1 for the HP-42S:
Code:
00 { 38-Byte Prgm }
01▸LBL "FIND"
02 GTO 01
03▸LBL 00
04 RCL IND ST Y
05 RCL+ IND ST Y
06 RCL- 00
07 X=0?
08 GTO 02
09 R↓
10 DSE ST X
11 GTO 00
12 R↓
13 DSE ST X
14▸LBL 01
15 ENTER
16 DSE ST X
17 GTO 00
18▸LBL 02
19 R↓
20 END

But it should work with the HP-41C as well after minor adjustments.
The \(\text{target}\) and the values of the list \(\{a_1, a_2, \cdots, a_n\}\) are expected in the registers:

R00: \(\text{target}\)
R01: \(a_1\)
R02: \(a_2\)

Rnn: \(a_n\)

Example

17 STO 00

2 STO 01
7 STO 02
11 STO 03
15 STO 04

4
XEQ "FIND"

4
1
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Little problem(s) July 2022 - pier4r - 07-04-2022, 06:04 PM
RE: Little problem(s) July 2022 - pauln - 07-05-2022, 01:01 AM
RE: Little problem(s) July 2022 - pier4r - 07-05-2022, 10:00 AM
RE: Little problem(s) July 2022 - pier4r - 07-05-2022, 01:56 PM
RE: Little problem(s) July 2022 - pier4r - 07-07-2022, 10:51 AM
RE: Little problem(s) July 2022 - DavidM - 07-07-2022, 12:02 PM
RE: Little problem(s) July 2022 - DavidM - 07-07-2022, 03:09 PM
RE: Little problem(s) July 2022 - pier4r - 07-07-2022, 05:19 PM
RE: Little problem(s) July 2022 - Thomas Klemm - 07-06-2022 06:16 AM
RE: Little problem(s) July 2022 - Werner - 07-06-2022, 07:48 AM
RE: Little problem(s) July 2022 - DavidM - 07-07-2022, 05:27 PM
RE: Little problem(s) July 2022 - pier4r - 07-07-2022, 05:37 PM
RE: Little problem(s) July 2022 - pauln - 07-11-2022, 05:34 AM
RE: Little problem(s) July 2022 - pauln - 07-11-2022, 10:32 PM



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