Sha256: 56e8055ba1e2fd4ab53698a7b63906d4da4f3a7e37630e55ef902ea045094053

Contents?: true

Size: 263 Bytes

Versions: 105

Compression:

Stored size: 263 Bytes

Contents

module ArmstrongNumbers

let isArmstrongNumber (number: int) =
    let charToNumber c = int c - int '0'
    let numberAsString = string number
    let charToPower c = pown (charToNumber c) numberAsString.Length
    Seq.sumBy charToPower numberAsString = number

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
trackler-2.2.1.78 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.77 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.76 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.75 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.74 tracks/fsharp/exercises/armstrong-numbers/Example.fs