Primes by Trial Division - REXX

23 September 2016

/* FIRST n PRIMES */
PARSE ARG n
count = 2
primes. = 0
DO i = 1 TO n
    SAY count
    primes.i = count
    count = count + 1
    j = 1
    DO WHILE primes.j > 0
        IF count // primes.j = 0 THEN DO
            count = count + 1
            j = 1
            ITERATE
        END
        j = j + 1
    END
END

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026

Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Primes Benchmark Source

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Primes Benchmark Results

Other Implementations

BCPL

perl

REXX

ruby

Tcl