Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/Tau-function/Draco/tau-function.draco
Normal file
30
Task/Tau-function/Draco/tau-function.draco
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
proc nonrec tau(word n) word:
|
||||
word count, total, p;
|
||||
total := 1;
|
||||
while n & 1 = 0 do
|
||||
total := total + 1;
|
||||
n := n >> 1
|
||||
od;
|
||||
p := 3;
|
||||
while p*p <= n do
|
||||
count := 1;
|
||||
while n % p = 0 do
|
||||
count := count + 1;
|
||||
n := n / p
|
||||
od;
|
||||
total := total * count;
|
||||
p := p + 2
|
||||
od;
|
||||
if n>1
|
||||
then total << 1
|
||||
else total
|
||||
fi
|
||||
corp
|
||||
|
||||
proc nonrec main() void:
|
||||
byte n;
|
||||
for n from 1 upto 100 do
|
||||
write(tau(n):3);
|
||||
if n%20=0 then writeln() fi
|
||||
od
|
||||
corp
|
||||
Loading…
Add table
Add a link
Reference in a new issue