(11C) Random Prime Number Generator
10-20-2018, 01:08 PM (This post was last modified: 10-22-2018 10:27 AM by Gamo.)
Post: #1
 Gamo Senior Member Posts: 736 Joined: Dec 2016
(11C) Random Prime Number Generator
Program to Generate Random Prime Number.

Procedure: Fix 0

[E] display Prime Number

Example:
This program use Random Number Generator range approximately
from 1000 to 9999 and some time the result will get below 1000.

Below result is randomly difference on each run

[E] display 7247
[E] display 7013
[E] display 5351
[E] display 3209

Program:
Code:
 LBL E RAN# EEX 4 x INT 1001 X<>Y X>Y (Test 7) GTO 2 GTO E ---------------------------- LBL 2 2 ÷ INT 2 x 1 + STO 0 3 STO 1 ----------------------------- LBL 4 RCL 0 RCL 1 ÷ LSTx X>Y (Test 7) GTO 0 X<>Y INT LSTx X=Y (Test 5) GTO E 2 STO+1 GTO 4 ----------------------------- LBL 0 RCL 0 RTN

Remark: This program will run much faster on the emulator.

Gamo
 « Next Oldest | Next Newest »

 Messages In This Thread (11C) Random Prime Number Generator - Gamo - 10-20-2018 01:08 PM RE: (11C) Random Prime Number Generator - Dieter - 10-20-2018, 07:08 PM RE: (11C) Random Prime Number Generator - Gamo - 10-21-2018, 03:22 AM RE: (11C) Random Prime Number Generator - Dieter - 10-21-2018, 05:09 PM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-21-2018, 08:45 AM RE: (11C) Random Prime Number Generator - Dieter - 10-21-2018, 04:41 PM RE: (11C) Random Prime Number Generator - Albert Chan - 10-21-2018, 01:31 PM RE: (11C) Random Prime Number Generator - John Keith - 10-21-2018, 01:52 PM RE: (11C) Random Prime Number Generator - Dieter - 10-22-2018, 11:03 AM RE: (11C) Random Prime Number Generator - Dieter - 10-21-2018, 05:20 PM RE: (11C) Random Prime Number Generator - Albert Chan - 10-21-2018, 07:02 PM RE: (11C) Random Prime Number Generator - Albert Chan - 10-22-2018, 01:02 AM RE: (11C) Random Prime Number Generator - Gene - 10-21-2018, 07:47 PM RE: (11C) Random Prime Number Generator - Dieter - 10-21-2018, 09:09 PM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-21-2018, 08:47 PM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-21-2018, 09:03 PM RE: (11C) Random Prime Number Generator - Gene - 10-21-2018, 10:02 PM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-22-2018, 03:46 AM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-22-2018, 04:10 AM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-22-2018, 09:11 AM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-22-2018, 09:22 AM RE: (11C) Random Prime Number Generator - Gamo - 10-22-2018, 10:32 AM RE: (11C) Random Prime Number Generator - Dieter - 10-22-2018, 11:23 AM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-22-2018, 12:28 PM RE: (11C) Random Prime Number Generator - Thomas Klemm - 10-22-2018, 12:31 PM RE: (11C) Random Prime Number Generator - Dieter - 10-22-2018, 06:43 PM

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