Anonymous user
Smallest square that begins with n: Difference between revisions
m
→{{header|REXX}}: simplified some code.
m (→{{header|REXX}}: changed program to not show the 50th number.) |
m (→{{header|REXX}}: simplified some code.) |
||
Line 163:
Also, the output display was generalized so that if a larger number is wider than expected, it won't be truncated.
<lang rexx>/*REXX program finds and displays (
numeric digits 20 /*ensure that large numbers can be used*/
parse arg n cols . /*get optional number of primes to find*/
Line 178:
end /*k*/
#= # + 1 /*bump the count of numbers found. */
$= $ right(
if #//cols\==0 then iterate /*have we populated a line of output? */
say center(idx, 7)'│' substr($, 2); $= /*display what we have so far (cols). */
|