Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions

Added XPL0 example.
m (→‎{{header|R}}: Syntax highlighting.)
(Added XPL0 example.)
Line 1,469:
The first 24 terms are:
[1, 2, 4, 6, 16, 18, 64, 66, 100, 112, 1024, 1035, 4096, 4288, 4624, 4632, 65536, 65572, 262144, 262192, 263169, 269312, 4194304, 4194306]
</pre>
 
=={{header|XPL0}}==
<lang XPL0>func Divs(N); \Count divisors of N
int N, D, C;
[C:= 0;
if N > 1 then
[D:= 1;
repeat if rem(N/D) = 0 then C:= C+1;
D:= D+1;
until D >= N;
];
return C;
];
 
int An, N;
[An:= 1; N:= 0;
loop [if Divs(An) = N then
[IntOut(0, An); ChOut(0, ^ );
N:= N+1;
if N >= 15 then quit;
];
An:= An+1;
];
]</lang>
 
{{out}}
<pre>
1 2 4 6 16 18 64 66 100 112 1024 1035 4096 4288 4624
</pre>
 
772

edits