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.119 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.118 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.117 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.116 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.115 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.114 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.113 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.111 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.110 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.109 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.108 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.107 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.106 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.105 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.104 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.103 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.102 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.101 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.100 tracks/fsharp/exercises/armstrong-numbers/Example.fs
trackler-2.2.1.99 tracks/fsharp/exercises/armstrong-numbers/Example.fs