Semiprime: Difference between revisions

m
→‎version 3, with memoization: changed wording in the 3rd REXX section header.
m (→‎version 2: changed the font size of both output (windows).)
m (→‎version 3, with memoization: changed wording in the 3rd REXX section header.)
Line 1,917:
This REXX version is overt 20% faster than version 2   (when in the   ''millions''   range).
 
If the 2<sup>nd</sup> argument &nbsp; ('''top''') &nbsp; is negative &nbsp; (it's absolute value is used), &nbsp; individual numbers in the range aren't shown, but the &nbsp; ''count'' &nbsp; of semiprimes found is shown.
 
It gets its speed increase by the use of memoization of the prime numbers found, an unrolled primality (division) check, and other speed improvements.
<lang rexx>/*REXX program determines if any integer (or a range of integers) is/are semiprime. */
parse arg bot top . /*obtain optional arguments from the CL*/