Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Tau-function/CLU/tau-function.clu
Normal file
29
Task/Tau-function/CLU/tau-function.clu
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
tau = proc (n: int) returns (int)
|
||||
total: int := 1
|
||||
while n//2 = 0 do
|
||||
total := total + 1
|
||||
n := n/2
|
||||
end
|
||||
p: int := 3
|
||||
while p*p <= n do
|
||||
count: int := 1
|
||||
while n//p = 0 do
|
||||
count := count + 1
|
||||
n := n/p
|
||||
end
|
||||
total := total * count
|
||||
p := p+2
|
||||
end
|
||||
if n>1 then
|
||||
total := total * 2
|
||||
end
|
||||
return(total)
|
||||
end tau
|
||||
|
||||
start_up = proc ()
|
||||
po: stream := stream$primary_output()
|
||||
for n: int in int$from_to(1, 100) do
|
||||
stream$putright(po, int$unparse(tau(n)), 3)
|
||||
if n//20=0 then stream$putl(po, "") end
|
||||
end
|
||||
end start_up
|
||||
Loading…
Add table
Add a link
Reference in a new issue