Anonymous user
Tau number: Difference between revisions
m
→{{header|REXX}}: added/changed comments, added a foot title.
m (→{{header|REXX}}: added/changed comments, added a foot title.) |
|||
Line 1,613:
=={{header|REXX}}==
<lang rexx>/*REXX pgm displays N tau numbers, an integer divisible by the # of its divisors). */
parse arg n cols .
if n=='' | n=="," then
▲w= max(7, length(n) ) /*W: used to align 1st output column. */
say ' index │'center(@tau, 1 + cols*(w+1) ) /*display the title of the output table*/
$= /*$: the output list, shown ten/line. */▼
say '───────┼'center("" , 1 + cols*(w+1), '─') /* " " header " "
do j=1 until #==n /*search for N tau numbers */
if j//tau(j) \==0 then iterate /*Is this a tau number? No, then skip.*/
#= # + 1 /*bump the count of tau numbers found. */
$= $
if #//
say
end /*j*/
if $\=='' then say center(
say '───────┴'center("" , 1 + cols*(w+1), '─')
exit 0 /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
Line 1,650 ⟶ 1,652:
{{out|output|text= when using the default input:}}
<pre>
───────┼───────────────────────────────────────────────────────────────────────────────────────────
1 │ 1 2 8 9 12 18 24 36 40 56
11
───────┴───────────────────────────────────────────────────────────────────────────────────────────
</pre>
|