21 lines
270 B
Text
21 lines
270 B
Text
|
|
tau = function(n)
|
||
|
|
ans = 0
|
||
|
|
i = 1
|
||
|
|
while i * i <= n
|
||
|
|
if n % i == 0 then
|
||
|
|
ans += 1
|
||
|
|
j = floor(n / i)
|
||
|
|
if j != i then ans += 1
|
||
|
|
end if
|
||
|
|
i += 1
|
||
|
|
end while
|
||
|
|
return ans
|
||
|
|
end function
|
||
|
|
|
||
|
|
taus = []
|
||
|
|
for n in range(1, 100)
|
||
|
|
taus.push(tau(n))
|
||
|
|
end for
|
||
|
|
|
||
|
|
print taus.join(", ")
|