Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
38
Task/Tau-function/Action-/tau-function.action
Normal file
38
Task/Tau-function/Action-/tau-function.action
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
CARD FUNC DivisorCount(CARD n)
|
||||
CARD result,p,count
|
||||
|
||||
result=1
|
||||
WHILE (n&1)=0
|
||||
DO
|
||||
result==+1
|
||||
n=n RSH 1
|
||||
OD
|
||||
|
||||
p=3
|
||||
WHILE p*p<=n
|
||||
DO
|
||||
count=1
|
||||
WHILE n MOD p=0
|
||||
DO
|
||||
count==+1
|
||||
n==/p
|
||||
OD
|
||||
result==*count
|
||||
p==+2
|
||||
OD
|
||||
|
||||
IF n>1 THEN
|
||||
result==*2
|
||||
FI
|
||||
RETURN (result)
|
||||
|
||||
PROC Main()
|
||||
CARD max=[100],n,divCount
|
||||
|
||||
PrintF("Tau function for the first %U numbers%E",max)
|
||||
FOR n=1 TO max
|
||||
DO
|
||||
divCount=DivisorCount(n)
|
||||
PrintC(divCount) Put(32)
|
||||
OD
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue