Skip to content

Instantly share code, notes, and snippets.

@dungpa
Created June 5, 2012 14:09
Show Gist options
  • Save dungpa/2875235 to your computer and use it in GitHub Desktop.
Save dungpa/2875235 to your computer and use it in GitHub Desktop.
Auxiliary functions
let filterRange predicate (i, j) =
let results = ResizeArray(j-i+1) // reserve quite a lot of space.
for k = i to j do
if predicate k then results.Add(k)
results.ToArray()
let indivisible divisors b =
Array.forall (fun a -> b%a<>0) divisors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment