Skip to main content
deleted 59 characters in body
Source Link
rturnbull
  • 3.9k
  • 16
  • 27

R, 34 bytes

f=pryr::f(`if`(n>1,1+f(log(n)),0))

Try it online!

A non-recursive approach is possible: 3536 bytes and takes input from stdin. It outputs FALSE instead of 0 but is otherwise correct.

n=scan()
while((n=log(n))>0)F=F+1
F+F

R, 34 bytes

f=pryr::f(`if`(n>1,1+f(log(n)),0))

Try it online!

A non-recursive approach is possible: 35 bytes and takes input from stdin. It outputs FALSE instead of 0 but is otherwise correct.

n=scan()
while((n=log(n))>0)F=F+1
F

R, 34 bytes

f=pryr::f(`if`(n>1,1+f(log(n)),0))

Try it online!

A non-recursive approach is possible: 36 bytes and takes input from stdin.

n=scan()
while((n=log(n))>0)F=F+1
+F
added 195 characters in body
Source Link
rturnbull
  • 3.9k
  • 16
  • 27

R, 34 bytes

f=pryr::f(`if`(n>1,1+f(log(n)),0))

Try it online!

A non-recursive approach is possible: 35 bytes and takes input from stdin. It outputs FALSE instead of 0 but is otherwise correct.

n=scan()
while((n=log(n))>0)F=F+1
F

R, 34 bytes

f=pryr::f(`if`(n>1,1+f(log(n)),0))

Try it online!

R, 34 bytes

f=pryr::f(`if`(n>1,1+f(log(n)),0))

Try it online!

A non-recursive approach is possible: 35 bytes and takes input from stdin. It outputs FALSE instead of 0 but is otherwise correct.

n=scan()
while((n=log(n))>0)F=F+1
F
Source Link
rturnbull
  • 3.9k
  • 16
  • 27

R, 34 bytes

f=pryr::f(`if`(n>1,1+f(log(n)),0))

Try it online!