Skip to content

Instantly share code, notes, and snippets.

@sim642
Created June 3, 2021 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sim642/131ef235b50be89ba43716a02c4d50be to your computer and use it in GitHub Desktop.
Save sim642/131ef235b50be89ba43716a02c4d50be to your computer and use it in GitHub Desktop.
Haskell Golomb sequence
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