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
+28
View File
@@ -0,0 +1,28 @@
module _23
let abundantUpperLimit = 28123
let abundantNumbers =
let dSums =
common.divisors abundantUpperLimit
|> Array.mapi (fun i divisors -> (i, List.fold (+) 0 divisors))
dSums |> Array.choose ( fun (i, dSum) ->
match dSum with
| abundant when dSum > i -> Some(i)
| _ -> None
)
let sumNotAbundant =
let a = abundantNumbers
// add all abubundant numbers together
let sums = common.crossMap (+) a a |> Seq.distinct |> Seq.toArray
let sna =
sums
|> Set.ofSeq
|> (-) (Set.ofList [1..abundantUpperLimit])
|> Set.toSeq
//|> Array.rev
sna |> Seq.fold (+) 0