Anonymous user
Anti-primes: Difference between revisions
m
→{{header|REXX}}: elided REXX version 2.
(→version 1: changed the format of the output from horizontal to vertical.) |
m (→{{header|REXX}}: elided REXX version 2.) |
||
Line 345:
=={{header|REXX}}==
This REXX version is using a modified version of a highly optimized ''proper divisors'' function.
Programming note: although the solution to this Rosetta Code task is trivial, a fair amount of optimization was incorporated into the REXX program to find larger anti─primes (highly─composite numbers).
The #DIVS function could be further optimized by only processing ''even'' numbers, with unity being treated as a special case.
<lang rexx>/*REXX program finds N number of anti─primes or highly─composite numbers. */
parse arg N . /*obtain optional argument from the CL.*/
Line 413 ⟶ 414:
</pre>
{{out|output|text= when using the default input of: <tt> 55 </tt>}}
<pre>
─index─ ──anti─prime──
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 61261200
</pre>
|