Created
June 18, 2009 03:38
-
-
Save cmoore/131680 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gpfsearch :: ( Integral a ) => a -> a -> a | |
gpfsearch f x | x == f = x | |
| divides x f = gpfsearch f ( div x f ) | |
| otherwise = gpfsearch ( f + 1 ) x | |
where divides x y = mod x y == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment