Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
16
Task/Tau-function/EasyLang/tau-function.easy
Normal file
16
Task/Tau-function/EasyLang/tau-function.easy
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
func cntdiv n .
|
||||
i = 1
|
||||
while i <= sqrt n
|
||||
if n mod i = 0
|
||||
cnt += 1
|
||||
if i <> n div i
|
||||
cnt += 1
|
||||
.
|
||||
.
|
||||
i += 1
|
||||
.
|
||||
return cnt
|
||||
.
|
||||
for i to 100
|
||||
write cntdiv i & " "
|
||||
.
|
||||
20
Task/Tau-function/MiniScript/tau-function.mini
Normal file
20
Task/Tau-function/MiniScript/tau-function.mini
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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(", ")
|
||||
Loading…
Add table
Add a link
Reference in a new issue