Sha256: 553d2dc34c3461255907f1b00b18917d31a303d5dbfbea6fdd68312faee8ec69

Contents?: true

Size: 471 Bytes

Versions: 132

Compression:

Stored size: 471 Bytes

Contents

module PrimeFactors

open System

let factors number =
    let rec loop factors (remainder: int64) (factorToCheck: int64) =     
            match remainder with
            | _ when remainder <= 1L -> factors |> List.rev
            | _ when remainder % factorToCheck = 0L 
                    -> loop (int factorToCheck :: factors) (remainder / factorToCheck |> int64) factorToCheck
            | _ -> loop factors remainder (factorToCheck+1L)

    loop [] number 2L

Version data entries

132 entries across 132 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.179 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.178 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.177 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.176 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.175 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.174 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.173 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.172 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.171 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.170 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.169 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.167 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.166 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.165 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.164 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.163 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.162 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.161 tracks/fsharp/exercises/prime-factors/Example.fs
trackler-2.2.1.160 tracks/fsharp/exercises/prime-factors/Example.fs