Skip to main content
Golfed 2 bytes
Source Link
Delfad0r
  • 6.3k
  • 20
  • 32

Haskell, 5757 55 bytes

  • -2 bytes thanks to kops.
sum<$>iterate f[2](!1)[2] f(x:y)=f y++!n=y!(1+length y<$[1n+1)++(n<$[1..x]) f e=ee!_=e 

Try it online!Try it online!

The whole Levine sequence.

Haskell, 57 bytes

sum<$>iterate f[2] f(x:y)=f y++(1+length y<$[1..x]) f e=e 

Try it online!

The whole Levine sequence.

Haskell, 57 55 bytes

  • -2 bytes thanks to kops.
sum<$>iterate(!1)[2] (x:y)!n=y!(n+1)++(n<$[1..x]) e!_=e 

Try it online!

The whole Levine sequence.

Source Link
Delfad0r
  • 6.3k
  • 20
  • 32

Haskell, 57 bytes

sum<$>iterate f[2] f(x:y)=f y++(1+length y<$[1..x]) f e=e 

Try it online!

The whole Levine sequence.