Created
June 3, 2021 15:57
-
-
Save sim642/131ef235b50be89ba43716a02c4d50be to your computer and use it in GitHub Desktop.
Haskell Golomb sequence
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
golomb@(_:_:g) = 1 : 2 : 2 : concatMap (uncurry replicate) (zip g [3..]) | |
-- golomb = 1 : 2 : g | |
-- where g = 2 : concatMap (uncurry replicate) (zip g [3..]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment