(33s) OEIS A4186: Digits in Descending Order
|
09-25-2022, 04:18 PM
(This post was last modified: 09-25-2022 04:38 PM by C.Ret.)
Post: #6
|
|||
|
|||
RE: (33s) OEIS A4186: Digits in Descending Order
Hello,
This weekend, I found a way to rent a friend's HP-35S along with its owner's manual. What a funny machine! It is with great difficulty that I managed to adapt my second algorithm to it, the one that gives the integers with the numbers sorted in ascending and descending order. Be indulgent, this is my first program on HP-35S; it is it is intended to be used in RPN mode and with the ALL display option. Code: O001 ►LBL O O011 x<>y O021 1 O031 × O041 1 O051▫ STO I It's a bit long code but it has the advantage of using only one label (LBL O). Unlike the HP-41C version, it handles integers up to 12 digits which it temporarily stores in twelve anonymous registers using indirect addressing via the I register. It also uses flag #1 because I couldn't find a simple instruction to reset or reserve the anonymous register range. The flag is used to reset the anonymous registers on the first pass. At the beginning of the code, I put 13 in the anonymous register (13) in order to 'reserve' without surprise the range (1) to (12). It's a bit of a hassle on this machine, isn't it? The keyboard is far too overloaded, I prefer, by far, to use my more sober HP-41C and with better organized registers. 3142 XEQ O ENTER run a few seconds and display 1234 4321 The initial value 3142 is kept in the register N This version clears all the registers. To preserve memory contents, please alter the code with the starter sequence: Code: O001 LBL O |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(33s) OEIS A4186: Digits in Descending Order - Gerald H - 09-22-2022, 03:33 AM
RE: (33s) OEIS A4186: Digits in Descending Order - C.Ret - 09-24-2022, 07:41 AM
RE: (33s) OEIS A4186: Digits in Descending Order - Gerald H - 09-24-2022, 11:32 AM
RE: (33s) OEIS A4186: Digits in Descending Order - Gerald H - 09-24-2022, 11:56 AM
RE: (33s) OEIS A4186: Digits in Descending Order - C.Ret - 09-24-2022, 12:44 PM
RE: (33s) OEIS A4186: Digits in Descending Order - C.Ret - 09-25-2022 04:18 PM
|
User(s) browsing this thread: 1 Guest(s)