initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
module _63
|
||||
|
||||
open System
|
||||
open common
|
||||
|
||||
let powerDigits =
|
||||
let powDigitCount e n =
|
||||
let d = Math.Log10(float n) * float e
|
||||
Math.Floor d + 1.0 |> int
|
||||
|
||||
let findNthPowerDigits e =
|
||||
let pdc = powDigitCount e
|
||||
allIntegers
|
||||
|> Seq.map (fun i -> (i, pdc i))
|
||||
|> Seq.skipWhile (fun (_,n) -> n < e)
|
||||
|> Seq.takeWhile (fun (_,n) -> n <= e)
|
||||
|> Seq.toArray
|
||||
|
||||
allIntegers |> Seq.skip 1
|
||||
|> Seq.map findNthPowerDigits
|
||||
|> Seq.takeWhile (Seq.isEmpty >> not)
|
||||
|> Seq.collect (fun p -> p)
|
||||
|> Seq.length
|
||||
Reference in New Issue
Block a user