Substring primes: Difference between revisions

m
→‎{{header|REXX}}: changed the location of counting of primality tests.
m (→‎{{header|REXX}}: added a comment.)
m (→‎{{header|REXX}}: changed the location of counting of primality tests.)
Line 175:
do k=1 for L-1 /*test for primality for all substrings*/
do m=k+1 to L; y= substr(x, k, m-1) /*extract a substring from the X prime.*/
ptests= ptests + 1 /*bump count of the # primality tests. */
if \!.y then iterate j /*does substring of X not prime? Skip.*/
end /*m*/
Line 210 ⟶ 211:
Found 9 primes (base ten) where all substrings are also primes < 500
 
1214 primality tests were performed.
</pre>