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*/
LLm= length(j) /*obtain the length-1 of the number J. */
meat= left(j, L-1Lm) /*obtain the first L-1Lm digits of 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 tofor LLm-1 /*traipse through the middle digits. */
meat= left(j, a_ - 1) /*use a number of left─most dec. digits*/
rest= substr(j, a_ + 1) /* " " " " right─most " " */