Skip to main content
added 51 characters in body
Source Link
Greg Martin
  • 16.7k
  • 4
  • 23
  • 73

Mathematica, 2222 19 bytes

Thanks to lanlock4 for saving 3 bytes!

#//.x_/;EvenQ@x?EvenQ:>3x/2& 

Pure function that does the replacement repeatedly, one factor of 2 at a time. Works on all positive integers less than 265537.

Mathematica, 22 bytes

#//.x_/;EvenQ@x:>3x/2& 

Pure function that does the replacement repeatedly, one factor of 2 at a time. Works on all positive integers less than 265537.

Mathematica, 22 19 bytes

Thanks to lanlock4 for saving 3 bytes!

#//.x_?EvenQ:>3x/2& 

Pure function that does the replacement repeatedly, one factor of 2 at a time. Works on all positive integers less than 265537.

Source Link
Greg Martin
  • 16.7k
  • 4
  • 23
  • 73

Mathematica, 22 bytes

#//.x_/;EvenQ@x:>3x/2& 

Pure function that does the replacement repeatedly, one factor of 2 at a time. Works on all positive integers less than 265537.