Substring primes: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added a count for the number of primality tests performed.) |
m (→{{header|REXX}}: added a comment.) |
||
Line 172: | Line 172: | ||
if verify(x2, 25 , 'M')>0 then iterate /* " X2 part " " " " " */ |
if verify(x2, 25 , 'M')>0 then iterate /* " X2 part " " " " " */ |
||
L= length(x) /*obtain the length of the X prime.*/ |
L= length(x) /*obtain the length of the X prime.*/ |
||
ptests= ptests + 1 |
ptests= ptests + 1 /*bump count of the # primality tests. */ |
||
do k=1 for L-1 /*test for primality for all substrings*/ |
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.*/ |
do m=k+1 to L; y= substr(x, k, m-1) /*extract a substring from the X prime.*/ |