Skip to main content
added 378 characters in body
Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283

Haskell, 48 bytes

f n=sum$sum[1..n]`take`do z<-[1..];[1,0]<*[1..z]

Try it online!

Haskell, 48 bytes

sum.(take.sum.r<*>(([1,0]<*).r=<<).r)
r n=[1..n]

Try it online!

Haskell, 48 bytes

f n=sum$sum[1..n]`take`do z<-[1..];[1,0]<*[1..z]

Try it online!

Haskell, 48 bytes

f n=sum$sum[1..n]`take`do z<-[1..];[1,0]<*[1..z]

Try it online!

Haskell, 48 bytes

sum.(take.sum.r<*>(([1,0]<*).r=<<).r)
r n=[1..n]

Try it online!

Source Link
lynn
  • 69.2k
  • 11
  • 133
  • 283

Haskell, 48 bytes

f n=sum$sum[1..n]`take`do z<-[1..];[1,0]<*[1..z]

Try it online!