initial commit

This commit is contained in:
2025-08-03 20:16:55 -07:00
commit 87a130499d
89 changed files with 10241 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
module _14
let collatzConjecture n =
match n with
| 0L -> None
| 1L -> Some(1L,0L)
| n -> Some(n,
if n % 2L = 0L then n/2L
else if n % 2L = 1L then 3L*n + 1L
else 1L)
let getLongestChain =
[1L..1000000L]
|> Seq.map (fun i -> (i |> Seq.unfold collatzConjecture |> Seq.length, i))
|> Seq.max