Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
|||
// Generate Stern-Brocot Sequence. Nigel Galloway: October 11th., 2018
|
||||
let sb=Seq.unfold(fun (n::g::t)->Some(n,[g]@t@[n+g;g]))[1;1]
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
sb |> Seq.take 15 |> Seq.iter(printf "%d ");printfn ""
|
||||
[1..10] |> List.map(fun n->(n,(sb|>Seq.findIndex(fun g->g=n))+1)) |> List.iter(printf "%A ");printfn ""
|
||||
printfn "%d" ((sb|>Seq.findIndex(fun g->g=100))+1)
|
||||
printfn "There are %d consecutive members, of the first thousand members, with GCD <> 1" (sb |> Seq.take 1000 |>Seq.pairwise |> Seq.filter(fun(n,g)->gcd n g <> 1) |> Seq.length)
|
||||
Loading…
Add table
Add a link
Reference in a new issue