initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
module _46
|
||||
|
||||
let smallestOddCompositeNotSumOfPrimeTwiceSquare =
|
||||
let ceiling = 10000
|
||||
|
||||
let composites =
|
||||
common.compositeArray ceiling
|
||||
|> Seq.filter (fun c -> c % 2 = 1)
|
||||
|> Set.ofSeq
|
||||
|
||||
let twiceSquares =
|
||||
Seq.unfold (fun state -> Some(2 * state * state, state + 1)) 1
|
||||
|
||||
let primes = common.primeArray ceiling
|
||||
let twiceSquareList = twiceSquares |> Seq.take ceiling
|
||||
|
||||
let sumOfPrimceTwiceSquare =
|
||||
common.crossMap (+) primes twiceSquareList
|
||||
|> Seq.distinct
|
||||
|> Set.ofSeq
|
||||
|
||||
Set.difference composites sumOfPrimceTwiceSquare
|
||||
Reference in New Issue
Block a user