Created
December 22, 2014 20:17
-
-
Save jneira/d280cbdde3a533a715d2 to your computer and use it in GitHub Desktop.
This file contains 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
a057531=[e | e<-[0..], (sum $ digits e) == (length $ divisors e)] | |
where divisors n=n:[i|i <- [1..n `div` 2], n `mod` i==0] | |
digits 0=[] | |
digits n=mod n 10: digits (div n 10) | |
*Exercitium> last $ takeWhile (<2015) a057531 | |
2006 | |
*Exercitium> head $ dropWhile (<=2015) a057531 | |
2101 | |
*Exercitium> length $ takeWhile (<=2015) a057531 | |
59 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment