initial commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
module _27
|
||||
|
||||
open System
|
||||
|
||||
let quadraticConsecutivePrimes =
|
||||
let range = [-1000..1000]
|
||||
|
||||
let isPrime = common.isPrimeFunByMax 100000
|
||||
|
||||
let primeLength f =
|
||||
common.allIntegers
|
||||
|> Seq.map f
|
||||
|> Seq.takeWhile isPrime
|
||||
|> Seq.length
|
||||
|
||||
let abs = common.crossMap (fun a b -> (a,b)) range range
|
||||
|
||||
let quadradic (a,b) n =
|
||||
n*n + a*n + b
|
||||
|
||||
abs
|
||||
|> Seq.map (fun ab -> (ab, ab |> (quadradic >> primeLength)))
|
||||
|> Seq.maxBy snd
|
||||
|> (fun ((a,b),_)-> a * b)
|
||||
Reference in New Issue
Block a user