Neighbour primes: Difference between revisions

m
→‎{{header|REXX}}: changed the GENP subroutine.
(Added Sidef)
m (→‎{{header|REXX}}: changed the GENP subroutine.)
Line 607:
/* [↓] generate more primes ≤ high.*/
do j=@.#+2 by 2 to limit /*find odd primes from here on. */
parse var j '' -1 _; if if _==5 then iterate /*J divisible÷ by 5? (right digdigit).*/
if j//3==0 then iterate; if j// 37==0 then iterate /*" " " 3? J ÷ by 7? */
if j// 7==0 then iterate /*" " " 7? */
/* [↑] the above 3 lines saves time.*/
do k=5 while s.k<=j /* [↓] divide by the known odd primes.*/
if j // @.k == 0 then iterate j /*Is J ÷ X? Then not prime. ___ */