Anonymous user
Unprimeable numbers: Difference between revisions
m
→{{header|REXX}}: optimized the program.
(→{{header|REXX}}: simplified parts of the program, optimized for speed.) |
m (→{{header|REXX}}: optimized the program.) |
||
Line 1,768:
/*1─ and 2─digit #'s are all primeable.*/
do j=100; if !.j then iterate /*Prime? Unprimeable must be composite*/
meat= left(j,
/* [↑] examine the "end" digit of J. */
do e_=1 for eds; new= meat || ed.e_ /*obtain a different number (than J).*/
Line 1,780:
if !.new then iterate j /*This new number a prime? " " */
end /*f_*/ /* [↑] examine the front digit of J. */
do a_= 2
meat= left(j, a_ - 1) /*use a number of left─most dec. digits*/
rest= substr(j, a_ + 1) /* " " " " right─most " " */
|