Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Tau-function/F-Sharp/tau-function.fs
Normal file
6
Task/Tau-function/F-Sharp/tau-function.fs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// Tau function. Nigel Galloway: March 10th., 2021
|
||||
let tau u=let P=primes32()
|
||||
let rec fN g=match u%g with 0->g |_->fN(Seq.head P)
|
||||
let rec fG n i g e l=match n=u,u%l with (true,_)->e |(_,0)->fG (n*i) i g (e+g)(l*i) |_->let q=fN(Seq.head P) in fG (n*q) q e (e+e) (q*q)
|
||||
let n=Seq.head P in fG 1 n 1 1 n
|
||||
[1..100]|>Seq.iter(tau>>printf "%d "); printfn ""
|
||||
Loading…
Add table
Add a link
Reference in a new issue