initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
module _112
|
||||
|
||||
let bouncy90 =
|
||||
let bouncy n =
|
||||
common.numDigits n
|
||||
|> Seq.pairwise
|
||||
|> Seq.filter (fun (i,j) -> i <> j)
|
||||
|> Seq.map (fun (i,j) -> i > j)
|
||||
|> Seq.distinct
|
||||
|> Seq.length > 1
|
||||
|
||||
common.allIntegers
|
||||
|> Seq.skip 1
|
||||
|> Seq.map (fun i -> (i,bouncy i))
|
||||
|> Seq.scan (fun (t,f) (i,b) ->
|
||||
if b then (t+1,f) else (t,f+1)) (0,0)
|
||||
|> Seq.map (fun (t,f) -> if t = 0 then 0.0 else ((float t)/((float t)+(float f))))
|
||||
|> Seq.findIndex ((<=) 0.99)
|
||||
Reference in New Issue
Block a user