Post Reply 
RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g)
06-30-2019, 11:05 PM
Post: #4
RE: RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g)
(06-30-2019 09:10 PM)Valentin Albillo Wrote:  .
Hi, Gerson:

(06-30-2019 08:41 PM)Gerson W. Barbosa Wrote:  Write an RPL program that lists the elements in the central column of the triangle of primes above, starting from a(0) = 2 up to a(k).

You need to define what k is supposed to be.

Also, as this is (as usual) an RPL mini-challenge I won't enter my HP-71B solution, which is a short one-liner.

Hello, Valentin,

I hope the examples I have provided compensate for some lack of rigor from my part. “k” is the number of elements in the list minus 1.
Yes, it can fit in one HP-71BASIC line if either NEXTPRIME() or PRIME() function is available. Of course, being this an RPL mini-chalenge, the size of your BASIC code won’t compare to equivalent RPL codes. However, considering optimized algorithms can possibly make for shorter RPL codes than we currently have, I think the submission of non-RPL programs might be helpful, so they’re always welcome.

Best regards,

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

Messages In This Thread
RE: RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g) - Gerson W. Barbosa - 06-30-2019 11:05 PM

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