(12C+) how many primes between two numbers
|
08-22-2019, 06:48 AM
(This post was last modified: 08-22-2019 07:40 AM by Gamo.)
Post: #2
|
|||
|
|||
RE: (12C+) how many primes between two numbers
Very nice program tested and work great !!
I just happen to see the example program to "Generate Prime Number" from the HP-35S User Manual and I use that algorithm to work on the HP-12C+ or Emulators. I make some modification, instead of testing against square root I use X^2 this will run faster for large number. Procedure: If the input number is already prime the same number is display if not the next prime larger than the previous number display. FIX 0 n [R/S] display Prime Number [R/S] next Prime Number Program: Code:
Remark: Is there a better algorithm than this to search faster? Gamo |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(12C+) how many primes between two numbers - Don Shepherd - 06-30-2019, 11:30 PM
RE: (12C+) how many primes between two numbers - Gamo - 08-22-2019 06:48 AM
|
User(s) browsing this thread: 2 Guest(s)