Created
April 15, 2014 01:16
-
-
Save yllan/10694209 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
| :m + Data.Numbers.Primes | |
| let digitSum n = sum $ map (\x -> read [x]::Integer) $ show n | |
| let digitRoot x | x < 10 = x | otherwise = digitRoot $ digitSum x | |
| let holesIn (x:y:xs) | y == x + 1 = holesIn (y:xs) | otherwise = [x+1..y-1] ++ holesIn (y:xs) | |
| let p = primes | |
| let c = (holesIn primes)::Int | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
digitRoot 可用 mod 9 來做。