Don't know what this expanding periodic-ish function is

42 Views Asked by At

I plotted a function $c(x)$, which returns $3x + 1$ if $x$ is odd, and $x/2$ if $x$ is even. It's the Collatz conjecture. I get this interesting function. I don't know what it's called, so I can't learn more about it. I would appreciate any help.

Thanks.

1

There are 1 best solutions below

0
On

The graph is made up of two parts:

When $x$ is odd, it is the graph of $f(x) = 3x + 1$.

When $x$ is odd, it is the graph of $f(x) = x/2$.

That's why you get two lines: the first with slope $3$ on top and the second with slope $1/2$ on the bottom.

Note that the lines between the dots should not be there. The domain is only on the integers.