Strange unique prime triplets: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: did further optimizations.)
Line 119:
tell= hi>0; hi= abs(hi); hi= hi - 1 /*use the absolute value of HI. */
if tell>0 then say 'list of unique strange (three) primes that sum to a prime:'
call genP /*build array of semiforessemaphores for primes. */
finds= 0 /*The number of strange primes (so far)*/
say
do m=2+1 by 2 to hi; if \!.m then iterate /*just use the odd primes. */
do n=m+12 by 2 to hi; if \!.n then iterate /* " " " " " */
mn= m + n /*compute a partial sum for deep loops.*/
do p=n+12 by 2 to hi; if \!.p then iterate /*just use the odd primes. */
sum= mn + p /*compute sum of 3 primes. */
if \!.sum then iterate /*Is the sum a prime? No, skip it. */
finds= finds + 1 /*bump the number of "strange" primes. */