Anonymous user
Summarize primes: Difference between revisions
m
→{{header|REXX}}: changed comments and whitespace.
Thundergnat (talk | contribs) m (→{{header|Raku}}: trivial modification to make it do double duty) |
m (→{{header|REXX}}: changed comments and whitespace.) |
||
Line 1,004:
=={{header|REXX}}==
<lang rexx>/*REXX pgm finds summation primes P, primes which the sum of primes up to P are prime. */
parse arg hi
if
call genP /*build array of semaphores for primes.*/
w= 30; w2= w*2%3; pad= left('',w-w2) /*the width of the columns two & three.*/
commas(hi)
say ' index │' center(subword(
say '───────┼'center("" , 1 + (w+1)*2, '─') /* " sep. */
do j=1 for hi-1; p= @.j;
if \!.
say right(j, 6) '│'strip( right(commas(p), w2)pad || right(commas(
end /*j*/
say '───────┴'center("" , 1 + (w+1)*2, '─')
say
say 'Found ' commas(
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
|