Post Reply 
2024 HHC Programming Contest - RPL
10-11-2024, 09:22 PM (This post was last modified: 10-12-2024 10:29 PM by Gilles.)
Post: #21
RE: 2024 HHC Programming Contest - RPL
I have not yet read the thread. Here is my proposition for 49 and 50g (exact mode):
Code:
« 
 2 →LIST DUP REVLIST « DUP DIVIS ΣLIST SWAP - » MAP
 SAME "YES" "NO" IFTE
»
79.5 bytes
609,928 and 686,072: YES in 0.55 seconds (HP50g)
Find all posts by this user
Quote this message in a reply
10-12-2024, 09:02 PM (This post was last modified: 10-13-2024 09:26 AM by Gilles.)
Post: #22
RE: 2024 HHC Programming Contest - RPL
newRPL version on HP50g Hdw. There is no DIVIS command in newRPL but we can use FACTORS, as wrote Thomas Klemm :
Code:
«
 2 →LIST 
 « FACTORS OVER SWAP 1 + ^ 1 - SWAP 1 - / ΠLIST NIP » MAP 
 ΔLIST "No" "Yes" IFTE 
»
108 bytes
609,928 and 686,072: YES in 0.0091 seconds (HP50g)

(*) Nota FACTORS works differently than standard RPL, so this program dont work with a stock HP49-50. Idem the ΔLIST "No" "Yes" IFTE sequence dont work in HP RPL. You need ΔLIST EVAL "No" "Yes" IFTE
Find all posts by this user
Quote this message in a reply
Post Reply 




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