Sequence: smallest number greater than previous term with exactly n divisors: Difference between revisions
Content added Content deleted
m (→{{header|RPL}}: missing '}') |
imported>Maxima enthusiast No edit summary |
||
Line 933: | Line 933: | ||
{{out}} |
{{out}} |
||
<pre>{1, 2, 4, 6, 16, 18, 64, 66, 100, 112, 1024, 1035, 4096, 4288, 4624}</pre> |
<pre>{1, 2, 4, 6, 16, 18, 64, 66, 100, 112, 1024, 1035, 4096, 4288, 4624}</pre> |
||
=={{header|Maxima}}== |
|||
<syntaxhighlight lang="maxima"> |
|||
sngptend(n):=block([i:1,count:1,result:[]], |
|||
while count<=n do (if length(listify(divisors(i)))=count then (result:endcons(i,result),count:count+1),i:i+1), |
|||
result)$ |
|||
/* Test case */ |
|||
sngptend(15); |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
[1,2,4,6,16,18,64,66,100,112,1024,1035,4096,4288,4624] |
|||
</pre> |
|||
=={{header|Nim}}== |
=={{header|Nim}}== |