What comes next?
|
10-16-2024, 08:38 PM
Post: #35
|
|||
|
|||
RE: What comes next?
This program might be faster:
Code: \<< DUP ROT + SWAP DUP { } + SWAP ROT It is of order \(\mathcal{O}(n)\) instead of \(\mathcal{O}(n^2)\) and works similarly to my initial program for the HP-42S. Example { 1 } 2 NXT { 2 1 } 3 DROP 4 NXT { 4 2 1 } 7 DROP 8 NXT { 8 4 2 1 } 15 DROP 16 NXT { 16 8 4 2 1 } 31 NXT { 31 15 7 3 1 0 } 57 NXT { 57 26 11 4 1 0 0 } 99 NXT { 99 42 16 5 1 0 0 0 } 163 NXT { 163 64 22 6 1 0 0 0 0 } 256 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)