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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)