Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions
Sequence: smallest number greater than previous term with exactly n divisors (view source)
Revision as of 22:27, 8 March 2021
, 3 years agoAdded 11l
Alpha bravo (talk | contribs) (Added AutoHotkey) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 18:
:* [[Sequence: nth number with exactly n divisors]]
<br><br>
=={{header|11l}}==
{{trans|Python}}
<lang 11l>F divisors(n)
V divs = [1]
L(ii) 2 .< Int(n ^ 0.5) + 3
I n % ii == 0
divs.append(ii)
divs.append(Int(n / ii))
divs.append(n)
R Array(Set(divs))
F sequence(max_n)
V previous = 0
V n = 0
[Int] r
L
n++
V ii = previous
I n > max_n
L.break
L
ii++
I divisors(ii).len == n
r.append(ii)
previous = ii
L.break
R r
L(item) sequence(15)
print(item)</lang>
{{out}}
<pre>
1
2
4
6
16
18
64
66
100
112
1024
1035
4096
4288
4624
</pre>
=={{header|Ada}}==
|