Jump to content

Tau function: Difference between revisions

PascalABC.NET
(Added Asymptote)
(PascalABC.NET)
 
Line 2,033:
8|10 5 4 2 12 4 4 4 8 2
9|12 4 6 4 4 4 12 2 6 6 </pre>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
##
function DivisorsCount(n: integer) := Range(1,n).Count(i -> n.Divs(i));
 
Range(1,100).Select(n -> DivisorsCount(n)).Println
</syntaxhighlight>
{{out}}
<pre>
1 2 2 3 2 4 2 4 3 4 2 6 2 4 4 5 2 6 2 6 4 4 2 8 3 4 4 6 2 8 2 6 4 4 4 9 2 4 4 8 2 8 2 6 6 4 2 10 3 6 4 6 2 8 4 8 4 4 2 12 2 4 6 7 4 8 2 6 4 8 2 12 2 4 6 6 4 8 2 10 5 4 2 12 4 4 4 8 2 12 4 6 4 4 4 12 2 6 6 9</pre>
 
 
=={{header|Perl}}==
170

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.