Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/Fusc-sequence/F-Sharp/fusc-sequence-1.fs
Normal file
3
Task/Fusc-sequence/F-Sharp/fusc-sequence-1.fs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
// Generate the fusc sequence. Nigel Galloway: March 20th., 2019
|
||||
let fG n=seq{for (n,g) in Seq.append n [1] |> Seq.pairwise do yield n; yield n+g}
|
||||
let fusc=seq{yield 0; yield! Seq.unfold(fun n->Some(n,fG n))(seq[1])|>Seq.concat}|> Seq.mapi(fun n g->(n,g))
|
||||
1
Task/Fusc-sequence/F-Sharp/fusc-sequence-2.fs
Normal file
1
Task/Fusc-sequence/F-Sharp/fusc-sequence-2.fs
Normal file
|
|
@ -0,0 +1 @@
|
|||
fusc |> Seq.take 61 |> Seq.iter(fun(_,g)->printf "%d " g); printfn ""
|
||||
2
Task/Fusc-sequence/F-Sharp/fusc-sequence-3.fs
Normal file
2
Task/Fusc-sequence/F-Sharp/fusc-sequence-3.fs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
let fN=let mutable n=0 in (fun (_,g)->if g>=n then n<-pown 10 (string g).Length; true else false)
|
||||
fusc |> Seq.filter fN |> Seq.take 7 |> Seq.iter(fun(n,g)->printfn "fusc %d -> %d" n g)
|
||||
Loading…
Add table
Add a link
Reference in a new issue