(11C) Random Prime Number Generator
|
10-21-2018, 08:45 AM
Post: #4
|
|||
|
|||
RE: (11C) Random Prime Number Generator
We can restrict the search to numbers that aren't divisible by 2, 3 or 5.
Thus we only choose numbers of the sequence: 7, 11, 13, 17, 19, 23, 29, 31, … On the other hand we only use these numbers to check if the chosen random number is divisible. Initialisation Store the following numbers into these registers: 1: 31 2: 29 3: 23 4: 19 5: 17 6: 13 7: 11 8: 7 Code: ▸LBL A Drawback: 2, 3 and 5 are never chosen. Though I haven't tested I assume it runs faster. Kind regards Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)