Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Tau-function/PL-I/tau-function.pli
Normal file
23
Task/Tau-function/PL-I/tau-function.pli
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
taufunc: procedure options(main);
|
||||
tau: procedure(nn) returns(fixed);
|
||||
declare (n, nn, tot, pf, cnt) fixed;
|
||||
tot = 1;
|
||||
do n=nn repeat(n/2) while(mod(n,2)=0);
|
||||
tot = tot + 1;
|
||||
end;
|
||||
do pf=3 repeat(pf+2) while(pf*pf<=n);
|
||||
do cnt=1 repeat(cnt+1) while(mod(n,pf)=0);
|
||||
n = n/pf;
|
||||
end;
|
||||
tot = tot * cnt;
|
||||
end;
|
||||
if n>1 then tot = tot * 2;
|
||||
return(tot);
|
||||
end tau;
|
||||
|
||||
declare n fixed;
|
||||
do n=1 to 100;
|
||||
put edit(tau(n)) (F(3));
|
||||
if mod(n,20)=0 then put skip;
|
||||
end;
|
||||
end taufunc;
|
||||
Loading…
Add table
Add a link
Reference in a new issue