Post Reply 
hp 28s - creating nested lists
02-18-2015, 10:30 AM
Post: #15
RE: hp 28s - creating nested lists
If you have NDUPN at your disposal, it can be further simplified to:
Code:
\<<
  LIST\->
  DUP 2. + ROLL
  1. ROT START
    SWAP NDUPN \->LIST
  NEXT
\>>

For NDUPN, take any of the following:

Code:
NDUPN
\<< SWAP OVER 1. SWAP START SWAP OVER NEXT DROP \>>
\<< \-> N \<< 1. N START DUP NEXT DROP N \>> \>>
\<<
  -> n
  \<<
    1 2 n
    FOR i
      DUPN i DUP
    STEP
    n - DUP 0 <
    { NEG DUPN }
    { DROPN }
    IFTE
    n
  \>>
\>>
The last one outperforms even the builtin SYSEVAL for large N

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
hp 28s - creating nested lists - mbrethen - 02-16-2015, 04:33 PM
RE: hp 28s - creating nested lists - Werner - 02-18-2015 10:30 AM



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