Anonymous user
Sequence: nth number with exactly n divisors: Difference between revisions
Sequence: nth number with exactly n divisors (view source)
Revision as of 16:09, 8 March 2021
, 3 years ago→{{header|REXX}}: moved a function.
m (→little optimization: updated the output with segment spacing.) |
m (→{{header|REXX}}: moved a function.) |
||
Line 1,214:
commas: parse arg _; do j=length(_)-3 to 1 by -3; _=insert(',', _, j); end; return _
pPow: numeric digits 1000; return @.i**(i-1) /*temporarily increase decimal digits. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
#divs: procedure; parse arg x 1 y /*X and Y: both set from 1st argument.*/
Line 1,240 ⟶ 1,241:
do j=11 by 6 until j*j>#; if # // j==0 | # // (J+2)==0 then return 0
end /*j*/ /* ___ */
return 1 /*Exceeded √ # ? Then # is prime. */</lang>
▲tell: parse arg _; say center(i, 10) right(_, max(w, length(_) ) )
{{out|output|text= when using the input: <tt> 45 </tt>}}
Line 1,358 ⟶ 1,356:
done: do f=N by -1 for N-3; if \zfin.f then return 0; end; return 1
pPow: numeric digits 2000; return @.j**(j-1) /*temporarily increase decimal digits. */
tell: parse arg _; say center(i,10) right(_,max(w,length(_))); if i//5==0 then say; return
/*──────────────────────────────────────────────────────────────────────────────────────*/
#divs: procedure; parse arg x 1 y /*X and Y: both set from 1st argument.*/
Line 1,389 ⟶ 1,388:
if #//(i+2)==0 then return 0
end /*i*/ /* ___ */
return 1 /*Exceeded √ # ? Then # is prime. */</lang>
{{out|output|text= is identical to the 1<sup>st</sup> REXX version.}} <br><br>
|