Nice primes: Difference between revisions

m
→‎{{header|REXX}}: added a foot header to the output.
m (→‎{{header|REXX}}: added a foot header to the output.)
Line 648:
 
if $\=='' then say center(idx, 7)"│" substr($, 2) /*possible display residual output.*/
if cols>0 then say '───────┴'center("" , 1 + cols*(w+1), '─')
say
say 'Found ' commas(Nprimes) @nice ' (not inclusive).'
Line 663 ⟶ 664:
if j// 3==0 then iterate /*" " " 3? */
if j// 7==0 then iterate /*" " " 7? */
/* [↑] the above five 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. ___ */
Line 677 ⟶ 678:
21 │ 821 839 853 857 887 907 911 929 941 947
31 │ 977 983 997
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────
 
Found 33 nice primes that are between 500 and 1,000 (not inclusive).