Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions
Content added Content deleted
(Added various BASIC dialects (BASIC256, Gambas, PureBasic, QBasic, Run BASIC, XBasic and Yabasic)) |
(Added Easylang) |
||
Line 724: | Line 724: | ||
<pre>The first 15 terms of the sequence are: |
<pre>The first 15 terms of the sequence are: |
||
1 2 4 6 16 18 64 66 100 112 1024 1035 4096 4288 4624</pre> |
1 2 4 6 16 18 64 66 100 112 1024 1035 4096 4288 4624</pre> |
||
=={{header|EasyLang}}== |
|||
{{trans|AWK}} |
|||
<syntaxhighlight> |
|||
func ndivs n . |
|||
i = 1 |
|||
while i <= sqrt n |
|||
if n mod i = 0 |
|||
cnt += 2 |
|||
if i = n div i |
|||
cnt -= 1 |
|||
. |
|||
. |
|||
i += 1 |
|||
. |
|||
return cnt |
|||
. |
|||
n = 1 |
|||
while n <= 15 |
|||
i += 1 |
|||
if n = ndivs i |
|||
write i & " " |
|||
n += 1 |
|||
. |
|||
. |
|||
</syntaxhighlight> |
|||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
Line 738: | Line 764: | ||
1 2 4 6 16 18 64 66 100 112 1024 1035 4096 4288 4624 4632 65536 65572 262144 262192 263169 269312 4194304 4194306 4477456 4493312 4498641 4498752 |
1 2 4 6 16 18 64 66 100 112 1024 1035 4096 4288 4624 4632 65536 65572 262144 262192 263169 269312 4194304 4194306 4477456 4493312 4498641 4498752 |
||
</pre> |
</pre> |
||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
<syntaxhighlight lang="factor">USING: io kernel math math.primes.factors prettyprint sequences ; |
<syntaxhighlight lang="factor">USING: io kernel math math.primes.factors prettyprint sequences ; |