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
+22
View File
@@ -0,0 +1,22 @@
module _92
open common
let squareChainLoop =
let squareDigits d =
let square n = n * n
d |> numDigits |> Seq.map square |> Seq.sum
let chainDict = new System.Collections.Generic.Dictionary<int,int>()
let rec chainCache = function
| x when chainDict.ContainsKey(x) -> chainDict.[x]
| 1 -> 1
| 89 -> 89
| x -> chainDict.[x] <- chainCache (squareDigits x); chainDict.[x]
allIntegers |> Seq.skip 1 |> Seq.takeWhile ((>) 10000000)
|> Seq.map chainCache
|> Seq.filter ((=) 89)
|> Seq.length