Post Reply 
RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
06-02-2019, 10:43 PM
Post: #21
RE: RPL exercise - Last Digits of Primes (HP 49G, G+, 50g)
(06-01-2019 09:59 PM)Valentin Albillo Wrote:   
 
Hi again, Gerson:

(06-01-2019 03:29 PM)Gerson W. Barbosa Wrote:  Please do it if you wish, that's no intrusion. I mentioned RPL and those particular models because they have ISPRIME built-in (not sure about the HP-71B or its Math ROM).

Ok, thanks. Since you asked for it, this is my HP-71B code. All the work is done by the one line in the middle (45 bytes), the first line is just initialization and the last line is just for outputting results and timing:

      1   DESTROY ALL @ DIM T(9) @ INPUT N @ SETTIME 0 @ P=5
      2   FOR I=1 TO N @ P=FPRIM(P+2) @ L=MOD(P,10) @ T(L)=T(L)+1 @ NEXT I
      3   FOR I=1 TO 9 STEP 2 @ DISP T(I); @ NEXT I @ DISP TIME

 

Hello, Valentin,

Thank you very much for the HP-71B version, much appreciated!
I’ve noticed, however, FPRIM() is not a standard HP-71B function. I assume it’s a LEX file, a Language EXtension file by what I can remember. So, my question – not addressed exclusively to you, but to whom else can answer it – is: what is the easiest way to implement it on the real HP-71B or at least on Emu71? Thanks in advance.

Best regards,

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: RPL exercise - Last Digits of Primes (HP 49G, G+, 50g) - Gerson W. Barbosa - 06-02-2019 10:43 PM



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