Skip to content

Instantly share code, notes, and snippets.

@prakhar1989
Created August 1, 2014 17:29
Show Gist options
  • Save prakhar1989/f2dfb608baefc38a9969 to your computer and use it in GitHub Desktop.
Save prakhar1989/f2dfb608baefc38a9969 to your computer and use it in GitHub Desktop.
(*>* Problem 5 *>*)
(* few_divisors n m should return true if n has fewer than m divisors,
* (including 1 and n) and false otherwise: *)
few_divisors 17 3;;
- : bool = true
# few_divisors 4 3;;
- : bool = false
# few_divisors 4 4;;
- : bool = true
(* The type signature for few_divisors is: *)
(* few_divisors : int -> int -> bool *)
@prakhar1989
Copy link
Author

number of divisors of 17 = 2
number of divisors of 3 = 2

2 < 2 => false 

Shouldn't few_divisors 17 3;; be true?

@pratikmallya
Copy link

yes

@pratikmallya
Copy link

wait, fewer than 3 divisors, right? So few_divisors 4 3 ;; should be true also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment