# [Haskell](https://www.haskell.org), 46 bytes ```haskell g _ 0=[] g(h:t)n=h:g(t++[sum$h:t])(n-1) ``` ``` g.g[1] ``` [Attempt This Online!](https://ato.pxeger.com/run?1=m708I7E4OzUnZ8GCpaUlaboWNw3SFeIVDGyjY7nSNTKsSjTzbDOs0jVKtLWji0tzVYAisZoaebqGmlxptul66dGGsVB9YbmJmXkKtgop-VwKCrmJBb4KBUWZeSVAjkK0QpqCsYIFiKkDZJorGBrD2IYKRgYwtrGBggmMbapgaAhiQ02HuQ4A)