Skip to main content
added 9 characters in body
Source Link
BlackCap
  • 3.9k
  • 16
  • 33

Haskell, 71 4949 48 bytes

f x=length.takeWhilefst.span(<x).scanl(+)0$(0.5/)<$>[1..]

@BMO saved me a whopping 22 bytes!

Haskell, 71 49 bytes

f x=length.takeWhile(<x).scanl(+)0$(0.5/)<$>[1..]

@BMO saved me a whopping 22 bytes!

Haskell, 71 49 48 bytes

f x=length.fst.span(<x).scanl(+)0$(0.5/)<$>[1..]

@BMO saved me a whopping 22 bytes!

deleted 3 characters in body
Source Link
BlackCap
  • 3.9k
  • 16
  • 33

Haskell, 71 5249 bytes

f x=length.takeWhile(<x)$scanl.scanl(+)0[1/0$(2*i0.5/)|i<-[1<$>[1..]]]

@BMO saved me a whopping 22 bytes!

Haskell, 71 52 bytes

f x=length.takeWhile(<x)$scanl(+)0[1/(2*i)|i<-[1..]]

Haskell, 71 49 bytes

f x=length.takeWhile(<x).scanl(+)0$(0.5/)<$>[1..]

@BMO saved me a whopping 22 bytes!

[Edit removed during grace period]; deleted 14 characters in body
Source Link
BlackCap
  • 3.9k
  • 16
  • 33

Haskell, 7171 52 bytes

import Data.List
f x=length.takeWhile(<x)$sum<$>inits[1$scanl(+)0[1/(2*i)|i<-[1..]]

Haskell, 71 bytes

import Data.List
f x=length.takeWhile(<x)$sum<$>inits[1/(2*i)|i<-[1..]]

Haskell, 71 52 bytes

f x=length.takeWhile(<x)$scanl(+)0[1/(2*i)|i<-[1..]]
Source Link
BlackCap
  • 3.9k
  • 16
  • 33
Loading