I was messing around looking into the collatz conjecture in q/k4 and I realized that I could write the short cut collatz function without any conditionals as follows by taking advantage of the fact that you can use the result of x mod 2 to zero out some terms when x is even.
I've linked a chart of the function with its definition in more familiar mathematical notation. It's extended onto the reals by utilizing the floor function.
note: no operator precedence in q/k
After some algebra I arrived at Figured I'd share what I found since I don't see this formula mentioned on https://en.wikipedia.org/wiki/Collatz_conjecture . Has anybody else encountered this formula?I've linked a chart of the function with its definition in more familiar mathematical notation. It's extended onto the reals by utilizing the floor function.
PS: Notation is a tool of thought!