Created
December 6, 2011 13:05
-
-
Save chaoxu/1438142 to your computer and use it in GitHub Desktop.
Partition number in Haskell, using https://gist.github.com/1438136
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
integers = 0 : concat [[x,(-x)] | x <- [1..]] | |
generalizedPentagonalNumbers = [(3 * n^2 - n) `div` 2|n<-integers] | |
partitionNumbers = rec [1] (cycle [1,1,-1,-1]) (tail generalizedPentagonalNumbers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment