RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g)
|
07-03-2019, 10:33 PM
Post: #21
|
|||
|
|||
RE: RPL mini-challenge - Triangle of Primes (HP-49G/G+,50g)
(07-03-2019 08:00 PM)Gerson W. Barbosa Wrote: Thank you all for your interest, comments and great contributions! Wait, wait! I have 2 more... neither will be winners of anything, just different approaches to those presented before. The first one is literal translation of the algorithm you just revealed, except 'q' counts with step 1 and NEXTPRIME is done in pairs: Code:
The second one is inspired by the OEIS website, where it shows the highest number is ithPrime(k^2+k+1), so we can just do NEXTPRIME k^2+k+1 times, but keeping (with DUP) just the ones we are interested in, that have an index 'i' of the form 'i^2+i+1': Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)