Post Reply 
Find number property and write RPL program (HP-49G,G+, HP 50g)
09-27-2014, 11:05 PM (This post was last modified: 09-27-2014 11:11 PM by Gerson W. Barbosa.)
Post: #21
RE: Find number property and write RPL program (HP-49G,G+, HP 50g)
%%HP: T(3)A(R)F(,);
\<< 1 { }
DO SWAP NEXTPRIME DUP DUP2 + 1 + ISPRIME? { UNROT + } { DROP SWAP } IFTE PICK3 OVER SIZE
UNTIL ==
END UNROT DROP2
\>>


%%HP: T(3)A(R)F(,);
\<< 1 { }
DO SWAP NEXTPRIME DUP DUP2 + 1 + ISPRIME? { UNROT + } { DROP SWAP } IFTE PICK3 PICK3
UNTIL \<=
END UNROT DROP2
\>>

%%HP: T(3)A(R)F(,);
\<< 2 * -1 -
\>>

PREVPRIME as the first instruction should be better and still less than 100-byte long.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Find number property and write RPL program (HP-49G,G+, HP 50g) - Gerson W. Barbosa - 09-27-2014 11:05 PM



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